summary refs log tree commit diff
path: root/pkgs/tools/typesetting/tex/texlive
diff options
context:
space:
mode:
authorMathijs Kwik <mathijs@bluescreen303.nl>2013-09-11 10:51:46 +0200
committerMathijs Kwik <mathijs@bluescreen303.nl>2013-09-11 10:53:31 +0200
commit1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304 (patch)
tree3513b616eec434d455177a877119cdd96a7b4ade /pkgs/tools/typesetting/tex/texlive
parent2d405ed4d54ba4d924b5146cea4a39ae65343d59 (diff)
parentaa8e8303e1b42c5cf5195f3ce82f886664aa26d4 (diff)
downloadnixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.tar
nixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.tar.gz
nixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.tar.bz2
nixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.tar.lz
nixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.tar.xz
nixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.tar.zst
nixlib-1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304.zip
Merge remote-tracking branch 'official/master' into multiple-outputs
Conflicts:
	pkgs/development/libraries/cairo/default.nix
	pkgs/development/libraries/freetype/default.nix
	pkgs/development/libraries/glib/default.nix
	pkgs/development/libraries/libpng/default.nix
	pkgs/development/libraries/pango/default.nix
	pkgs/tools/typesetting/tex/texlive/default.nix
	pkgs/top-level/all-packages.nix
