From e719f64a053d03362957c8ef8087f25a58eb17d4 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 1 Jun 2014 05:51:16 +0000 Subject: [PATCH] graphite2: fix #2800 by setting INSTALL_NAME_DIR --- pkgs/development/libraries/harfbuzz/default.nix | 2 +- .../development/libraries/silgraphite/graphite2.nix | 2 ++ pkgs/development/libraries/silgraphite/macosx.patch | 13 +++++++++++++ pkgs/tools/typesetting/tex/texlive/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 pkgs/development/libraries/silgraphite/macosx.patch diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix index 9cdd2a275bff..2e596b17af3d 100644 --- a/pkgs/development/libraries/harfbuzz/default.nix +++ b/pkgs/development/libraries/harfbuzz/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, pkgconfig, glib, freetype, cairo, libintlOrEmpty , icu, graphite2 , withIcu ? false # recommended by upstream as default, but most don't needed and it's big -, withGraphite2 ? !stdenv.isDarwin # it is small and major distros do include it +, withGraphite2 ? true # it is small and major distros do include it }: # TODO: split non-icu and icu lib into different outputs? diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix index f874804c0010..83f64d1eb009 100644 --- a/pkgs/development/libraries/silgraphite/graphite2.nix +++ b/pkgs/development/libraries/silgraphite/graphite2.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig freetype cmake ]; + patches = stdenv.lib.optionals stdenv.isDarwin [ ./macosx.patch ]; + meta = { description = "An advanced font engine"; maintainers = [ stdenv.lib.maintainers.raskin ]; diff --git a/pkgs/development/libraries/silgraphite/macosx.patch b/pkgs/development/libraries/silgraphite/macosx.patch new file mode 100644 index 000000000000..7929c1967c82 --- /dev/null +++ b/pkgs/development/libraries/silgraphite/macosx.patch @@ -0,0 +1,13 @@ +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -102,7 +102,8 @@ set_target_properties(graphite2 PROPERTIES PUBLIC_HEADER "${GRAPHITE_HEADERS}" + VERSION ${GRAPHITE_VERSION} + LT_VERSION_CURRENT ${GRAPHITE_API_CURRENT} + LT_VERSION_REVISION ${GRAPHITE_API_REVISION} +- LT_VERSION_AGE ${GRAPHITE_API_AGE}) ++ LT_VERSION_AGE ${GRAPHITE_API_AGE} ++ INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + + if (${CMAKE_BUILD_TYPE} STREQUAL "ClangASN") + set(GRAPHITE_LINK_FLAGS "-fsanitize=address") + diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index f91af9fcad4c..bd3a4362be9b 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -22,7 +22,7 @@ rec { setupHook = ./setup-hook.sh; doMainBuild = fullDepEntry ( stdenv.lib.optionalString stdenv.isDarwin '' - export DYLD_LIBRARY_PATH="${poppler}/lib:${graphite2}/lib" + export DYLD_LIBRARY_PATH="${poppler}/lib" '' + '' mkdir -p $out mkdir -p $out/nix-support @@ -95,7 +95,7 @@ rec { PATH=$PATH:$out/bin mktexlsr $out/share/texmf* '' + stdenv.lib.optionalString stdenv.isDarwin '' for prog in $out/bin/*; do - wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${poppler}/lib:${graphite2}/lib" + wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${poppler}/lib" done '' ) [ "minInit" "defEnsureDir" "doUnpack" "doMakeInstall" "promoteLibexec" "patchShebangsInterim"]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8059acd22349..d25e33bd81fc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10956,7 +10956,7 @@ let libXmu libXext xextproto libSM libICE; ghostscript = ghostscriptX; harfbuzz = harfbuzz.override { - withIcu = true; withGraphite2 = !stdenv.isDarwin; + withIcu = true; withGraphite2 = true; }; };