2023-08-04 22:07:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, autoreconfHook, bison, glm, flex, wrapQtAppsHook, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
, freeglut, ghostscriptX, imagemagick, fftw
|
|
|
|
, boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv
|
2023-07-15 17:15:38 +00:00
|
|
|
, python3, qtbase, qtsvg, boost
|
2020-11-09 15:59:12 +00:00
|
|
|
, zlib, perl, curl
|
2020-04-24 23:36:52 +00:00
|
|
|
, texLive, texinfo
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "2.85";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "asymptote";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vectorgraphics";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-GyW9OEolV97WtrSdIxp4MCP3JIyA1c/DQSqg8jLC0WQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
bison
|
|
|
|
flex
|
2021-04-05 15:23:46 +00:00
|
|
|
bison
|
2020-04-24 23:36:52 +00:00
|
|
|
texinfo
|
2023-07-15 17:15:38 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ghostscriptX imagemagick fftw
|
|
|
|
boehmgc ncurses readline gsl libsigsegv
|
2023-07-15 17:15:38 +00:00
|
|
|
zlib perl curl qtbase qtsvg boost
|
2020-04-24 23:36:52 +00:00
|
|
|
texLive
|
2023-07-15 17:15:38 +00:00
|
|
|
(python3.withPackages (ps: with ps; [ cson numpy pyqt5 ]))
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
glm
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-04-24 23:36:52 +00:00
|
|
|
freeglut libGLU libGL mesa.osmesa
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
2020-04-24 23:36:52 +00:00
|
|
|
OpenGL GLUT Cocoa
|
|
|
|
]);
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preConfigure = ''
|
|
|
|
HOME=$TMP
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-latex=$out/share/texmf/tex/latex"
|
|
|
|
"--with-context=$out/share/texmf/tex/context/third"
|
|
|
|
];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
rm "$out"/bin/xasy
|
|
|
|
makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
2023-03-27 19:17:25 +00:00
|
|
|
# Missing install depends:
|
|
|
|
# ...-coreutils-9.1/bin/install: cannot stat 'asy-keywords.el': No such file or directory
|
|
|
|
# make: *** [Makefile:272: install-asy] Error 1
|
|
|
|
enableParallelInstalling = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A tool for programming graphics intended to replace Metapost";
|
|
|
|
license = licenses.gpl3Plus;
|
2021-10-17 02:12:59 +00:00
|
|
|
maintainers = [ maintainers.raskin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|