Diffstat (limited to 'pkgs/tools/typesetting/tex/texlive')
-rw-r--r--pkgs/tools/typesetting/tex/texlive/aggregate.nix15
-rw-r--r--pkgs/tools/typesetting/tex/texlive/default.nix73
2 files changed, 53 insertions, 35 deletions
diff --git a/pkgs/tools/typesetting/tex/texlive/aggregate.nix b/pkgs/tools/typesetting/tex/texlive/aggregate.nix
index c2ccecab0896..84fa1cfab75a 100644
--- a/pkgs/tools/typesetting/tex/texlive/aggregate.nix
+++ b/pkgs/tools/typesetting/tex/texlive/aggregate.nix
@@ -1,12 +1,13 @@
 args : with args;
 rec {
-  phaseNames = ["doAggregate"];
   name = "TeXLive-linkdir";
 
-  buildInputs = lib.closePropagation paths;
+  buildInputs = lib.closePropagation paths
+    ++ stdenv.lib.optional stdenv.isDarwin makeWrapper;
 
-  doAggregate = fullDepEntry (''
+  phaseNames = [ "doAggregate" ];
 
+  doAggregate = fullDepEntry (''
     mkdir -p $out/bin
     for currentPath in ${lib.concatStringsSep " " buildInputs}; do
         echo Symlinking "$currentPath"
@@ -54,7 +55,13 @@ rec {
     yes | PATH=$PATH:$out/bin mktexlsr $out/texmf*
     yes | TEXMFCONFIG=$out/texmf-config HOME=$PWD PATH=$PATH:$out/bin updmap --syncwithtrees
     yes | PATH=$PATH:$out/bin mktexlsr $out/texmf*
-  '') ["minInit" "defEnsureDir" "addInputs"];
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    # did the same thing in texLive, but couldn't get it to carry to the
+    # binaries installed by texLiveFull
+    for prog in $out/bin/*; do
+      wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${poppler}/lib"
+    done
+  '' ) [ "minInit" "defEnsureDir" "addInputs" ];
 
   meta = {
     description = "TeX distribution directory";
diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix
index fc987d3946ab..820d6f7038fb 100644
--- a/pkgs/tools/typesetting/tex/texlive/default.nix
+++ b/pkgs/tools/typesetting/tex/texlive/default.nix
@@ -17,7 +17,9 @@ rec {
 
   setupHook = ./setup-hook.sh;
 
-  doMainBuild = fullDepEntry (''
+  doMainBuild = fullDepEntry ( stdenv.lib.optionalString stdenv.isDarwin ''
+    export DYLD_LIBRARY_PATH="${poppler}/lib"
+  '' + ''
     mkdir -p $out
     mkdir -p $out/nix-support
     cp ${setupHook} $out/nix-support/setup-hook.sh
@@ -35,30 +37,31 @@ rec {
     sed -e s@ncurses/curses.h@curses.h@g -i $(grep ncurses/curses.h -rl . )
     sed -e '1i\#include <string.h>\n\#include <stdlib.h>' -i $( find libs/teckit -name '*.cpp' -o -name '*.c' )
 
-    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
     NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${icu}/include/layout";
 
     ./Build --prefix="$out" --datadir="$out/share" --mandir "$out/share/man" --infodir "$out/share/info" \
       ${args.lib.concatStringsSep " " configureFlags}
     cd Work
-  '') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
+  '' ) [ "minInit" "doUnpack" "addInputs" "defEnsureDir" ];
 
-  doPostInstall = fullDepEntry(''
+  doPostInstall = fullDepEntry( ''
     mkdir -p $out/libexec/
     mv $out/bin $out/libexec/$(uname -m)
     mkdir -p $out/bin
     for i in "$out/libexec/"* "$out/libexec/"*/* ; do
         test \( \! -d "$i" \) -a \( -x "$i" -o -L "$i" \) || continue
-	if [ -x "$i" ]; then
-	    echo -ne "#! $SHELL\\nexec $i \"\$@\"" >$out/bin/$(basename $i)
-            chmod a+x $out/bin/$(basename $i)
-	else
-	    mv "$i" "$out/libexec"
-	    ln -s "$(readlink -f "$out/libexec/$(basename "$i")")" "$out/bin/$(basename "$i")";
-	    ln -sf "$(readlink -f "$out/libexec/$(basename "$i")")" "$out/libexec/$(uname -m)/$(basename "$i")";
-            rm "$out/libexec/$(basename "$i")"
-	fi;
+
+      if [ -x "$i" ]; then
+          echo -ne "#! $SHELL\\nexec $i \"\$@\"" >$out/bin/$(basename $i)
+                chmod a+x $out/bin/$(basename $i)
+      else
+          mv "$i" "$out/libexec"
+          ln -s "$(readlink -f "$out/libexec/$(basename "$i")")" "$out/bin/$(basename "$i")";
+          ln -sf "$(readlink -f "$out/libexec/$(basename "$i")")" "$out/libexec/$(uname -m)/$(basename "$i")";
+          rm "$out/libexec/$(basename "$i")"
+      fi;
     done
+
     [ -d $out/texmf-config ] || ln -s $out/texmf $out/texmf-config
     ln -s -v "$out/"*texmf* "$out/share/" || true
 
@@ -81,29 +84,37 @@ rec {
     PATH="$PATH:$out/bin" fmtutil-sys --all || true
 
     PATH=$PATH:$out/bin mktexlsr $out/texmf*
- '') ["minInit" "defEnsureDir" "doUnpack" "doMakeInstall"];
+  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    for prog in $out/bin/*; do
+      wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${poppler}/lib"
+    done
+  '' ) [ "minInit" "defEnsureDir" "doUnpack" "doMakeInstall" ];
 
-  buildInputs = [
-    zlib bzip2 ncurses libpng flex bison libX11.out libICE
-    xproto freetype t1lib gd libXaw icu ghostscript ed
-    libXt libXpm libXmu libXext xextproto perl libSM
-    ruby expat curl libjpeg python fontconfig xz
-    pkgconfig poppler silgraphite lesstif zziplib
-  ];
+  buildInputs = [ zlib bzip2 ncurses libpng flex bison libX11.out libICE xproto
+    freetype t1lib gd libXaw icu ghostscript ed libXt libXpm libXmu libXext
+    xextproto perl libSM ruby expat curl libjpeg python fontconfig xz pkgconfig
+    poppler silgraphite lesstif zziplib ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ makeWrapper ];
 
-  configureFlags = [ "--with-x11"
-    "--enable-ipc" "--with-mktexfmt" "--enable-shared"
-    "--disable-native-texlive-build" "--with-system-zziplib"
-    "--with-system-icu" "--with-system-libgs" "--with-system-t1lib"
-    "--with-system-freetype2"
-  ];
+  configureFlags = [ "--with-x11" "--enable-ipc" "--with-mktexfmt"
+    "--enable-shared" "--disable-native-texlive-build" "--with-system-zziplib"
+    "--with-system-libgs" "--with-system-t1lib" "--with-system-freetype2" ]
+    ++ ( if stdenv.isDarwin
+         # ironically, couldn't get xetex compiling on darwin
+         then [ "--disable-xetex" "--disable-xdv2pdf" "--disable-xdvipdfmx" ]
+         # couldn't seem to get system icu working on darwin
+         else [ "--with-system-icu" ] );
 
-  phaseNames = ["addInputs" "doMainBuild" "doMakeInstall" "doPostInstall"];
+  phaseNames = [ "addInputs" "doMainBuild" "doMakeInstall" "doPostInstall" ];
 
   name = "texlive-core-2012";
-  meta = {
+
+  meta = with stdenv.lib; {
     description = "A TeX distribution";
-    maintainers = [ args.lib.maintainers.raskin ];
-    platforms = args.lib.platforms.linux ++ args.lib.platforms.freebsd ;
+    homepage    = http://www.tug.org/texlive;
+    license     = stdenv.lib.licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 raskin ];
+    platforms   = platforms.unix;
   };
 }
+