about summary refs log tree commit diff
path: root/pkgs/profpatsch/execline/default.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-06-28 15:14:04 +0200
committerProfpatsch <mail@profpatsch.de>2020-06-28 15:14:04 +0200
commit3f79ddf06375c3b34569c8b9ce91a607bbd0f052 (patch)
treec4e7515cb141cd9bce86df7e113056000af8f60d /pkgs/profpatsch/execline/default.nix
parent13ad936f8432d2fe46169716ddf5eb7d4f84f202 (diff)
pkgs/profpatsch/execline: add el_exec and el_substitute
el_exec: wraps the various execve wrappers in skalib that are useful
for writing execline-like utils. currently only `xpathexec0` is
supported, which execs into the argv you give it or errors with the
right error if file not found.

el_substitute: execline argv substitution! Wraps the execline
function, so it will behave exactly the same as the existing execline
utils, like `importas`.
Diffstat (limited to 'pkgs/profpatsch/execline/default.nix')
-rw-r--r--pkgs/profpatsch/execline/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/profpatsch/execline/default.nix b/pkgs/profpatsch/execline/default.nix
new file mode 100644
index 00000000..317ca97d
--- /dev/null
+++ b/pkgs/profpatsch/execline/default.nix
@@ -0,0 +1,34 @@
+{ pkgs, writeRustSimpleLib, rust-deps }:
+
+let
+  el-semicolon-common = tests: writeRustSimpleLib "el_semicolon" {
+    buildTests = tests;
+    release = false;
+    verbose = true;
+  } ./el_semicolon.rs;
+
+  el-semicolon-tests = el-semicolon-common true;
+  el-semicolon = el-semicolon-common false;
+
+  el-exec = writeRustSimpleLib "el_exec" {
+    dependencies = [ rust-deps.libc ];
+    buildInputs = [ pkgs.skalibs ];
+    release = false;
+    verbose = true;
+  } ./el_exec.rs;
+
+  el-substitute = writeRustSimpleLib "el_substitute" {
+    dependencies = [ rust-deps.libc rust-deps.errno ];
+    buildInputs = [ pkgs.skalibs ];
+    release = false;
+    verbose = true;
+  } ./el_substitute.rs;
+
+in {
+  inherit
+    el-semicolon
+    el-semicolon-tests
+    el-exec
+    el-substitute
+    ;
+}