Skip to content

Commit 6f74a55

Browse files
committed
libiconv: add UTF-8-MAC encoding patch
1 parent ec3e8b8 commit 6f74a55

2 files changed

Lines changed: 1649 additions & 0 deletions

File tree

pkgs/development/libraries/libiconv/default.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ stdenv.mkDerivation rec {
3131
setupHooks = [
3232
../../../build-support/setup-hooks/role.bash
3333
./setup-hook.sh
34+
patches = [
35+
# Add support for the UTF-8-MAC encoding. This is needed for correct behavior of applications that interact with
36+
# the filesystem on Darwin because it uses a variant of NFD to store filenames.
37+
#
38+
# Patch is vendored to avoid an infinite recursion in the Darwin bootstrap.
39+
# Source: https://github.com/macports/macports-ports/blob/ce1083dbec406fcea0f2678308ae85639798aa6e/textproc/libiconv/files/patch-utf8mac.diff
40+
./patch-utf8mac.diff
3441
];
3542

3643
postPatch =
@@ -82,6 +89,12 @@ stdenv.mkDerivation rec {
8289
# remove after gnulib is updated
8390
++ lib.optional stdenv.hostPlatform.isCygwin "gl_cv_clean_version_stddef=yes";
8491

92+
preBuild = ''
93+
# The UTF-8-MAC patch requires regenerating `flags.h`
94+
make -C lib genflags
95+
lib/genflags > lib/flags.h
96+
'';
97+
8598
passthru = { inherit setupHooks; };
8699

87100
meta = {

0 commit comments

Comments
 (0)