mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
execline: add passthru.writeScript
This commit is contained in:
committed by
Emery Hemingway
parent
d5815754db
commit
ad7e3ecf88
@@ -2,11 +2,12 @@
|
||||
lib,
|
||||
skawarePackages,
|
||||
skalibs,
|
||||
execline,
|
||||
writeTextFile,
|
||||
}:
|
||||
|
||||
let
|
||||
version = "2.9.6.1";
|
||||
|
||||
in
|
||||
skawarePackages.buildPackage {
|
||||
inherit version;
|
||||
@@ -75,4 +76,24 @@ skawarePackages.buildPackage {
|
||||
${./execlineb-wrapper.c} \
|
||||
-lskarnet
|
||||
'';
|
||||
|
||||
# Write an execline script.
|
||||
# Documented in ../../../../doc/build-helpers/trivial-build-helpers.chapter.md
|
||||
passthru.writeScript =
|
||||
name: options: script:
|
||||
writeTextFile {
|
||||
inherit name;
|
||||
text = ''
|
||||
#!${execline}/bin/execlineb ${toString options}
|
||||
${script}
|
||||
'';
|
||||
|
||||
executable = true;
|
||||
derivationArgs.nativeBuildInputs = [ execline ];
|
||||
checkPhase = ''
|
||||
echo redirfd -w 1 /dev/null echo >test.el
|
||||
cat <$target >>test.el
|
||||
execlineb -W test.el
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user