contour-terminal / libunicode

Modern C++20 Unicode library
Apache License 2.0
104 stars 15 forks source link

How to deal with UCD file when packaging libunicode #68

Closed topazus closed 1 year ago

topazus commented 1 year ago

The unicode-ucd package in Fedora provides the same thing with the ucd download from https://www.unicode.org/Public/15.0.0/ucd/UCD.zip. The reviewer asked me to give some explanations about the UCD in the review request of libunicode on Fedora bugzilla.

[ruby@fedora ~]$ dnf se unicode-ucd
Last metadata expiration check: 6 days, 0:55:44 ago on Sat 18 Feb 2023 08:05:11 AM EST.
=========================================== Name Exactly Matched: unicode-ucd ===========================================
unicode-ucd.noarch : Unicode Character Database
=============================================== Name Matched: unicode-ucd ===============================================
perl-Unicode-UCD.noarch : Unicode character database
unicode-ucd-unihan.noarch : Unicode Han Database
[ruby@fedora ~]$ ls /usr/share/unicode/ucd/
ArabicShaping.txt          DerivedNormalizationProps.txt   NameAliases.txt               ScriptExtensions.txt
auxiliary                  EastAsianWidth.txt              NamedSequencesProv.txt        Scripts.txt
BidiBrackets.txt           emoji                           NamedSequences.txt            SpecialCasing.txt
BidiCharacterTest.txt      EmojiSources.txt                NamesList.html                StandardizedVariants.txt
BidiMirroring.txt          EquivalentUnifiedIdeograph.txt  NamesList.txt                 TangutSources.txt
BidiTest.txt               extracted                       NormalizationCorrections.txt  UnicodeData.txt
Blocks.txt                 HangulSyllableType.txt          NormalizationTest.txt         USourceData.txt
CaseFolding.txt            Index.txt                       NushuSources.txt              USourceGlyphs.pdf
CJKRadicals.txt            IndicPositionalCategory.txt     PropertyAliases.txt           USourceRSChart.pdf
CompositionExclusions.txt  IndicSyllabicCategory.txt       PropertyValueAliases.txt      VerticalOrientation.txt
DerivedAge.txt             Jamo.txt                        PropList.txt
DerivedCoreProperties.txt  LineBreak.txt                   ReadMe.txt

https://github.com/contour-terminal/libunicode/blob/f921d1baabe0714aed700657c1e6e229c9fa0db4/CMakeLists.txt#L58

I do not find a good method to deal with this. changing ${LIBUNICODE_UCD_BASE_DIR}/ucd-${LIBUNICODE_UCD_VERSION} to /usr/share/unicode/ucd where the UCD files provided by unicode-ucd package can work. Any better suggestions? @christianparpart

related issue: https://github.com/contour-terminal/libunicode/issues/56

christianparpart commented 1 year ago

Hello @topazus.

I discovered that directory too. If I remember correctly, it was not containing all the information we needed to populate the internal UCD data structures.

I am not sure how you deal in the .spec file with it (in packaging). What I did for .deb file creations in sandboxed packaging is, to pre-fetch the .zip files from upstream (unicode.org) and have these packaged with the source code.

Let me see what the state is as of right now and report back ASAP.

christianparpart commented 1 year ago

Wow. it works. Adjusting commit incoming....

christianparpart commented 1 year ago

Okay. I have merged it to master. Do you need a new release for this, or is it sufficient to simply apply the commit (eb40101359cb283be0b736f6bda383243522fa91) (as patch) in the spec file?

topazus commented 1 year ago

Okay. I have merged it to master. Do you need a new release for this, or is it sufficient to simply apply the commit (eb40101) (as patch) in the spec file?

Maybe I can use a patch file at this time

topazus commented 1 year ago

Closing this since the the review request of libunicode package is approved. Thanks a lot.

christianparpart commented 1 year ago

yay. Many thanks for your work!