asymptote: do not build sty, docs if provided via texlive
This commit is contained in:
parent
b7440798d3
commit
e2d64efdcb
|
@ -4,21 +4,27 @@
|
||||||
, boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv
|
, boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv
|
||||||
, python3, qtbase, qtsvg, boost
|
, python3, qtbase, qtsvg, boost
|
||||||
, zlib, perl, curl
|
, zlib, perl, curl
|
||||||
, texliveSmall, texinfo
|
, texinfo
|
||||||
|
, texlive
|
||||||
|
, texliveSmall
|
||||||
, darwin
|
, darwin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
version = "2.88";
|
version = "2.88";
|
||||||
pname = "asymptote";
|
pname = "asymptote";
|
||||||
|
|
||||||
outputs = [ "out" "man" "info" "doc" "tex" ];
|
outputs = [ "out" "man" "info" "doc" "tex" ];
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://sourceforge/asymptote/${version}/asymptote-${version}.src.tgz";
|
url = "mirror://sourceforge/asymptote/${finalAttrs.version}/asymptote-${finalAttrs.version}.src.tgz";
|
||||||
hash = "sha256-DecadD+m7pORuH3Sdcs/5M3vUbN6rhSkFoNN0Soq9bs=";
|
hash = "sha256-DecadD+m7pORuH3Sdcs/5M3vUbN6rhSkFoNN0Soq9bs=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# override with TeX Live containers to avoid building sty, docs from source
|
||||||
|
texContainer = null;
|
||||||
|
texdocContainer = null;
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
(fetchpatch {
|
(fetchpatch {
|
||||||
# partial fix for macOS XDR/V3D support (LDFLAGS change seems like an unrelated bugfix)
|
# partial fix for macOS XDR/V3D support (LDFLAGS change seems like an unrelated bugfix)
|
||||||
|
@ -37,8 +43,8 @@ stdenv.mkDerivation rec {
|
||||||
wrapQtAppsHook
|
wrapQtAppsHook
|
||||||
cmake
|
cmake
|
||||||
pkg-config
|
pkg-config
|
||||||
(texliveSmall.withPackages (ps: with ps; [ epsf cm-super ps.texinfo media9 ocgx2 collection-latexextra ]))
|
] ++ lib.optional (finalAttrs.texContainer == null || finalAttrs.texdocContainer == null)
|
||||||
];
|
(texliveSmall.withPackages (ps: with ps; [ epsf cm-super ps.texinfo media9 ocgx2 collection-latexextra ]));
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
ghostscriptX imagemagick fftw eigen
|
ghostscriptX imagemagick fftw eigen
|
||||||
|
@ -57,12 +63,25 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
dontWrapQtApps = true;
|
dontWrapQtApps = true;
|
||||||
|
|
||||||
# Do not build $tex/ls-R which will be generated by texlive.combine
|
# do not build $tex/ls-R which will be generated by texlive.withPackages
|
||||||
|
# do not build and install sty and docs, if provided by tex/texdoc texlive containers
|
||||||
|
# (this is an optimisation to make texliveMedium and texliveFull independent of texliveSmall)
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
HOME=$TMP
|
HOME=$TMP
|
||||||
substituteInPlace Makefile.in \
|
substituteInPlace Makefile.in \
|
||||||
--replace-fail 'install: install-notexhash install-texhash' 'install: install-notexhash install-asy'
|
--replace-fail ' install-texhash' '''
|
||||||
prependToVar configureFlags "--with-latex=$tex/tex/latex" "--with-context=$tex/tex/context/third"
|
if [[ -n $texContainer ]] ; then
|
||||||
|
sed -i Makefile.in -e '/(\(latex\|context\)dir)/d'
|
||||||
|
substituteInPlace Makefile.in \
|
||||||
|
--replace-fail 'asy sty' 'asy'
|
||||||
|
else
|
||||||
|
prependToVar configureFlags "--with-latex=$tex/tex/latex" "--with-context=$tex/tex/context/third"
|
||||||
|
fi
|
||||||
|
if [[ -n $texdocContainer ]] ; then
|
||||||
|
substituteInPlace Makefile.in \
|
||||||
|
--replace-fail ' install-man' ''' \
|
||||||
|
--replace-fail 'docdir = $(DESTDIR)@docdir@' 'docdir = $(TMP)/doc'
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# do not use bundled libgc.so
|
# do not use bundled libgc.so
|
||||||
|
@ -76,12 +95,36 @@ stdenv.mkDerivation rec {
|
||||||
rm "$out"/bin/xasy
|
rm "$out"/bin/xasy
|
||||||
makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin
|
makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin
|
||||||
|
|
||||||
mv "$info"/share/info/asymptote/*.info "$info"/share/info/
|
if [[ -z $texdocContainer ]] ; then
|
||||||
sed -i -e 's|(asymptote/asymptote)|(asymptote)|' "$info"/share/info/asymptote.info
|
mv "$info"/share/info/asymptote/*.info "$info"/share/info/
|
||||||
rmdir "$info"/share/info/asymptote
|
sed -i -e 's|(asymptote/asymptote)|(asymptote)|' "$info"/share/info/asymptote.info
|
||||||
rm -f "$info"/share/info/dir
|
rmdir "$info"/share/info/asymptote
|
||||||
|
rm -f "$info"/share/info/dir
|
||||||
|
fi
|
||||||
|
install -Dt $out/share/emacs/site-lisp/${finalAttrs.pname} $out/share/asymptote/*.el
|
||||||
|
'';
|
||||||
|
|
||||||
install -Dt $out/share/emacs/site-lisp/${pname} $out/share/asymptote/*.el
|
# fixupPhase crashes if the outputs are not directories
|
||||||
|
preFixup = ''
|
||||||
|
if [[ -n $texContainer ]] ; then
|
||||||
|
mkdir -p "$tex"
|
||||||
|
fi
|
||||||
|
if [[ -n $texdocContainer ]] ; then
|
||||||
|
mkdir -p "$doc" "$man" "$info"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
if [[ -n $texContainer ]] ; then
|
||||||
|
rmdir "$tex"
|
||||||
|
ln -s "$texContainer" "$tex"
|
||||||
|
fi
|
||||||
|
if [[ -n $texdocContainer ]] ; then
|
||||||
|
mkdir -p "$man/share" "$info/share"
|
||||||
|
ln -s "$texdocContainer" "$doc/share"
|
||||||
|
ln -s "$texdocContainer/doc/man" "$man/share"
|
||||||
|
ln -s "$texdocContainer/doc/info" "$info/share"
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontUseCmakeConfigure = true;
|
dontUseCmakeConfigure = true;
|
||||||
|
@ -98,4 +141,4 @@ stdenv.mkDerivation rec {
|
||||||
maintainers = [ maintainers.raskin ];
|
maintainers = [ maintainers.raskin ];
|
||||||
platforms = platforms.linux ++ platforms.darwin;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user