Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c1e21ab5fd26
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2d28753c4c83
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 18, 2019

  1. Revert "skawarePackages.execline: wrap execlineb with tools"

    Using wrapProgram adds a call to `bash` around every call
    of `execline`, which clearly misses the basic idea behind
    `execline` in the first place …
    
    This reverts commit b64d25c.
    Profpatsch committed Oct 18, 2019
    Copy the full SHA
    bbcdd01 View commit details
  2. execline: provide tools to execlineb via execline wrapper

    Introduces the `execlineb-with-builtins` flag, which when
    true (default) will add all execline builtins to the PATH of
    `execlineb`.
    
    This is usually what users expect.
    
    If the flag is set to `false`, the unpatched execline derivation is
    returned instead.
    Profpatsch committed Oct 18, 2019
    Copy the full SHA
    2d28753 View commit details
Showing with 84 additions and 42 deletions.
  1. +0 −6 pkgs/build-support/skaware/build-skaware-package.nix
  2. +84 −36 pkgs/tools/misc/execline/default.nix
6 changes: 0 additions & 6 deletions pkgs/build-support/skaware/build-skaware-package.nix
Original file line number Diff line number Diff line change
@@ -19,10 +19,6 @@ 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 ? []

@@ -67,8 +63,6 @@ in stdenv.mkDerivation {
dontDisableStatic = true;
enableParallelBuilding = true;

nativeBuildInputs = setupHooks;

configureFlags = configureFlags ++ [
"--enable-absolute-paths"
(if stdenv.isDarwin
120 changes: 84 additions & 36 deletions pkgs/tools/misc/execline/default.nix
Original file line number Diff line number Diff line change
@@ -1,42 +1,90 @@
{ skawarePackages, makeWrapper }:
{ lib, skawarePackages
# for execlineb-with-builtins
, coreutils, gnugrep, writeScriptBin, runCommand
# Whether to wrap bin/execlineb to have the execline tools on its PATH.
, execlineb-with-builtins ? true
}:

with skawarePackages;

buildPackage {
pname = "execline";
version = "2.5.1.0";
sha256 = "0xr6yb50wm6amj1wc7jmxyv7hvlx2ypbnww1vc288j275625d9xi";
let
outputs = [ "bin" "lib" "dev" "doc" "out" ];

description = "A small scripting language, to be used in place of a shell in non-interactive scripts";
execline =
buildPackage {
pname = "execline";
version = "2.5.1.0";
sha256 = "0xr6yb50wm6amj1wc7jmxyv7hvlx2ypbnww1vc288j275625d9xi";

outputs = [ "bin" "lib" "dev" "doc" "out" ];
description = "A small scripting language, to be used in place of a shell in non-interactive scripts";

inherit outputs;

# TODO: nsss support
configureFlags = [
"--libdir=\${lib}/lib"
"--dynlibdir=\${lib}/lib"
"--bindir=\${bin}/bin"
"--includedir=\${dev}/include"
"--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
"--with-include=${skalibs.dev}/include"
"--with-lib=${skalibs.lib}/lib"
"--with-dynlib=${skalibs.lib}/lib"
];

postInstall = ''
# remove all execline executables from build directory
rm $(find -type f -mindepth 1 -maxdepth 1 -executable)
rm libexecline.*
mv doc $doc/share/doc/execline/html
mv examples $doc/share/doc/execline/examples
'';

};

# a wrapper around execlineb, which provides all execline
# tools on `execlineb`’s PATH.
execlineb-with-builtins-drv =
let eldir = "${execline}/bin";
in writeScriptBin "execlineb" ''
#!${eldir}/execlineb -s0
# appends the execlineb bin dir to PATH if not yet in PATH
${eldir}/define eldir ${eldir}
''${eldir}/ifelse
{
# since this is nix, we can grep for the execline drv hash in PATH
# to see whether it’s already in there
''${eldir}/pipeline
{ ${coreutils}/bin/printenv PATH }
${gnugrep}/bin/grep --quiet "${eldir}"
}
# it’s there already
{ ''${eldir}/execlineb $@ }
# not there yet, add it
''${eldir}/importas oldpath PATH
''${eldir}/export PATH "''${eldir}:''${oldpath}"
''${eldir}/execlineb $@
'';

# the original execline package, with bin/execlineb overwritten
execline-with-builtins = runCommand "my-execline"
(execline.drvAttrs // {
preferLocalBuild = true;
allowSubstitutes = false;
})
# copy every output and just overwrite the execlineb binary in $bin
''
${lib.concatMapStringsSep "\n"
(output: ''
cp -r ${execline.${output}} "''$${output}"
chmod --recursive +w "''$${output}"
'')
outputs}
install ${execlineb-with-builtins-drv}/bin/execlineb $bin/bin/execlineb
'';

setupHooks = [ makeWrapper ];

# TODO: nsss support
configureFlags = [
"--libdir=\${lib}/lib"
"--dynlibdir=\${lib}/lib"
"--bindir=\${bin}/bin"
"--includedir=\${dev}/include"
"--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
"--with-include=${skalibs.dev}/include"
"--with-lib=${skalibs.lib}/lib"
"--with-dynlib=${skalibs.lib}/lib"
];

postInstall = ''
# remove all execline executables from build directory
rm $(find -type f -mindepth 1 -maxdepth 1 -executable)
rm libexecline.*
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
'';

}
in
if execlineb-with-builtins
then execline-with-builtins
else execline