From 190ba6ee72a27a834e1ab5aa5b180889ca8ec9ba Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova Date: Sun, 23 May 2021 19:02:36 +0100 Subject: [PATCH 1/4] eukleides: specify texlive dependencies instead of buildInputs --- .../science/math/eukleides/default.nix | 19 +++++-------------- pkgs/top-level/all-packages.nix | 1 - 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index b5a9fc3fa86d..fe8969a36b51 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, readline, texLive }: +{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, readline, texlive }: lib.fix (eukleides: stdenv.mkDerivation rec { pname = "eukleides"; @@ -14,7 +14,7 @@ lib.fix (eukleides: stdenv.mkDerivation rec { nativeBuildInputs = [ bison flex texinfo makeWrapper ]; - buildInputs = [ readline texLive ]; + buildInputs = [ readline ]; preConfigure = '' substituteInPlace Makefile \ @@ -32,21 +32,12 @@ lib.fix (eukleides: stdenv.mkDerivation rec { mkdir -p $out/bin ''; - postInstall = '' - wrapProgram $out/bin/euktoeps \ - --set-default TEXINPUTS : \ - --prefix TEXINPUTS : "$tex/tex/latex/eukleides" \ - --prefix PATH : "${texLive}/bin" - wrapProgram $out/bin/euktopdf \ - --set-default TEXINPUTS : \ - --prefix TEXINPUTS : "$tex/tex/latex/eukleides" \ - --prefix PATH : "${texLive}/bin" - ''; - outputs = [ "out" "doc" "tex" ]; passthru.tlType = "run"; - passthru.pkgs = [ eukleides.tex ]; + passthru.pkgs = [ eukleides.tex ] + # packages needed by euktoeps, euktopdf and eukleides.sty + ++ (with texlive; collection-pstricks.pkgs ++ epstopdf.pkgs ++ iftex.pkgs ++ moreverb.pkgs); meta = { description = "Geometry Drawing Language"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2fdd3f31b8c4..c5506ab5caad 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29828,7 +29828,6 @@ in ecm = callPackage ../applications/science/math/ecm { }; eukleides = callPackage ../applications/science/math/eukleides { - texLive = texlive.combine { inherit (texlive) scheme-small; }; texinfo = texinfo4; }; From 8fb57a90eb5cb0ed855a8dba71f09b349e1e4a55 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova Date: Sun, 23 May 2021 19:02:36 +0100 Subject: [PATCH 2/4] eukleides: add getopt in euktoeps wrapper --- pkgs/applications/science/math/eukleides/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index fe8969a36b51..e96438b5b3e2 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, readline, texlive }: +{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, getopt, readline, texlive }: lib.fix (eukleides: stdenv.mkDerivation rec { pname = "eukleides"; @@ -14,7 +14,7 @@ lib.fix (eukleides: stdenv.mkDerivation rec { nativeBuildInputs = [ bison flex texinfo makeWrapper ]; - buildInputs = [ readline ]; + buildInputs = [ getopt readline ]; preConfigure = '' substituteInPlace Makefile \ @@ -32,6 +32,11 @@ lib.fix (eukleides: stdenv.mkDerivation rec { mkdir -p $out/bin ''; + postInstall = '' + wrapProgram $out/bin/euktoeps \ + --prefix PATH : ${lib.makeBinPath [ getopt ]} + ''; + outputs = [ "out" "doc" "tex" ]; passthru.tlType = "run"; From b88e8d999c52d0cdff3bb3283f85b500b7c0832e Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova Date: Sun, 23 May 2021 19:04:07 +0100 Subject: [PATCH 3/4] eukleides: allow PostScript transparency --- pkgs/applications/science/math/eukleides/default.nix | 8 ++++++-- .../math/eukleides/gs-allowpstransparency.patch | 10 ++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index e96438b5b3e2..12226abdfca4 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -9,8 +9,12 @@ lib.fix (eukleides: stdenv.mkDerivation rec { sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q"; }; - # use $CC instead of hardcoded gcc - patches = [ ./use-CC.patch ]; + patches = [ + # use $CC instead of hardcoded gcc + ./use-CC.patch + # allow PostScript transparency in epstopdf call + ./gs-allowpstransparency.patch + ]; nativeBuildInputs = [ bison flex texinfo makeWrapper ]; diff --git a/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch b/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch new file mode 100644 index 000000000000..aa92e6cc9fa7 --- /dev/null +++ b/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch @@ -0,0 +1,10 @@ +--- a/bash/euktopdf ++++ b/bash/euktopdf +@@ -55,6 +55,6 @@ do + exit 1 + fi + dvips -q -E -o $base.eps $base.dvi && +- epstopdf $base.eps && ++ epstopdf --gsopt=-dALLOWPSTRANSPARENCY $base.eps && + rm -f $base.{tex,log,dvi,eps} + done From b0c6bd9211ee7a35d27a0037b388742960c3df71 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova Date: Sun, 23 May 2021 19:05:26 +0100 Subject: [PATCH 4/4] eukleides: depend on texinfo4 instead of overriding texinfo --- pkgs/applications/science/math/eukleides/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix index 12226abdfca4..6b6bfd7d6e5f 100644 --- a/pkgs/applications/science/math/eukleides/default.nix +++ b/pkgs/applications/science/math/eukleides/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, getopt, readline, texlive }: +{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo4, getopt, readline, texlive }: lib.fix (eukleides: stdenv.mkDerivation rec { pname = "eukleides"; @@ -16,7 +16,7 @@ lib.fix (eukleides: stdenv.mkDerivation rec { ./gs-allowpstransparency.patch ]; - nativeBuildInputs = [ bison flex texinfo makeWrapper ]; + nativeBuildInputs = [ bison flex texinfo4 makeWrapper ]; buildInputs = [ getopt readline ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5506ab5caad..a4f5a7f7e3f8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29827,9 +29827,7 @@ in ecm = callPackage ../applications/science/math/ecm { }; - eukleides = callPackage ../applications/science/math/eukleides { - texinfo = texinfo4; - }; + eukleides = callPackage ../applications/science/math/eukleides { }; form = callPackage ../applications/science/math/form { };