git.iko.soy/typeable/nixpkgs
on master help sign in
Packaging Asymptote from scratch to get rid of builderDefsPackage
commitf6f3813b653c980b6fdbcf337d92a4c10cda6ef4 authorMichael Raskin <7c6f434c@mail.ru> dateTue 10 Feb 2015, 00:27 (12 years ago) parent7c12355
2 files changed+26−56
pkgs/tools/graphics/asymptote/default.nix+25−52 pkgs/top-level/all-packages.nix+1−4
pkgs/tools/graphics/asymptote/default.nix+25−52
@@ -1,12 +1,8 @@
1−a @ {
2− freeglut,ghostscriptX,imagemagick,fftw,
3− boehmgc,mesa,ncurses,readline,gsl,libsigsegv,
4− python,zlib, perl, texLive, texinfo, xz,
5−
6− noDepEntry, fullDepEntry, fetchUrlFromSrcInfo,
7− lib,
8−
9− ...}:
1+{stdenv, fetchurl
2+ , freeglut, ghostscriptX, imagemagick, fftw
3+ , boehmgc, mesa, ncurses, readline, gsl, libsigsegv
4+ , python, zlib, perl, texLive, texinfo, xz
5+}:
106let
117 s = # Generated upstream information
128 rec {
@@ -17,60 +13,37 @@ let
1713 url="mirror://sourceforge/project/asymptote/2.32/asymptote-2.32.src.tgz";
1814 sha256="19cgn5158p42igjbp8lf6xdbh3yjhlkdm22m5lqrhibp09g06d90";
1915 };
20− buildInputs = with a; [
21− freeglut ghostscriptX imagemagick fftw boehmgc
22− mesa ncurses readline gsl libsigsegv python zlib
23− perl texLive texinfo xz
16+ buildInputs = [
17+ freeglut ghostscriptX imagemagick fftw
18+ boehmgc mesa ncurses readline gsl libsigsegv
19+ python zlib perl texLive texinfo xz
2420 ];
2521in
26−rec {
27− src = a.fetchUrlFromSrcInfo s;
28−
29− inherit (s) name;
22+stdenv.mkDerivation {
23+ inherit (s) name version;
3024 inherit buildInputs;
31− configureFlags = "--enable-gc=${a.boehmgc} --enable-offscreen";
32−
33− /* doConfigure should be removed if not needed */
34− phaseNames = ["setVars" "doUnpack" "fixPaths" "extractTexinfoTex"
35− "fixEpsWrite"
36− "doConfigure" "dumpRealVars" "doMakeInstall" "fixPathsResult"
37− "fixInfoDir"];
38−
39− setVars = a.noDepEntry ''
25+ src = fetchurl {
26+ inherit (s) url sha256;
27+ };
28+ preConfigure = ''
4029 export HOME="$PWD"
30+ patchShebangs .
31+ sed -e 's@epswrite@eps2write@g' -i runlabel.in
32+ xz -d < ${texinfo.src} | tar --wildcards -x texinfo-'*'/doc/texinfo.tex
33+ cp texinfo-*/doc/texinfo.tex doc/
34+ export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${boehmgc}/include/gc"
4135 '';
42−
43− dumpRealVars = a.noDepEntry ''
44− set > ../real-env-vars
45− '';
46−
47− fixPaths = a.doPatchShebangs ''.'';
48− fixPathsResult = a.doPatchShebangs ''$out/bin'';
49−
50− fixInfoDir = a.noDepEntry ''
36+ postInstall = ''
5137 mv -v "$out/share/info/asymptote/"*.info $out/share/info/
5238 sed -i -e 's|(asymptote/asymptote)|(asymptote)|' $out/share/info/asymptote.info
5339 rmdir $out/share/info/asymptote
5440 rm $out/share/info/dir
5541 '';
56−
57− extractTexinfoTex = a.fullDepEntry ''
58− xz -d < ${a.texinfo.src} | tar --wildcards -x texinfo-'*'/doc/texinfo.tex
59− cp texinfo-*/doc/texinfo.tex doc/
60− '' ["minInit" "addInputs" "doUnpack"];
61−
62− fixEpsWrite = a.fullDepEntry ''
63− sed -e 's@epswrite@eps2write@g' -i runlabel.in
64− '' ["minInit" "addInputs" "doUnpack"];
65−
6642 meta = {
6743 inherit (s) version;
68− description = "A tool for programming graphics intended to replace Metapost";
69− maintainers = [
70− a.lib.maintainers.raskin
71− a.lib.maintainers.simons
72− ];
73− platforms = with a.lib.platforms;
74− linux;
44+ description = "A tool for programming graphics intended to replace Metapost";
45+ license = stdenv.lib.licenses.gpl3Plus;
46+ maintainers = [stdenv.lib.maintainers.raskin stdenv.lib.maintainers.simons];
47+ platforms = stdenv.lib.platforms.linux;
7548 };
7649}
pkgs/top-level/all-packages.nix+1−4
@@ -523,10 +523,7 @@ let
523523
524524 ascii = callPackage ../tools/text/ascii { };
525525
526− asymptote = builderDefsPackage ../tools/graphics/asymptote {
527− inherit freeglut ghostscriptX imagemagick fftw boehmgc
528− mesa ncurses readline gsl libsigsegv python zlib perl
529− texinfo xz;
526+ asymptote = callPackage ../tools/graphics/asymptote {
530527 texLive = texLiveAggregationFun {
531528 paths = [ texLive texLiveExtra texLiveCMSuper ];
532529 };