[Nix-dev] hgsubversion (and subvertpy) nix-expressions

Lluís Batlle i Rossell viriketo at gmail.com
Thu Oct 14 08:53:16 CEST 2010


Hello Ilya,

thank you for the packages, but as they are python packages, have you tried
using the buildPythonPackage expression?

Look at top-level/python-packages.nix. I think the buildPythonPackage expresion
may do all the work you are doing here.

Regards,
Lluís.

On Thu, Oct 14, 2010 at 12:12:31AM +0200, Ilya Cassina wrote:
> especially dedicated to viric :)
> 
> imc

> {stdenv, fetchurl, python, subversion, apr, aprutil}:
> 
> python.stdenv.mkDerivation {
>     name = "subvertpy-0.7.4";
>     src = fetchurl {
>         url = http://launchpadlibrarian.net/56729076/subvertpy-0.7.4.tar.gz;
>         sha256 = "94cfaf50edf47bfc79698a08dac10655be97e938f55ef656cea04cd174606ab4";
>     };
>     buildInputs = [python subversion apr aprutil];
> 
> 
>     buildPhase = ''
>         export SVN_PREFIX=${subversion}
>         python setup.py build
>     '';
> 
>     installPhase = ''
>         version=`python --version 2>&1 | awk '{print $2}' | cut -d . -f 1,2`
>         ensureDir $out/lib/python$version/site-packages/
>         echo "cp -r build/lib.*-$version/subvertpy $out/lib/python$version/site-packages/"
>         cp -r build/lib.*-$version/subvertpy $out/lib/python$version/site-packages/
> 
>         ensureDir $out/bin
>         cp -r build/scripts-$version/subvertpy-fast-export $out/bin
>     '';
> 
> }

> { stdenv, fetchurl, python27, mercurial, subvertpy}:
> 
> let
>   version = "1.1.2+101-bfb88a304ebe+20101012";
>   sha256 = "761c13b572ad380c1e33f6e5c7bc4f80cced07e9467ebceafb231492c59a9ea4";
> in
> 
> stdenv.mkDerivation {
>   name = "hgsubversion-" + version;
> 
>   # No tarball yet.
>   src = fetchurl {
>     url = http://bitbucket.org/durin42/hgsubversion/get/bfb88a304ebe.bz2;
>     inherit sha256;
>   };
> 
>   buildInputs = [ python27 mercurial subvertpy ];
> 
>   unpackPhase = ''
>     tar xvjf $src
>   '';
> 
>   buildPhase = ''
>     cd hgsubversion
>     python2.7 setup.py build
>   '';
> 
>   installPhase = ''
>     python2.7 setup.py install --prefix="$out"
>   '';
> }

> _______________________________________________
> nix-dev mailing list
> nix-dev at cs.uu.nl
> https://mail.cs.uu.nl/mailman/listinfo/nix-dev




More information about the nix-dev mailing list