From b64d25c44782027414509460c1900646dee57db1 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 23 Feb 2019 21:12:16 +0100 Subject: [PATCH] skawarePackages.execline: wrap execlineb with tools The execlineb program is the launcher (and lexer) of execline scripts. So it makes a lot of sense to have all the small tools in scope by default. We append to the end of PATH so that they can be easily overwritten by the user. Co-authored-by: Alyssa Ross --- pkgs/build-support/skaware/build-skaware-package.nix | 6 ++++++ pkgs/tools/misc/execline/default.nix | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/skaware/build-skaware-package.nix b/pkgs/build-support/skaware/build-skaware-package.nix index 51921fdfbdc..5ae8985e3ab 100644 --- a/pkgs/build-support/skaware/build-skaware-package.nix +++ b/pkgs/build-support/skaware/build-skaware-package.nix @@ -19,6 +19,10 @@ in { # mostly for moving and deleting files from the build directory # : lines , postInstall + # packages with setup hooks that should be run + # (see definition of `makeSetupHook`) + # : list drv +, setupHooks ? [] # : list Maintainer , maintainers ? [] @@ -82,6 +86,8 @@ in stdenv.mkDerivation { dontDisableStatic = true; enableParallelBuilding = true; + nativeBuildInputs = setupHooks; + configureFlags = configureFlags ++ [ "--enable-absolute-paths" (if stdenv.isDarwin diff --git a/pkgs/tools/misc/execline/default.nix b/pkgs/tools/misc/execline/default.nix index f0dc3ab6460..770f4ae67f4 100644 --- a/pkgs/tools/misc/execline/default.nix +++ b/pkgs/tools/misc/execline/default.nix @@ -1,4 +1,4 @@ -{ stdenv, skawarePackages }: +{ stdenv, skawarePackages, makeWrapper }: with skawarePackages; @@ -11,6 +11,8 @@ buildPackage { outputs = [ "bin" "lib" "dev" "doc" "out" ]; + setupHooks = [ makeWrapper ]; + # TODO: nsss support configureFlags = [ "--libdir=\${lib}/lib" @@ -30,6 +32,11 @@ buildPackage { mv doc $doc/share/doc/execline/html mv examples $doc/share/doc/execline/examples + + # finally, add all tools to PATH so they are available + # from within execlineb scripts by default + wrapProgram $bin/bin/execlineb \ + --suffix PATH : $bin/bin ''; }