Merge pull request #302353 from xworld21/texlive-avoid-self-dependency

{asymptote,texlive.bin.xindy}: build binaries without docs and other tex files

authored by 7c6f434c and committed by GitHub be95d641 f3be8712

+85 -30
+58 -24
pkgs/tools/graphics/asymptote/default.nix
··· 4 , boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv 5 , python3, qtbase, qtsvg, boost 6 , zlib, perl, curl 7 - , texliveSmall, texinfo 8 , darwin 9 }: 10 11 - stdenv.mkDerivation rec { 12 - version = "2.88"; 13 pname = "asymptote"; 14 15 outputs = [ "out" "man" "info" "doc" "tex" ]; 16 17 src = fetchurl { 18 - url = "mirror://sourceforge/asymptote/${version}/asymptote-${version}.src.tgz"; 19 - hash = "sha256-DecadD+m7pORuH3Sdcs/5M3vUbN6rhSkFoNN0Soq9bs="; 20 }; 21 22 - patches = [ 23 - (fetchpatch { 24 - # partial fix for macOS XDR/V3D support (LDFLAGS change seems like an unrelated bugfix) 25 - name = "restore-LDFLAGS-dont-look-for-tirpc-under-MacOS.patch"; 26 - url = "https://github.com/vectorgraphics/asymptote/commit/7e17096b22d18d133d1bc5916b6e32c0cb24ad10.patch"; 27 - hash = "sha256-olCFzqfZwWOAjqlB5lDPXYRHU9i3VQNgoR0cO5TmW98="; 28 - }) 29 - ]; 30 31 nativeBuildInputs = [ 32 autoreconfHook ··· 37 wrapQtAppsHook 38 cmake 39 pkg-config 40 - ]; 41 42 buildInputs = [ 43 ghostscriptX imagemagick fftw eigen 44 boehmgc ncurses readline gsl libsigsegv 45 zlib perl curl qtbase qtsvg boost 46 - (texliveSmall.withPackages (ps: with ps; [ epsf cm-super ps.texinfo media9 ocgx2 collection-latexextra ])) 47 (python3.withPackages (ps: with ps; [ cson numpy pyqt5 ])) 48 ] ++ lib.optionals stdenv.isLinux [ libtirpc ]; 49 ··· 57 58 dontWrapQtApps = true; 59 60 - # Do not build $tex/ls-R which will be generated by texlive.combine 61 preConfigure = '' 62 HOME=$TMP 63 substituteInPlace Makefile.in \ 64 - --replace-fail 'install: install-notexhash install-texhash' 'install: install-notexhash install-asy' 65 - prependToVar configureFlags "--with-latex=$tex/tex/latex" "--with-context=$tex/tex/context/third" 66 ''; 67 68 # do not use bundled libgc.so ··· 76 rm "$out"/bin/xasy 77 makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin 78 79 - mv "$info"/share/info/asymptote/*.info "$info"/share/info/ 80 - sed -i -e 's|(asymptote/asymptote)|(asymptote)|' "$info"/share/info/asymptote.info 81 - rmdir "$info"/share/info/asymptote 82 - rm -f "$info"/share/info/dir 83 84 - install -Dt $out/share/emacs/site-lisp/${pname} $out/share/asymptote/*.el 85 ''; 86 87 dontUseCmakeConfigure = true; ··· 98 maintainers = [ maintainers.raskin ]; 99 platforms = platforms.linux ++ platforms.darwin; 100 }; 101 - }
··· 4 , boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv 5 , python3, qtbase, qtsvg, boost 6 , zlib, perl, curl 7 + , texinfo 8 + , texlive 9 + , texliveSmall 10 , darwin 11 }: 12 13 + stdenv.mkDerivation (finalAttrs: { 14 + version = "2.89"; 15 pname = "asymptote"; 16 17 outputs = [ "out" "man" "info" "doc" "tex" ]; 18 19 src = fetchurl { 20 + url = "mirror://sourceforge/asymptote/${finalAttrs.version}/asymptote-${finalAttrs.version}.src.tgz"; 21 + hash = "sha256-9k5itO5PhfGnhkDE8eim+Y6R9U7ayrGXJ8fKvpSlf1s="; 22 }; 23 24 + # override with TeX Live containers to avoid building sty, docs from source 25 + texContainer = null; 26 + texdocContainer = null; 27 28 nativeBuildInputs = [ 29 autoreconfHook ··· 34 wrapQtAppsHook 35 cmake 36 pkg-config 37 + ] ++ lib.optional (finalAttrs.texContainer == null || finalAttrs.texdocContainer == null) 38 + (texliveSmall.withPackages (ps: with ps; [ epsf cm-super ps.texinfo media9 ocgx2 collection-latexextra ])); 39 40 buildInputs = [ 41 ghostscriptX imagemagick fftw eigen 42 boehmgc ncurses readline gsl libsigsegv 43 zlib perl curl qtbase qtsvg boost 44 (python3.withPackages (ps: with ps; [ cson numpy pyqt5 ])) 45 ] ++ lib.optionals stdenv.isLinux [ libtirpc ]; 46 ··· 54 55 dontWrapQtApps = true; 56 57 + # do not build $tex/ls-R which will be generated by texlive.withPackages 58 + # do not build and install sty and docs, if provided by tex/texdoc texlive containers 59 + # (this is an optimisation to make texliveMedium and texliveFull independent of texliveSmall) 60 preConfigure = '' 61 HOME=$TMP 62 substituteInPlace Makefile.in \ 63 + --replace-fail ' install-texhash' ''' 64 + if [[ -n $texContainer ]] ; then 65 + sed -i Makefile.in -e '/(\(latex\|context\)dir)/d' 66 + substituteInPlace Makefile.in \ 67 + --replace-fail 'asy sty' 'asy' 68 + else 69 + prependToVar configureFlags "--with-latex=$tex/tex/latex" "--with-context=$tex/tex/context/third" 70 + fi 71 + if [[ -n $texdocContainer ]] ; then 72 + substituteInPlace Makefile.in \ 73 + --replace-fail ' install-man' ''' \ 74 + --replace-fail 'docdir = $(DESTDIR)@docdir@' 'docdir = $(TMP)/doc' 75 + fi 76 ''; 77 78 # do not use bundled libgc.so ··· 86 rm "$out"/bin/xasy 87 makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin 88 89 + if [[ -z $texdocContainer ]] ; then 90 + mv "$info"/share/info/asymptote/*.info "$info"/share/info/ 91 + sed -i -e 's|(asymptote/asymptote)|(asymptote)|' "$info"/share/info/asymptote.info 92 + rmdir "$info"/share/info/asymptote 93 + rm -f "$info"/share/info/dir 94 + fi 95 + install -Dt $out/share/emacs/site-lisp/${finalAttrs.pname} $out/share/asymptote/*.el 96 + ''; 97 + 98 + # fixupPhase crashes if the outputs are not directories 99 + preFixup = '' 100 + if [[ -n $texContainer ]] ; then 101 + mkdir -p "$tex" 102 + fi 103 + if [[ -n $texdocContainer ]] ; then 104 + mkdir -p "$doc" "$man" "$info" 105 + fi 106 + ''; 107 108 + postFixup = '' 109 + if [[ -n $texContainer ]] ; then 110 + rmdir "$tex" 111 + ln -s "$texContainer" "$tex" 112 + fi 113 + if [[ -n $texdocContainer ]] ; then 114 + mkdir -p "$man/share" "$info/share" 115 + ln -s "$texdocContainer" "$doc/share" 116 + ln -s "$texdocContainer/doc/man" "$man/share" 117 + ln -s "$texdocContainer/doc/info" "$info/share" 118 + fi 119 ''; 120 121 dontUseCmakeConfigure = true; ··· 132 maintainers = [ maintainers.raskin ]; 133 platforms = platforms.linux ++ platforms.darwin; 134 }; 135 + })
+27 -6
pkgs/tools/typesetting/tex/texlive/bin.nix
··· 8 , makeWrapper, shortenPerlShebang, useFixedHashes, asymptote 9 , biber-ms 10 , tlpdb 11 - }: 12 13 # Useful resource covering build options: 14 # http://tug.org/texlive/doc/tlbuild.html ··· 420 }; 421 }; 422 423 - inherit asymptote; 424 425 inherit biber; 426 inherit biber-ms; ··· 499 postPatch = '' 500 substituteInPlace xindy-*/user-commands/xindy.in \ 501 --replace-fail "our \$clisp = ( \$is_windows ? 'clisp.exe' : 'clisp' ) ;" \ 502 - "our \$clisp = '$(type -P clisp)';" 503 ''; 504 505 nativeBuildInputs = [ 506 pkg-config perl 507 - (texlive.combine { inherit (texlive) scheme-basic cyrillic ec; }) 508 ]; 509 buildInputs = [ clisp libiconv perl ]; 510 511 - configureFlags = [ "--with-clisp-runtime=system" "--disable-xindy-docs" ]; 512 513 preInstall = ''mkdir -p "$out/bin" ''; 514 # fixup various file-location errors of: lib/xindy/{xindy.mem,modules/} 515 postInstall = '' 516 mkdir -p "$out/lib/xindy" 517 mv "$out"/{bin/xindy.mem,lib/xindy/} 518 - ln -s ../../share/texmf-dist/xindy/modules "$out/lib/xindy/" 519 ''; 520 }; 521
··· 8 , makeWrapper, shortenPerlShebang, useFixedHashes, asymptote 9 , biber-ms 10 , tlpdb 11 + }@args: 12 13 # Useful resource covering build options: 14 # http://tug.org/texlive/doc/tlbuild.html ··· 420 }; 421 }; 422 423 + asymptote = args.asymptote.overrideAttrs (finalAttrs: prevAttrs: { 424 + version = texlive.pkgs.asymptote.version; 425 + 426 + # keep local src and patches even if duplicated in the top level asymptote 427 + # so that top level updates do not break texlive 428 + src = fetchurl { 429 + url = "mirror://sourceforge/asymptote/${finalAttrs.version}/asymptote-${finalAttrs.version}.src.tgz"; 430 + hash = "sha256-DecadD+m7pORuH3Sdcs/5M3vUbN6rhSkFoNN0Soq9bs="; 431 + }; 432 + 433 + texContainer = texlive.pkgs.asymptote.tex; 434 + texdocContainer = texlive.pkgs.asymptote.texdoc; 435 + 436 + patches = [ 437 + (fetchpatch { 438 + # partial fix for macOS XDR/V3D support (LDFLAGS change seems like an unrelated bugfix) 439 + name = "restore-LDFLAGS-dont-look-for-tirpc-under-MacOS.patch"; 440 + url = "https://github.com/vectorgraphics/asymptote/commit/7e17096b22d18d133d1bc5916b6e32c0cb24ad10.patch"; 441 + hash = "sha256-olCFzqfZwWOAjqlB5lDPXYRHU9i3VQNgoR0cO5TmW98="; 442 + }) 443 + ]; 444 + }); 445 446 inherit biber; 447 inherit biber-ms; ··· 520 postPatch = '' 521 substituteInPlace xindy-*/user-commands/xindy.in \ 522 --replace-fail "our \$clisp = ( \$is_windows ? 'clisp.exe' : 'clisp' ) ;" \ 523 + "our \$clisp = '$(type -P clisp)';" \ 524 + --replace-fail 'die "$cmd: Cannot locate xindy modules directory";' \ 525 + '$modules_dir = "${texlive.pkgs.xindy.tex}/xindy/modules"; die "$cmd: Cannot locate xindy modules directory" unless -d $modules_dir;' 526 ''; 527 528 nativeBuildInputs = [ 529 pkg-config perl 530 ]; 531 buildInputs = [ clisp libiconv perl ]; 532 533 + configureFlags = [ "--with-clisp-runtime=system" "--disable-xindy-docs" "--disable-xindy-rules" ]; 534 535 preInstall = ''mkdir -p "$out/bin" ''; 536 # fixup various file-location errors of: lib/xindy/{xindy.mem,modules/} 537 postInstall = '' 538 mkdir -p "$out/lib/xindy" 539 mv "$out"/{bin/xindy.mem,lib/xindy/} 540 ''; 541 }; 542