nixpkgs/pkgs/tools/graphics/asymptote/default.nix

79 lines
1.9 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, fetchurl
, autoreconfHook, bison, glm, yacc, flex
, freeglut, ghostscriptX, imagemagick, fftw
, boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv
, python3Packages
, zlib, perl
, texLive, texinfo
2017-02-06 19:05:55 +00:00
, darwin
}:
stdenv.mkDerivation rec {
2020-07-08 21:52:14 +00:00
version = "2.66";
pname = "asymptote";
2016-02-02 13:53:49 +00:00
src = fetchFromGitHub {
owner = "vectorgraphics";
repo = pname;
rev = version;
2020-07-08 21:52:14 +00:00
sha256 = "0c445j950n6nxgr1zxj7a26daa5d9f3i91506b7r7627s943b1kd";
};
2016-02-02 13:53:49 +00:00
nativeBuildInputs = [
autoreconfHook
bison
flex
yacc
texinfo
];
buildInputs = [
ghostscriptX imagemagick fftw
boehmgc ncurses readline gsl libsigsegv
zlib perl
texLive
] ++ (with python3Packages; [
python
pyqt5
]);
propagatedBuildInputs = [
glm
] ++ stdenv.lib.optionals stdenv.isLinux [
freeglut libGLU libGL mesa.osmesa
] ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
OpenGL GLUT Cocoa
]);
preConfigure = ''
HOME=$TMP
'';
2016-02-02 13:53:49 +00:00
configureFlags = [
"--with-latex=$out/share/texmf/tex/latex"
"--with-context=$out/share/texmf/tex/context/third"
];
2019-10-30 00:40:49 +00:00
NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc";
postInstall = ''
mv $out/share/info/asymptote/*.info $out/share/info/
sed -i -e 's|(asymptote/asymptote)|(asymptote)|' $out/share/info/asymptote.info
rmdir $out/share/info/asymptote
rm -f $out/share/info/dir
rm -rf $out/share/texmf
install -Dt $out/share/emacs/site-lisp/${pname} $out/share/asymptote/*.el
'';
2016-02-02 13:53:49 +00:00
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "A tool for programming graphics intended to replace Metapost";
license = licenses.gpl3Plus;
maintainers = [ maintainers.raskin maintainers.peti ];
broken = stdenv.isDarwin; # https://github.com/vectorgraphics/asymptote/issues/69
platforms = platforms.linux ++ platforms.darwin;
};
}