NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.31k stars 14.28k forks source link

ladybird: add UCD and CLDR #212792

Open fgaz opened 1 year ago

fgaz commented 1 year ago
          This is  erroring out because the default.nix file is completely disabling the UCD and CLDR downloads, rather than providing a local copy of them from nixpkgs. Looks like we broke non-unicode DB downloads recently. 

However, the browser is severely limited without those files, as any and all unicode and calendar and timezone support will just error out the JS engine.

See https://github.com/NixOS/nixpkgs/pull/186484/files#diff-14f7abcc87051d753d55fcb19df574b2b603f37ac730a906a9f718f5026b6599R37-R59

You can set the expected location of the extracted files with -DUCD_PATH, -DTZDB_PATH, -DCLDR_PATH and their respective UCD_ZIP_PATH, CLDR_ZIP_PATH, TZDB_ZIP_PATH cmake variables.

Note that if the version of those packages (tzdata, unicode-character-database, cldr-annotations-json) and the dumped version.txt for each must match the expected versions in serenity/Meta/CMake/{time_zone_data, unicode_data, locale_data}.cmake or it will try to download them anyway.

Note that the build also wants to download the "emoji-test.txt" file, which is not part of either unicode.org data set .zip file.:

set(EMOJI_TEST_URL "https://unicode.org/Public/emoji/${EMOJI_VERSION}/emoji-test.txt")
set(EMOJI_TEST_PATH "${UCD_PATH}/emoji-test.txt")

As long as that file exists in the UCD_PATH before running cmake, it won't try to download it.

Originally posted by @ADKaster in https://github.com/NixOS/nixpkgs/issues/200495#issuecomment-1328118057

ADKaster commented 1 year ago

Another note, in https://github.com/SerenityOS/serenity/commit/2334b4cebdcce1104d85afa75315c2721cc2df83 we made it so that passing -DSERENITY_CACHE_DIR=/some/path makes it not as necessary to specify the path for UCD, CLDR, and TZDB downloaded artifacts directly.