summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-02-10 13:51:50 +0100
committerProfpatsch <mail@profpatsch.de>2020-03-30 01:35:39 +0200
commitbf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9 (patch)
tree9bc044294c675900bb8cf3458c3831820a96952c
parent7329dfcc6348f09f540eb96c3f252ecbc33c7cdf (diff)
downloadnixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.tar
nixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.tar.gz
nixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.tar.bz2
nixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.tar.lz
nixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.tar.xz
nixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.tar.zst
nixpkgs-bf3bd5fee1d7d2faf761cceef9fb0d44dc329ff9.zip
skawarePackages: support static builds via pkgsStatic
Most of the skaware packages already build just fine with pkgsStatic,
however the wrapper scripts for execline and stdnotify-wrapper needed
the `-lskarlib` argument to go at the end.

`utmps` and `nsss` still fail with this error:

```
exec ./tools/install.sh -D -m 600 utmps-utmpd /bin/utmps-utmpd
/build/utmps-0.0.3.1/tools/install.sh: line 48: can't create /bin/utmps-utmpd.tmp.479: Permission denied
make: *** [Makefile:121: /bin/utmps-utmpd] Error 1
```
-rw-r--r--pkgs/build-support/skaware/build-skaware-package.nix3
-rw-r--r--pkgs/os-specific/linux/sdnotify-wrapper/default.nix6
-rw-r--r--pkgs/tools/misc/execline/default.nix12
3 files changed, 15 insertions, 6 deletions
diff --git a/pkgs/build-support/skaware/build-skaware-package.nix b/pkgs/build-support/skaware/build-skaware-package.nix
index ab5251ca1b5..e6e2e35789b 100644
--- a/pkgs/build-support/skaware/build-skaware-package.nix
+++ b/pkgs/build-support/skaware/build-skaware-package.nix
@@ -65,6 +65,9 @@ in stdenv.mkDerivation {
 
   configureFlags = configureFlags ++ [
     "--enable-absolute-paths"
+    # We assume every nix-based cross target has urandom.
+    # This might not hold for e.g. BSD.
+    "--with-sysdep-devurandom=yes"
     (if stdenv.isDarwin
       then "--disable-shared"
       else "--enable-shared")
diff --git a/pkgs/os-specific/linux/sdnotify-wrapper/default.nix b/pkgs/os-specific/linux/sdnotify-wrapper/default.nix
index 613a7fd51e6..cf09f047676 100644
--- a/pkgs/os-specific/linux/sdnotify-wrapper/default.nix
+++ b/pkgs/os-specific/linux/sdnotify-wrapper/default.nix
@@ -23,13 +23,13 @@ in runCommandCC "sdnotify-wrapper" {
   mkdir -p $bin/bin
   mkdir $out
 
-  # just dynamic for now
+  # the -lskarnet has to come at the end to support static builds
   $CC \
     -o $bin/bin/sdnotify-wrapper \
     -I${skalibs.dev}/include \
     -L${skalibs.lib}/lib \
-    -lskarnet \
-    ${src}
+    ${src} \
+    -lskarnet
 
   mkdir -p $doc/share/doc/sdnotify-wrapper
   # copy the documentation comment
diff --git a/pkgs/tools/misc/execline/default.nix b/pkgs/tools/misc/execline/default.nix
index d09537f5649..d3a6990a1f8 100644
--- a/pkgs/tools/misc/execline/default.nix
+++ b/pkgs/tools/misc/execline/default.nix
@@ -35,15 +35,21 @@ buildPackage {
     mv examples $doc/share/doc/execline/examples
 
     mv $bin/bin/execlineb $bin/bin/.execlineb-wrapped
-    cc \
+
+    # 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" \
-      -lskarnet \
       -o "$bin/bin/execlineb" \
-      ${./execlineb-wrapper.c}
+      ${./execlineb-wrapper.c} \
+      -lskarnet
   '';
 }