Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions pkgs/development/libraries/icu/make-icu.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv, lib, buildPackages, fetchurl, fixDarwinDylibNames, testers }:

{ version, hash, patches ? [], patchFlags ? [] }:
{ version, hash, patches ? [], patchFlags ? [], withStatic ? stdenv.hostPlatform.isStatic }:

let
# Cross-compiled icu4c requires a build-root of a native compile
Expand Down Expand Up @@ -36,9 +36,12 @@ let
sed -e 's/LDFLAGSICUDT=-nodefaultlibs -nostdlib/LDFLAGSICUDT=/' -i config/mh-linux
'';

dontDisableStatic = withStatic;

configureFlags = [ "--disable-debug" ]
++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath"
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}";
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}"
++ lib.optional withStatic "--enable-static";

enableParallelBuilding = true;

Expand All @@ -58,15 +61,18 @@ let
realAttrs = baseAttrs // {
name = pname + "-" + version;

outputs = [ "out" "dev" ];
outputs = [ "out" "dev" ] ++ lib.optional withStatic "static";
outputBin = "dev";

# FIXME: This fixes dylib references in the dylibs themselves, but
# not in the programs in $out/bin.
nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;

# remove dependency on bootstrap-tools in early stdenv build
postInstall = lib.optionalString stdenv.isDarwin ''
postInstall = lib.optionalString withStatic ''
mkdir -p $static/lib
mv -v lib/*.a $static/lib
'' + lib.optionalString stdenv.isDarwin ''
sed -i 's/INSTALL_CMD=.*install/INSTALL_CMD=install/' $out/lib/icu/${version}/pkgdata.inc
'' + (let
replacements = [
Expand Down