From a330e244ad60e50def988115643b7e42bf46cf58 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sat, 15 Mar 2014 08:15:22 -0400 Subject: [PATCH] Revert "Merge branch 'nix-run' of git://github.com/rickynils/nixpkgs" nix-run's functionality is subsumed by nix-shell -p. This reverts commit 3cc2b243c7f2d906ce77968e75fd84a3f65a09e0, reversing changes made to 4d5d6aed29a0ee10a471fd870fa2fdb61408e4eb. --- pkgs/build-support/my-env-run/default.nix | 6 -- pkgs/misc/nix-run/default.nix | 72 ----------------------- pkgs/top-level/all-packages.nix | 6 -- 3 files changed, 84 deletions(-) delete mode 100644 pkgs/build-support/my-env-run/default.nix delete mode 100644 pkgs/misc/nix-run/default.nix diff --git a/pkgs/build-support/my-env-run/default.nix b/pkgs/build-support/my-env-run/default.nix deleted file mode 100644 index 0fedd0b8c6d3..000000000000 --- a/pkgs/build-support/my-env-run/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ writeScript, bash, myEnvFun }: args: - -let env = myEnvFun args; in writeScript "envrun-${args.name}" '' - #!${bash}/bin/bash - ${env}/bin/load-env-${args.name} -'' diff --git a/pkgs/misc/nix-run/default.nix b/pkgs/misc/nix-run/default.nix deleted file mode 100644 index ef83ec2a1f3d..000000000000 --- a/pkgs/misc/nix-run/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ stdenv, bash, writeScript }: - -let - - nix-run = writeScript "nix-run" '' - #!${bash}/bin/bash - - # Runs nix-build and executes the result - # All arguments before "--" are given to nix-build, - # and all arguments after "--" are given to the - # executed command. stdin is redirected to the executed - # command. - - out=$(mktemp) - rm "$out" - - # parse args into args1 and args2, separated by -- - # args1 goes to nix-build, args2 goes to the built command - args1=("$@") - args2=() - for i in "''${!args1[@]}"; do - if [ "''${args1[$i]}" == "--" ]; then - args2=("''${args1[@]:$((i+1))}") - args1=("''${args1[@]:0:$((i))}") - break - fi - done - - if nix-build -o "$out" "''${args1[@]}" >/dev/null; then - target=$(readlink -m "$out") - unlink "$out" - if test -f "$target" && test -x "$target"; then - exec "$target" "''${args2[@]}" <&0 - else - echo "nix-run: No executable target produced by nix-build" - exit 1 - fi - else - echo "nix-run: nix-build failed" - exit 1 - fi - ''; - -in stdenv.mkDerivation { - name = "nix-run"; - phases = [ "installPhase" ]; - installPhase = '' - mkdir -p $out/bin - ln -s ${nix-run} $out/bin/nix-run - ''; - meta = { - description = '' - Wrapper around nix-build that automatically executes the binary - produced by the provided Nix expression. - ''; - longDescription = '' - nix-run invokes nix-build with any options given to it. It then - expects one executable file to be produced by nix-build. If this - is the case, that file is executed with any options that is given - to nix-run after a -- option separator. If no - executable file is produced by nix-build, nix-run will exit with - an error. An example invocation of nix-run is nix-run -A - myattr mynix.nix -- -o opt. nix-run will then build the - attribute myattr from the Nix expression given - in the file mynix.nix. If a single executable - file is produced, that file is executed with the option - -o opt. - ''; - maintainers = [ stdenv.lib.maintainers.rickynils ]; - platforms = stdenv.lib.platforms.linux; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9aaa55496e21..ab536d80ce27 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10554,12 +10554,6 @@ let inherit (stdenv) mkDerivation; }; - myEnvRun = import ../build-support/my-env-run { - inherit writeScript bash myEnvFun; - }; - - nix-run = callPackage ../misc/nix-run { }; - # patoline requires a rather large ocaml compilation environment. # this is why it is build as an environment and not just a normal package. # remark : the emacs mode is also installed, but you have to adjust your load-path.