mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 14:11:36 +00:00
a3698d9f36
Hello, execline-2.6.1.0 is out. This version features a more expressive format for the envfile binary. Most of the files that are suitable for a systemd EnvironmentFile= directive are now parsable with envfile: double quotes are supported, backslashed newlines are supported, a few C escape sequences are supported (including octal and hexadecimal). So it is now possible to read most existing /etc/default configuration files without spawning a shell. Additionally, envfile now comes with a -I option that makes it ignore a nonexistent file, instead of failing. git://git.skarnet.org/execline https://skarnet.org/software/execline/ Enjoy, Bug-reports welcome.
56 lines
1.6 KiB
Nix
56 lines
1.6 KiB
Nix
{ lib, skawarePackages
|
||
# for execlineb-with-builtins
|
||
, coreutils, gnugrep, writeScriptBin, runCommand, runCommandCC
|
||
}:
|
||
|
||
with skawarePackages;
|
||
|
||
buildPackage {
|
||
pname = "execline";
|
||
version = "2.6.1.0";
|
||
sha256 = "0mj565xml3hvw27finydms0s9abbbpgbr29vnr8gwi7zjzq7ck52";
|
||
|
||
description = "A small scripting language, to be used in place of a shell in non-interactive scripts";
|
||
|
||
outputs = [ "bin" "lib" "dev" "doc" "out" ];
|
||
|
||
# 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
|
||
|
||
mv $bin/bin/execlineb $bin/bin/.execlineb-wrapped
|
||
|
||
# A wrapper around execlineb, which provides all execline
|
||
# tools on `execlineb`’s PATH.
|
||
# It is implemented as a C script, because on non-Linux,
|
||
# nested shebang lines are not supported.
|
||
# The -lskarnet has to come at the end to support static builds.
|
||
$CC \
|
||
-O \
|
||
-Wall -Wpedantic \
|
||
-D "EXECLINEB_PATH()=\"$bin/bin/.execlineb-wrapped\"" \
|
||
-D "EXECLINE_BIN_PATH()=\"$bin/bin\"" \
|
||
-I "${skalibs.dev}/include" \
|
||
-L "${skalibs.lib}/lib" \
|
||
-o "$bin/bin/execlineb" \
|
||
${./execlineb-wrapper.c} \
|
||
-lskarnet
|
||
'';
|
||
}
|