From 7d963a85f3e7e0a111d9bc50b7447356c955d28d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Jul 2015 11:04:48 +0200 Subject: redo --- custom/redo.nix | 18 ++++++++++++++++++ users/gkleen@vali.nix | 1 + 2 files changed, 19 insertions(+) create mode 100644 custom/redo.nix diff --git a/custom/redo.nix b/custom/redo.nix new file mode 100644 index 00000000..9d679e55 --- /dev/null +++ b/custom/redo.nix @@ -0,0 +1,18 @@ +# This file was auto-generated by cabal2nix. Please do NOT edit manually! + +{ cabal, filepath, pureMD5 }: + +cabal.mkDerivation (self: { + pname = "redo"; + version = "0.2.0"; + sha256 = "18951sri8wix8aazd8hy8g2gzcpxw2x1ihzmn2prlf10zy1jcy4d"; + isLibrary = false; + isExecutable = true; + buildDepends = [ filepath pureMD5 ]; + meta = { + homepage = "https://github.com/jekor/redo"; + description = "software build system, make replacement, implementation of djb's redo"; + license = self.stdenv.lib.licenses.publicDomain; + platforms = self.ghc.meta.platforms; + }; +}) diff --git a/users/gkleen@vali.nix b/users/gkleen@vali.nix index 79a121fc..9effa4dd 100644 --- a/users/gkleen@vali.nix +++ b/users/gkleen@vali.nix @@ -1,4 +1,5 @@ { packageOverrides = pkgs: rec { + redo = pkgs.haskellPackages.callPackage ../custom/redo.nix {}; } // (import ../utils/nix/default.nix) {}; } -- cgit v1.2.3 From 0c7281ee4a7858b8288cd6c3d60da8b40cb2e698 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Jul 2015 11:54:00 +0200 Subject: Wrapper around redo for $PATH reasons --- custom/redo-wrapper.nix | 16 ++++++++++++++++ custom/redo.nix | 1 + custom/redo.patch | 18 ++++++++++++++++++ users/gkleen@vali.nix | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 custom/redo-wrapper.nix create mode 100644 custom/redo.patch diff --git a/custom/redo-wrapper.nix b/custom/redo-wrapper.nix new file mode 100644 index 00000000..20e1675a --- /dev/null +++ b/custom/redo-wrapper.nix @@ -0,0 +1,16 @@ +{ stdenv, makeWrapper, haskellPackages }: + +let + redo = haskellPackages.callPackage ./redo.nix {}; +in stdenv.mkDerivation { + name = "redo-wrapper"; + + nativeBuildInputs = [ makeWrapper ]; + + buildCommand = '' + mkdir -p $out/bin + ln -s $out/bin/redo $out/bin/redo-ifchange + makeWrapper ${redo}/bin/redo $out/bin/redo \ + --set REDO_PATH "$out/bin" + ''; +} diff --git a/custom/redo.nix b/custom/redo.nix index 9d679e55..b5255f98 100644 --- a/custom/redo.nix +++ b/custom/redo.nix @@ -9,6 +9,7 @@ cabal.mkDerivation (self: { isLibrary = false; isExecutable = true; buildDepends = [ filepath pureMD5 ]; + patches = [ ./redo.patch ]; meta = { homepage = "https://github.com/jekor/redo"; description = "software build system, make replacement, implementation of djb's redo"; diff --git a/custom/redo.patch b/custom/redo.patch new file mode 100644 index 00000000..cd3a678e --- /dev/null +++ b/custom/redo.patch @@ -0,0 +1,18 @@ +diff --git a/redo.hs b/redo.hs +index f0e816a..01c6a2e 100644 +--- a/redo.hs ++++ b/redo.hs +@@ -48,7 +48,12 @@ redo target dir = do + createDirectoryIfMissing True metaDepsDir + writeMD5 target path + oldEnv <- getEnvironment +- let newEnv = toList $ adjust (++ ":.") "PATH" $ insert "REDO_TARGET" target $ fromList oldEnv ++ redoPath <- lookupEnv "REDO_PATH" ++ let ++ redoPath' = case redoPath of ++ Just p -> p ++ _ -> "." ++ newEnv = toList $ adjust (++ (':' : redoPath')) "PATH" $ insert "REDO_TARGET" target $ fromList oldEnv + (_, _, _, ph) <- createProcess $ (shell $ cmd path) {env = Just newEnv} + exit <- waitForProcess ph + case exit of diff --git a/users/gkleen@vali.nix b/users/gkleen@vali.nix index 9effa4dd..0ac360dc 100644 --- a/users/gkleen@vali.nix +++ b/users/gkleen@vali.nix @@ -1,5 +1,5 @@ { packageOverrides = pkgs: rec { - redo = pkgs.haskellPackages.callPackage ../custom/redo.nix {}; + redo = pkgs.callPackage ../custom/redo-wrapper.nix {}; } // (import ../utils/nix/default.nix) {}; } -- cgit v1.2.3