summaryrefslogtreecommitdiff
path: root/pkgs/applications/science/math/eukleides
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
committerRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
commit4bc5fbef9d159e143fb7e2c3231932e6e76f667c (patch)
treee2198f5c552e0667d838b8ec764ddb3a4d8f6dec /pkgs/applications/science/math/eukleides
parentjq: fix build with structured-attrs on darwin (diff)
parentMerge pull request #123802 from superherointj/package-virtmanager-bugfix (diff)
downloadnixpkgs-origin/structured-attrs.tar.gz
Merge remote-tracking branch 'upstream/master' into structured-attrsorigin/structured-attrs
Diffstat (limited to 'pkgs/applications/science/math/eukleides')
-rw-r--r--pkgs/applications/science/math/eukleides/default.nix57
-rw-r--r--pkgs/applications/science/math/eukleides/use-CC.patch11
2 files changed, 55 insertions, 13 deletions
diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix
index 5f7fe58465d0..b5a9fc3fa86d 100644
--- a/pkgs/applications/science/math/eukleides/default.nix
+++ b/pkgs/applications/science/math/eukleides/default.nix
@@ -1,26 +1,57 @@
-{ lib, stdenv, fetchurl, bison, flex, texinfo, readline, texLive }:
+{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo, readline, texLive }:
-let
- name = "eukleides";
+lib.fix (eukleides: stdenv.mkDerivation rec {
+ pname = "eukleides";
version = "1.5.4";
-in
-stdenv.mkDerivation {
- name = "${name}-${version}";
src = fetchurl {
- url = "http://www.eukleides.org/files/${name}-${version}.tar.bz2";
+ url = "http://www.eukleides.org/files/${pname}-${version}.tar.bz2";
sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q";
};
- buildInputs = [bison flex texinfo readline texLive];
+ # use $CC instead of hardcoded gcc
+ patches = [ ./use-CC.patch ];
- preConfigure = "sed -i 's/ginstall-info/install-info/g' doc/Makefile";
- installPhase = "mkdir -p $out/bin ; make PREFIX=$out install";
+ nativeBuildInputs = [ bison flex texinfo makeWrapper ];
+
+ buildInputs = [ readline texLive ];
+
+ preConfigure = ''
+ substituteInPlace Makefile \
+ --replace mktexlsr true
+
+ substituteInPlace doc/Makefile \
+ --replace ginstall-info install-info
+
+ substituteInPlace Config \
+ --replace '/usr/local' "$out" \
+ --replace '$(SHARE_DIR)/texmf' "$tex"
+ '';
+
+ preInstall = ''
+ 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 ];
meta = {
description = "Geometry Drawing Language";
homepage = "http://www.eukleides.org/";
- license = lib.licenses.gpl2;
+ license = lib.licenses.gpl3Plus;
longDescription = ''
Eukleides is a computer language devoted to elementary plane
@@ -31,7 +62,7 @@ stdenv.mkDerivation {
circles and conics.
'';
- platforms = lib.platforms.linux;
+ platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.peti ];
};
-}
+})
diff --git a/pkgs/applications/science/math/eukleides/use-CC.patch b/pkgs/applications/science/math/eukleides/use-CC.patch
new file mode 100644
index 000000000000..08bd71ec9dc5
--- /dev/null
+++ b/pkgs/applications/science/math/eukleides/use-CC.patch
@@ -0,0 +1,11 @@
+--- a/build/Makefile
++++ b/build/Makefile
+@@ -11,7 +11,7 @@ LEX = flex
+ LFLAGS = -8
+ YACC = bison
+ YFLAGS = -d
+-CC = gcc
++CC ?= gcc
+ IFLAGS = -I$(COMMON_DIR) -I$(MAIN_DIR) -I$(BUILD_DIR)
+ ifneq ($(strip $(LOCALES)),)
+ MOFLAGS = -DMO_DIR=\"$(MO_DIR)\"