From a5e0e39cdb575a38216a2a0e9ee25eae5bb05397 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 18 Jan 2008 11:28:41 +0000 Subject: [PATCH] * makeWrapper: option --run to run a command from the wrapper. This is so that the Unison wrapper can be generated with makeWrapper. * Use makeWrapper as a buildInput everywhere. * Updated BitTorrent, cvs2svn. svn path=/nixpkgs/trunk/; revision=10213 --- pkgs/applications/editors/eclipse/builder.sh | 1 - pkgs/applications/editors/eclipse/default.nix | 3 +- pkgs/applications/graphics/xfig/builder.sh | 5 +--- pkgs/applications/graphics/xfig/default.nix | 4 +-- .../networking/sync/unison/default.nix | 22 ++++++--------- .../version-management/cvs2svn/default.nix | 28 ++++++++++--------- .../version-management/mercurial/default.nix | 21 ++++++-------- .../make-wrapper/make-wrapper.sh | 11 ++++++-- .../python-modules/ZopeInterface/default.nix | 6 ++-- .../python-modules/twisted/default.nix | 6 ++-- pkgs/misc/trac/builder.sh | 6 ++-- pkgs/misc/trac/default.nix | 17 ++++++----- .../networking/p2p/bittorrent/builder.sh | 8 ++---- .../networking/p2p/bittorrent/default.nix | 12 ++++---- pkgs/top-level/all-packages.nix | 9 ++---- 15 files changed, 71 insertions(+), 88 deletions(-) diff --git a/pkgs/applications/editors/eclipse/builder.sh b/pkgs/applications/editors/eclipse/builder.sh index b38befee41ad..6e064e1fa9b6 100755 --- a/pkgs/applications/editors/eclipse/builder.sh +++ b/pkgs/applications/editors/eclipse/builder.sh @@ -1,5 +1,4 @@ source $stdenv/setup -source $makeWrapper unpackFile $src ensureDir $out diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index 71afb07eece5..23199bdcc129 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -6,7 +6,8 @@ let { name = "eclipse-sdk-3.3.3.1"; builder = ./builder.sh; src = bindist; - inherit makeWrapper jdk plugins; + buildInputs = [makeWrapper]; + inherit jdk plugins; libraries = [gtk glib libXtst]; }; diff --git a/pkgs/applications/graphics/xfig/builder.sh b/pkgs/applications/graphics/xfig/builder.sh index de64fbce78fa..dc943180508e 100644 --- a/pkgs/applications/graphics/xfig/builder.sh +++ b/pkgs/applications/graphics/xfig/builder.sh @@ -1,5 +1,4 @@ source $stdenv/setup -source $makeWrapper makeFlags="XAWLIB=-lXaw3d BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults LIBDIR=$out/lib/X11 XFIGDOCDIR=$out/share/doc/xfig MANPATH=$out/man" @@ -16,9 +15,7 @@ installCommand=myInstall myInstall() { make install.all $makeFlags - mv $out/bin/xfig $out/bin/.xfig - - makeWrapper $out/bin/.xfig $out/bin/xfig \ + wrapProgram $out/bin/xfig \ --set XAPPLRESDIR $out/etc/X11/app-defaults } diff --git a/pkgs/applications/graphics/xfig/default.nix b/pkgs/applications/graphics/xfig/default.nix index 0d94d4a655d0..49de840e2dcb 100644 --- a/pkgs/applications/graphics/xfig/default.nix +++ b/pkgs/applications/graphics/xfig/default.nix @@ -11,9 +11,7 @@ stdenv.mkDerivation { builder = ./builder.sh; - buildInputs = [imake x11 libXpm libXmu libXi libXp Xaw3d libpng libjpeg]; - - inherit makeWrapper; + buildInputs = [imake x11 libXpm libXmu libXi libXp Xaw3d libpng libjpeg makeWrapper]; NIX_CFLAGS_COMPILE = "-I${libXpm}/include/X11"; diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix index 75c976a43294..0883c236d010 100644 --- a/pkgs/applications/networking/sync/unison/default.nix +++ b/pkgs/applications/networking/sync/unison/default.nix @@ -7,21 +7,15 @@ stdenv.mkDerivation { sha256 = "808400a933aeb67654edc770822cd186d1b2adc92e7cb5836996c71c69ffe656"; }; - buildInputs = [ocaml]; + buildInputs = [ocaml makeWrapper]; - addInputsHook = "source $makeWrapper"; - preBuild = "sed -i \"s|\\(OCAMLOPT=.*\\)$|\\1 -I $lablgtk/lib/ocaml/lablgtk2|\" Makefile.OCaml"; + preBuild = "sed -i \"s|\\(OCAMLOPT=.*\\)$|\\1 -I ${lablgtk}/lib/ocaml/lablgtk2|\" Makefile.OCaml"; makeFlags = "UISTYLE=gtk2 INSTALLDIR=$(out)/bin/"; preInstall = "ensureDir $out/bin"; - postInstall = [ - "for i in $(cd $out/bin && ls); do" - " mv $out/bin/$i $out/bin/.orig-$i;" - " echo \"#! $SHELL\" > $out/bin/$i;" - " echo \"$xset/bin/xset q | grep -q \\\"$fontschumachermisc\\\" || $xset/bin/xset +fp \\\"$fontschumachermisc/lib/X11/fonts/misc\\\"\" >> $out/bin/$i;" - " echo \"exec \\\"$out/bin/.orig-$i\\\" \\\"\\\$@\\\"\" >> $out/bin/$i;" - " chmod +x $out/bin/$i;" - "done" - ]; - - inherit lablgtk fontschumachermisc xset makeWrapper; + postInstall = '' + for i in $(cd $out/bin && ls); do + wrapProgram $out/bin/$i \ + --run "${xset}/bin/xset q | grep -q \"${fontschumachermisc}\" || ${xset}/bin/xset +fp \"${fontschumachermisc}/lib/X11/fonts/misc\"" + done + ''; } diff --git a/pkgs/applications/version-management/cvs2svn/default.nix b/pkgs/applications/version-management/cvs2svn/default.nix index e519be927335..65c2c84d0da1 100644 --- a/pkgs/applications/version-management/cvs2svn/default.nix +++ b/pkgs/applications/version-management/cvs2svn/default.nix @@ -1,25 +1,27 @@ -{stdenv, fetchurl, python, bsddb3, makeWrapper}: +{stdenv, fetchurl, python, makeWrapper}: stdenv.mkDerivation { - name = "cvs2svn-1.5.1"; + name = "cvs2svn-2.0.1"; src = fetchurl { - url = http://cvs2svn.tigris.org/files/documents/1462/36129/cvs2svn-1.5.1.tar.gz; - md5 = "d1e42ea51b373be0023f2b3f6b80ec01"; + url = http://cvs2svn.tigris.org/files/documents/1462/39919/cvs2svn-2.0.1.tar.gz; + sha256 = "1pgbyxzgn22lnw3h5c2nd8z46pkk863jg3fgh9pqa1jihsx1cg1j"; }; - buildInputs = [python bsddb3]; + buildInputs = [python makeWrapper]; buildPhase = "true"; - installPhase = " + installPhase = '' python ./setup.py install --prefix=$out - - source ${makeWrapper} - mv $out/bin/cvs2svn $out/bin/.orig-cvs2svn - makeWrapper $out/bin/.orig-cvs2svn $out/bin/cvs2svn \\ - --set PYTHONPATH \"$(toPythonPath $out):$(toPythonPath ${bsddb3}):$PYTHONPATH\" - "; + wrapProgram $out/bin/cvs2svn \ + --set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH" + ''; /* !!! maybe we should absolutise the program names in $out/lib/python2.4/site-packages/cvs2svn_lib/config.py. */ -} \ No newline at end of file + + meta = { + description = "A tool to convert CVS repositories to Subversion repositories"; + homepage = http://cvs2svn.tigris.org/; + }; +} diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 253907ab4bde..944bf2b7ae41 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -7,20 +7,17 @@ stdenv.mkDerivation { sha256 = "26996df67d508e129d2f0a264e25072764e5c2d21606e1658d77c8984e6ed64a"; }; - inherit makeWrapper; - - buildInputs = [ python ]; - addInputsHook = "source $makeWrapper"; + buildInputs = [ python makeWrapper ]; makeFlags = "PREFIX=$(out)"; - postInstall = [ - "for i in $(cd $out/bin && ls); do" - " mv $out/bin/$i $out/bin/.orig-$i;" - " makeWrapper $out/bin/.orig-$i $out/bin/$i" - " --set PYTHONPATH \"$(toPythonPath $out):$PYTHONPATH\";" - "done" - ]; + postInstall = '' + for i in $(cd $out/bin && ls); do + wrapProgram $out/bin/$i \ + --prefix PYTHONPATH : "$(toPythonPath $out)" + done + ''; meta = { - description = "a fast, lightweight SCM system for very large distributed projects"; + description = "A fast, lightweight SCM system for very large distributed projects"; + homepage = http://www.selenic.com/mercurial/; }; } diff --git a/pkgs/build-support/make-wrapper/make-wrapper.sh b/pkgs/build-support/make-wrapper/make-wrapper.sh index b9ed4c54acff..558ff94c1a03 100644 --- a/pkgs/build-support/make-wrapper/make-wrapper.sh +++ b/pkgs/build-support/make-wrapper/make-wrapper.sh @@ -1,6 +1,7 @@ makeWrapper() { - original=$1 - wrapper=$2 + local original=$1 + local wrapper=$2 + local params varName value command separator n fileNames ensureDir "$(dirname $wrapper)" @@ -17,6 +18,12 @@ makeWrapper() { echo "export $varName=$value" >> $wrapper fi + if test "$p" = "--run"; then + command=${params[$((n + 1))]} + n=$((n + 1)) + echo "$command" >> $wrapper + fi + if test "$p" = "--suffix" -o "$p" = "--prefix"; then varName=${params[$((n + 1))]} separator=${params[$((n + 2))]} diff --git a/pkgs/development/python-modules/ZopeInterface/default.nix b/pkgs/development/python-modules/ZopeInterface/default.nix index 0fe40954115b..6bcedcd0f171 100644 --- a/pkgs/development/python-modules/ZopeInterface/default.nix +++ b/pkgs/development/python-modules/ZopeInterface/default.nix @@ -1,10 +1,10 @@ {stdenv, fetchurl, python}: stdenv.mkDerivation { - name = "ZopeInterface-3.1.0c1"; + name = "ZopeInterface-3.3.0"; src = fetchurl { - url = http://www.zope.org/Products/ZopeInterface/3.1.0c1/ZopeInterface-3.1.0c1.tgz; - md5 = "f34cb95f2fbdbe3f1850c95cefddbd2c"; + url = http://www.zope.org/Products/ZopeInterface/3.3.0/zope.interface-3.3.0.tar.gz; + sha256 = "0xahg9cmagn4j3dbifvgzbjliw2jdrbf27fhqwkdp8j80xpyyjf0"; }; buildInputs = [python]; buildPhase = "true"; diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix index 37a42faf8568..7fdf610d74ca 100644 --- a/pkgs/development/python-modules/twisted/default.nix +++ b/pkgs/development/python-modules/twisted/default.nix @@ -1,10 +1,10 @@ {stdenv, fetchurl, python, ZopeInterface}: stdenv.mkDerivation { - name = "twisted-2.4.0"; + name = "twisted-2.5.0"; src = fetchurl { - url = http://tmrc.mit.edu/mirror/twisted/Twisted/2.4/Twisted-2.4.0.tar.bz2; - md5 = "42eb0c8fd0f8707a39fff1dd6adab27d"; + url = http://tmrc.mit.edu/mirror/twisted/Twisted/2.5/Twisted-2.5.0.tar.bz2; + sha256 = "1kfj4354lm4kphm317giyldykyd17lba2xd7y512lxc38hzxzcpk"; }; buildInputs = [python]; propagatedBuildInputs = [ZopeInterface]; diff --git a/pkgs/misc/trac/builder.sh b/pkgs/misc/trac/builder.sh index a3e97e178a01..76bf06123348 100644 --- a/pkgs/misc/trac/builder.sh +++ b/pkgs/misc/trac/builder.sh @@ -1,5 +1,4 @@ source $stdenv/setup -source $makeWrapper unpackPhase mkdir -p $out @@ -7,7 +6,6 @@ cd $name $python/bin/python setup.py install --prefix=$out for i in $(cd $out/bin && ls); do - mv $out/bin/$i $out/bin/.orig-$i - makeWrapper $out/bin/.orig-$i $out/bin/$i \ - --set PYTHONPATH "$python/site-packages:$out/lib/python2.4/site-packages:$pysqlite/lib/python2.4/site-packages:$subversion/lib/svn-python:$clearsilver/site-packages" + wrapProgram $out/bin/$i \ + --prefix PYTHONPATH : "$(toPythonPath $python):$(toPythonPath $out):$(toPythonPath $pysqlite):$subversion/lib/svn-python:$clearsilver/site-packages" done diff --git a/pkgs/misc/trac/default.nix b/pkgs/misc/trac/default.nix index c456c51daff9..b93c36843d32 100644 --- a/pkgs/misc/trac/default.nix +++ b/pkgs/misc/trac/default.nix @@ -3,13 +3,12 @@ assert stdenv.system == "i686-linux"; stdenv.mkDerivation { - name = "trac-0.9.5"; - src = fetchurl { - url = "http://ftp.edgewall.com/pub/trac/trac-0.9.5.tar.gz"; - md5 = "3b7d708eaf905cc6ba2b6b10a09a8cf4"; - }; - builder = ./builder.sh; - inherit stdenv python subversion clearsilver sqlite pysqlite makeWrapper; + name = "trac-0.9.5"; + src = fetchurl { + url = "http://ftp.edgewall.com/pub/trac/trac-0.9.5.tar.gz"; + md5 = "3b7d708eaf905cc6ba2b6b10a09a8cf4"; + }; + builder = ./builder.sh; + buildInputs = [makeWrapper]; + inherit stdenv python subversion clearsilver sqlite pysqlite; } - - diff --git a/pkgs/tools/networking/p2p/bittorrent/builder.sh b/pkgs/tools/networking/p2p/bittorrent/builder.sh index 633f53ebd43d..8097995dfbda 100644 --- a/pkgs/tools/networking/p2p/bittorrent/builder.sh +++ b/pkgs/tools/networking/p2p/bittorrent/builder.sh @@ -1,5 +1,4 @@ source $stdenv/setup -source $makeWrapper # Workaround for: # File "...-python-2.4.4/lib/python2.4/posixpath.py", line 62, in join @@ -20,12 +19,9 @@ installPhase() { # Create wrappers that set the environment correctly. for i in $(cd $out/bin && ls); do - # Note: the GUI apps except to be in a directory called `bin', - # so don't move them. - mv $out/bin/$i $out/bin/.orig-$i - makeWrapper $out/bin/.orig-$i $out/bin/$i \ + wrapProgram $out/bin/$i \ --set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH" done } -genericBuild \ No newline at end of file +genericBuild diff --git a/pkgs/tools/networking/p2p/bittorrent/default.nix b/pkgs/tools/networking/p2p/bittorrent/default.nix index 3894cbd36d41..cfddd48a342e 100644 --- a/pkgs/tools/networking/p2p/bittorrent/default.nix +++ b/pkgs/tools/networking/p2p/bittorrent/default.nix @@ -6,18 +6,16 @@ assert gui -> wxPython != null; stdenv.mkDerivation { - name = "bittorrent-5.0.7"; + name = "bittorrent-5.2.0"; builder = ./builder.sh; src = fetchurl { - url = http://download.bittorrent.com/dl/BitTorrent-5.0.7.tar.gz; - sha256 = "09m2qlhzbc6j1hf6fniri0hh6cy6ccgwi2sph65bpjrc417l94gj"; + url = http://download.bittorrent.com/dl/BitTorrent-5.2.0.tar.gz; + sha256 = "0lg54x5y2k1cb7vpj7hanlnvzqa2k3v24qq0g6fsycjk4n8dky02"; }; - buildInputs = [python pycrypto twisted] - ++ (if gui then [wxPython] else []); - - inherit makeWrapper; + buildInputs = [python pycrypto twisted makeWrapper] + ++ stdenv.lib.optional gui wxPython; meta = { description = "The original client for the BitTorrent peer-to-peer file sharing protocol"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bb4f895b3370..3a342e77cdd1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -293,9 +293,7 @@ rec { cp ${script} $out/nix-support/setup-hook ''; - makeWrapper = ../build-support/make-wrapper/make-wrapper.sh; - - makeWrapperNew = makeSetupHook ../build-support/make-wrapper/make-wrapper.sh; + makeWrapper = makeSetupHook ../build-support/make-wrapper/make-wrapper.sh; # Run the shell command `buildCommand' to produce a store object # named `name'. The attributes in `env' are added to the @@ -3815,8 +3813,7 @@ rec { }; bazaar = import ../applications/version-management/bazaar { - inherit fetchurl stdenv python; - makeWrapper = makeWrapperNew; + inherit fetchurl stdenv python makeWrapper; }; # commented out because it's using the new configuration style proposal which is unstable @@ -3949,7 +3946,7 @@ rec { }; cvs2svn = import ../applications/version-management/cvs2svn { - inherit fetchurl stdenv python bsddb3 makeWrapper; + inherit fetchurl stdenv python makeWrapper; }; d4x = import ../applications/misc/d4x {