diff --git a/pkgs/applications/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix new file mode 100644 index 000000000000..d64bd60bfd2a --- /dev/null +++ b/pkgs/applications/version-management/bazaar/default.nix @@ -0,0 +1,22 @@ +{stdenv, fetchurl, python, makeWrapper}: + +stdenv.mkDerivation { + name = "bazaar-1.1"; + + src = fetchurl { + url = file:///home/eelco/Downloads/bzr-1.1.tar.gz; + sha256 = "1qpkw580r22yxybdghx2ha0kyk22brbhd1kg9wwjh209dqy2gqzc"; + }; + + buildInputs = [python makeWrapper]; + + installPhase = '' + python setup.py install --prefix=$out + wrapProgram $out/bin/bzr --prefix PYTHONPATH : "$(toPythonPath $out)" + ''; + + meta = { + homepage = http://bazaar-vcs.org/; + description = "A distributed version control system that Just Works"; + }; +} diff --git a/pkgs/build-support/make-wrapper/make-wrapper.sh b/pkgs/build-support/make-wrapper/make-wrapper.sh index 847db8910fd5..b9ed4c54acff 100644 --- a/pkgs/build-support/make-wrapper/make-wrapper.sh +++ b/pkgs/build-support/make-wrapper/make-wrapper.sh @@ -72,3 +72,11 @@ filterExisting() { fi done } + +# Syntax: wrapProgram +wrapProgram() { + local prog="$1" + local hidden="$(dirname "$prog")/.wrapped-$(basename "$prog")" + mv $prog $hidden + makeWrapper $hidden $prog "$@" +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 304444730689..bb4f895b3370 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -288,8 +288,15 @@ rec { inherit stdenv curl; }); + makeSetupHook = script: runCommand "hook" {} '' + ensureDir $out/nix-support + cp ${script} $out/nix-support/setup-hook + ''; + makeWrapper = ../build-support/make-wrapper/make-wrapper.sh; + makeWrapperNew = 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 # environment prior to running the command. @@ -3807,6 +3814,11 @@ rec { inherit fetchurl stdenv unzip; }; + bazaar = import ../applications/version-management/bazaar { + inherit fetchurl stdenv python; + makeWrapper = makeWrapperNew; + }; + # commented out because it's using the new configuration style proposal which is unstable #biew = import ../applications/misc/biew { # inherit lib stdenv fetchurl ncurses;