1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 06:01:15 +00:00

* makeWrapper: option --run <CMD> 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
This commit is contained in:
Eelco Dolstra 2008-01-18 11:28:41 +00:00
parent b59d32be03
commit a5e0e39cdb
15 changed files with 71 additions and 88 deletions

View file

@ -1,5 +1,4 @@
source $stdenv/setup
source $makeWrapper
unpackFile $src
ensureDir $out

View file

@ -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];
};

View file

@ -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
}

View file

@ -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";

View file

@ -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
'';
}

View file

@ -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. */
}
meta = {
description = "A tool to convert CVS repositories to Subversion repositories";
homepage = http://cvs2svn.tigris.org/;
};
}

View file

@ -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/;
};
}

View file

@ -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))]}

View file

@ -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";

View file

@ -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];

View file

@ -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

View file

@ -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;
}

View file

@ -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
genericBuild

View file

@ -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";

View file

@ -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 {