summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers/bmake
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/build-managers/bmake')
-rw-r--r--pkgs/development/tools/build-managers/bmake/default.nix24
-rw-r--r--pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch12
2 files changed, 31 insertions, 5 deletions
diff --git a/pkgs/development/tools/build-managers/bmake/default.nix b/pkgs/development/tools/build-managers/bmake/default.nix
index a93de053c44..0d8ca351096 100644
--- a/pkgs/development/tools/build-managers/bmake/default.nix
+++ b/pkgs/development/tools/build-managers/bmake/default.nix
@@ -1,21 +1,25 @@
 { lib, stdenv, fetchurl, fetchpatch
-, getopt, tzdata
+, getopt, tzdata, ksh
+, pkgsMusl # for passthru.tests
 }:
 
 stdenv.mkDerivation rec {
   pname = "bmake";
-  version = "20210420";
+  version = "20210621";
 
   src = fetchurl {
     url    = "http://www.crufty.net/ftp/pub/sjg/${pname}-${version}.tar.gz";
-    sha256 = "1ajq8v5rq3pl5y9h1hlscs83007fsyk3lhcp87z09ma370lm3ra7";
+    sha256 = "0gpzv75ibzqz1j1h0hdjgx1v7hkl3i5cb5yf6q9sfcgx0bvb55xa";
   };
 
   # Make tests work with musl
   # * Disable deptgt-delete_on_error test (alpine does this too)
+  # * Disable shell-ksh test (ksh doesn't compile with musl)
   # * Fix test failing due to different strerror(3) output for musl and glibc
   postPatch = lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
-    sed -i unit-tests/Makefile -e '/deptgt-delete_on_error/d'
+    sed -i unit-tests/Makefile \
+      -e '/deptgt-delete_on_error/d' \
+      -e '/shell-ksh/d'
     substituteInPlace unit-tests/opt-chdir.exp --replace "File name" "Filename"
   '';
 
@@ -28,6 +32,8 @@ stdenv.mkDerivation rec {
     ./fix-unexport-env-test.patch
     # Fix localtime tests without global /etc/zoneinfo directory
     ./fix-localtime-test.patch
+    # Always enable ksh test since it checks in a impure location /bin/ksh
+    ./unconditional-ksh-test.patch
     # decouple tests from build phase
     (fetchpatch {
       name = "separate-tests.patch";
@@ -68,7 +74,11 @@ stdenv.mkDerivation rec {
   '';
 
   doCheck = true;
-  checkInputs = [ tzdata ];
+  checkInputs = [
+    tzdata
+  ] ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [
+    ksh
+  ];
   checkPhase = ''
     runHook preCheck
 
@@ -79,6 +89,10 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
+  passthru.tests = {
+    bmakeMusl = pkgsMusl.bmake;
+  };
+
   meta = with lib; {
     description = "Portable version of NetBSD 'make'";
     homepage    = "http://www.crufty.net/help/sjg/bmake.html";
diff --git a/pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch b/pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch
new file mode 100644
index 00000000000..117b85da16d
--- /dev/null
+++ b/pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch
@@ -0,0 +1,12 @@
+--- bmake/unit-tests/Makefile.orig	2021-07-04 19:13:09.068094922 +0200
++++ bmake/unit-tests/Makefile	2021-07-04 19:13:14.630080696 +0200
+@@ -295,9 +295,7 @@
+ TESTS+=		sh-single-line
+ TESTS+=		shell-csh
+ TESTS+=		shell-custom
+-.if exists(/bin/ksh)
+ TESTS+=		shell-ksh
+-.endif
+ TESTS+=		shell-sh
+ TESTS+=		suff-add-later
+ TESTS+=		suff-clear-regular