From 5c8272b0bcbbb27090a2906eaa8cb8671e8dd950 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 21 Feb 2010 17:36:41 +0000 Subject: [PATCH] Adding asymptote graphic generation tool svn path=/nixpkgs/trunk/; revision=20158 --- pkgs/tools/graphics/asymptote/default.nix | 54 +++++++++++++++++++ .../graphics/asymptote/src-for-default.nix | 9 ++++ .../asymptote/src-info-for-default.nix | 8 +++ pkgs/top-level/all-packages.nix | 11 ++++ 4 files changed, 82 insertions(+) create mode 100644 pkgs/tools/graphics/asymptote/default.nix create mode 100644 pkgs/tools/graphics/asymptote/src-for-default.nix create mode 100644 pkgs/tools/graphics/asymptote/src-info-for-default.nix diff --git a/pkgs/tools/graphics/asymptote/default.nix b/pkgs/tools/graphics/asymptote/default.nix new file mode 100644 index 00000000000..92b8a980a8d --- /dev/null +++ b/pkgs/tools/graphics/asymptote/default.nix @@ -0,0 +1,54 @@ +a @ { + freeglut,ghostscriptX,imagemagick,fftw, + boehmgc,mesa,ncurses,readline,gsl,libsigsegv, + python,zlib, perl, texLive, texinfo, lzma, + + noDepEntry, fullDepEntry, fetchUrlFromSrcInfo, + lib, + + ...}: +let + s = import ./src-for-default.nix; + buildInputs = with a; [ + freeglut ghostscriptX imagemagick fftw boehmgc + mesa ncurses readline gsl libsigsegv python zlib + perl texLive texinfo lzma + ]; +in +rec { + src = a.fetchUrlFromSrcInfo s; + + inherit (s) name; + inherit buildInputs; + configureFlags = []; + + /* doConfigure should be removed if not needed */ + phaseNames = ["setVars" "doUnpack" "fixPaths" "extractTexinfoTex" + "doConfigure" "dumpRealVars" "doMakeInstall" "fixPathsResult"]; + + setVars = a.noDepEntry '' + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.boehmgc}/include/gc" + export HOME="$PWD" + ''; + + dumpRealVars = a.noDepEntry '' + set > ../real-env-vars + ''; + + fixPaths = a.doPatchShebangs ''.''; + fixPathsResult = a.doPatchShebangs ''$out/bin''; + + extractTexinfoTex = a.fullDepEntry '' + lzma -d < ${a.texinfo.src} | tar --wildcards -x texinfo-'*'/doc/texinfo.tex + cp texinfo-*/doc/texinfo.tex doc/ + '' ["minInit" "addInputs" "doUnpack"]; + + meta = { + description = "A tool for programming graphics intended to replace Metapost"; + maintainers = [ + a.lib.maintainers.raskin + ]; + platforms = with a.lib.platforms; + linux ++ freebsd ++ darwin; + }; +} diff --git a/pkgs/tools/graphics/asymptote/src-for-default.nix b/pkgs/tools/graphics/asymptote/src-for-default.nix new file mode 100644 index 00000000000..cdc735838d5 --- /dev/null +++ b/pkgs/tools/graphics/asymptote/src-for-default.nix @@ -0,0 +1,9 @@ +rec { + version="1.91"; + name="asymptote-1.91"; + hash="1bchzl8czhhjz47mr68m0ysj0dp09ks69qx3l46is3h6rj4bj1sp"; + url="http://downloads.sourceforge.net/asymptote/files/asymptote/${version}/asymptote-${version}.src.tgz"; + advertisedUrl="http://downloads.sourceforge.net/asymptote/files/asymptote/1.91/asymptote-1.91.src.tgz"; + + +} diff --git a/pkgs/tools/graphics/asymptote/src-info-for-default.nix b/pkgs/tools/graphics/asymptote/src-info-for-default.nix new file mode 100644 index 00000000000..dbfd064f51a --- /dev/null +++ b/pkgs/tools/graphics/asymptote/src-info-for-default.nix @@ -0,0 +1,8 @@ +{ + downloadPage = "http://sourceforge.net/projects/asymptote/files/"; + baseName = "asymptote"; + sourceRegexp = ".*[.]src[.]tgz"; + versionExtractorSedScript = ''$extractReleaseSF''; + versionReferenceCreator = ''$(replaceAllVersionOccurences)''; + choiceCommand = ''head -1 | sed -re "$skipRedirectSF"''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4890fd69884..f4a40db8196 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -346,6 +346,17 @@ let inherit fetchurl stdenv libpcap openssl zlib wirelesstools; }; + asymptote = builderDefsPackage ../tools/graphics/asymptote { + inherit freeglut ghostscriptX imagemagick fftw boehmgc + mesa ncurses readline gsl libsigsegv python zlib perl + texinfo lzma; + texLive = texLiveAggregationFun { + paths = [ + texLive texLiveExtra + ]; + }; + }; + ec2apitools = import ../tools/virtualization/amazon-ec2-api-tools { inherit stdenv fetchurl unzip makeWrapper jre; };