1 { lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo4, getopt, readline, texlive }:
3 stdenv.mkDerivation (finalAttrs: rec {
8 url = "http://www.eukleides.org/files/${pname}-${version}.tar.bz2";
9 sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q";
13 # use $CC instead of hardcoded gcc
15 # allow PostScript transparency in epstopdf call
16 ./gs-allowpstransparency.patch
19 nativeBuildInputs = [ bison flex texinfo4 makeWrapper ];
21 buildInputs = [ getopt readline ];
24 substituteInPlace Makefile \
25 --replace mktexlsr true
27 substituteInPlace doc/Makefile \
28 --replace ginstall-info install-info
30 substituteInPlace Config \
31 --replace '/usr/local' "$out" \
32 --replace '$(SHARE_DIR)/texmf' "$tex"
35 # Workaround build failure on -fno-common toolchains like upstream
36 # gcc-10. Otherwise build fails as:
37 # ld: eukleides_build/triangle.o:(.bss+0x28): multiple definition of `A';
38 # eukleides_build/quadrilateral.o:(.bss+0x18): first defined here
39 env.NIX_CFLAGS_COMPILE = "-fcommon";
46 wrapProgram $out/bin/euktoeps \
47 --prefix PATH : ${lib.makeBinPath [ getopt ]}
50 outputs = [ "out" "doc" "tex" ];
54 # packages needed by euktoeps, euktopdf and eukleides.sty
55 tlDeps = with texlive; [ collection-pstricks epstopdf iftex moreverb ];
56 pkgs = [ finalAttrs.finalPackage.tex ];
60 description = "Geometry Drawing Language";
61 homepage = "http://www.eukleides.org/";
62 license = lib.licenses.gpl3Plus;
65 Eukleides is a computer language devoted to elementary plane
66 geometry. It aims to be a fairly comprehensive system to create
67 geometric figures, either static or dynamic. Eukleides allows to
68 handle basic types of data: numbers and strings, as well as
69 geometric types of data: points, vectors, sets (of points), lines,
73 platforms = lib.platforms.unix;