Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

64 lines
1.8 KiB
Nix
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
lib,
adv_cmds,
bmake,
fetchFromGitHub,
stdenvNoCC,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "locale";
version = "118";
# This data is old, but its closer to what macOS has than FreeBSD. Trying to use the FreeBSD data
# results in test failures due to different behavior (e.g., with zh_CN and spaces in gnulibs `trim` test).
# TODO(@reckenrode) Update locale data using https://cldr.unicode.org to match current macOS locale data.
src = fetchFromGitHub {
owner = "apple-oss-distributions";
repo = "adv_cmds";
rev = "adv_cmds-118";
hash = "sha256-KzaAlqXqfJW2s31qmA0D7qteaZY57Va2o86aZrwyR74=";
};
sourceRoot = "${finalAttrs.src.name}/usr-share-locale.tproj";
postPatch = ''
# bmake expects `Makefile` not `BSDmakefile`.
find . -name Makefile -exec rm {} \; -exec ln -s BSDmakefile {} \;
# Update `Makefile`s to: get commands from `PATH`, and install to the correct location.
# Note: not every `Makefile` has `rsync` or the project name in it.
for subproject in colldef mklocale monetdef msgdef numericdef timedef; do
substituteInPlace "$subproject/BSDmakefile" \
--replace-warn "../../$subproject.tproj/" "" \
--replace-fail /usr/share/locale /share/locale \
--replace-fail '-o ''${BINOWN} -g ''${BINGRP}' "" \
--replace-warn "rsync -a" "cp -r"
done
# Update `bsdmake` references to `bmake`
substituteInPlace Makefile \
--replace-fail bsdmake bmake
'';
enableParallelBuilding = true;
nativeBuildInputs = [
adv_cmds
bmake
];
enableParallelInstalling = true;
installFlags = [ "DESTDIR=${placeholder "out"}" ];
meta = {
description = "Locale data for Darwin";
license = [
lib.licenses.apsl10
lib.licenses.apsl20
];
teams = [ lib.teams.darwin ];
};
})