diff --git a/pkgs/tools/typesetting/tex/tetex/default.nix b/pkgs/tools/typesetting/tex/tetex/default.nix index bb1e3f8b4b0..5cd3228aced 100644 --- a/pkgs/tools/typesetting/tex/tetex/default.nix +++ b/pkgs/tools/typesetting/tex/tetex/default.nix @@ -15,30 +15,33 @@ stdenv.mkDerivation { buildInputs = [ flex bison zlib libpng ncurses ed ]; + # fixes "error: conflicting types for 'calloc'", etc. + preBuild = stdenv.lib.optionalString stdenv.isDarwin '' + sed -i 57d texk/kpathsea/c-std.h + ''; + patches = [ ./environment.patch ./getline.patch ]; setupHook = ./setup-hook.sh; configureFlags = - [ "--disable-multiplatform" - "--without-x11" - "--without-xdvik" - "--without-oxdvik" - "--without-texinfo" - "--without-texi2html" - "--with-system-zlib" - "--with-system-pnglib" - "--with-system-ncurses" - ]; + [ "--disable-multiplatform" "--without-x11" "--without-xdvik" + "--without-oxdvik" "--without-texinfo" "--without-texi2html" + "--with-system-zlib" "--with-system-pnglib" "--with-system-ncurses" ] + # couldn't get gsftopk working on darwin + ++ stdenv.lib.optional stdenv.isDarwin "--without-gsftopk"; - postUnpack = - '' - mkdir -p $out/share/texmf - mkdir -p $out/share/texmf-dist - gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -) - ''; + postUnpack = '' + mkdir -p $out/share/texmf + mkdir -p $out/share/texmf-dist + gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -) + ''; - meta = { - description = "A full-featured (La)TeX distribution"; + meta = with stdenv.lib; { + description = "A full-featured (La)TeX distribution"; + homepage = http://www.tug.org/tetex/; + matintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; }; } + diff --git a/pkgs/tools/typesetting/tex/texlive/aggregate.nix b/pkgs/tools/typesetting/tex/texlive/aggregate.nix index c2ccecab089..84fa1cfab75 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; + + 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 aac8da784b3..e53c336c0ed 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 @@ -41,24 +43,26 @@ rec { ./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 +85,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 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 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; + licnese = stdenv.lib.licneses.gpl2; + maintainers = with maintainers; [ lovek323 raskin ]; + platforms = platforms.unix; }; } + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index af5c50d5dce..3facd5bc269 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9827,19 +9827,20 @@ let texFunctions = import ../tools/typesetting/tex/nix pkgs; texLive = builderDefsPackage (import ../tools/typesetting/tex/texlive) { - inherit builderDefs zlib bzip2 ncurses libpng ed lesstif + inherit builderDefs zlib bzip2 ncurses libpng ed lesstif ruby gd t1lib freetype icu perl expat curl xz pkgconfig zziplib - libjpeg bison python fontconfig flex poppler silgraphite; + libjpeg bison python fontconfig flex poppler silgraphite makeWrapper; inherit (xlibs) libXaw libX11 xproto libXt libXpm libXmu libXext xextproto libSM libICE; ghostscript = ghostscriptX; - ruby = ruby18; }; texLiveFull = lib.setName "texlive-full" (texLiveAggregationFun { paths = [ texLive texLiveExtra lmodern texLiveCMSuper texLiveLatexXColor texLivePGF texLiveBeamer texLiveModerncv tipa tex4ht texinfo5 texLiveModerntimeline ]; + + inherit poppler makeWrapper; }); /* Look in configurations/misc/raskin.nix for usage example (around revisions