bmake: 20240301 -> 20240520

- The first patch is now unneeded
- The second one needs an update
- Now Musl is working 100%... strange...
This commit is contained in:
Anderson Torres 2024-05-30 21:09:31 -03:00
parent e62df55210
commit 074c45769c
3 changed files with 63 additions and 68 deletions

View File

@ -1,10 +0,0 @@
--- bmake/make-bootstrap.sh.in.orig 2019-02-19 10:55:21.733606117 -0800
+++ bmake/make-bootstrap.sh.in 2019-02-19 10:56:02.150771541 -0800
@@ -4,6 +4,7 @@
srcdir=@srcdir@
+prefix="@prefix@"
DEFAULT_SYS_PATH="@default_sys_path@"
case "@use_meta@" in

View File

@ -1,17 +1,17 @@
diff -Naur bmake-old/boot-strap bmake-new/boot-strap
--- bmake-old/boot-strap 2023-06-27 18:02:19.000000000 -0300
+++ bmake-new/boot-strap 2023-07-23 22:31:02.334720661 -0300
@@ -413,9 +413,6 @@
--- bmake-old/boot-strap 2024-03-10 14:51:10.000000000 -0300
+++ bmake-new/boot-strap 2024-05-30 21:49:13.689803511 -0300
@@ -435,9 +435,6 @@
[ -s make-bootstrap.sh ] || op_configure
chmod 755 make-bootstrap.sh || exit 1
./make-bootstrap.sh || exit 1
- case "$op" in
- build) op_test;;
- build) rm -f tested; op_test;;
- esac
}
op_test() {
@@ -434,7 +431,6 @@
@@ -461,7 +458,6 @@
}
op_install() {

View File

@ -1,25 +1,24 @@
{ lib
, stdenv
, fetchurl
, getopt
, ksh
, bc
, tzdata
, pkgsMusl # for passthru.tests
{
lib,
bc,
fetchurl,
getopt,
ksh,
pkgsMusl,
stdenv,
tzdata,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "bmake";
version = "20240301";
version = "20240520";
src = fetchurl {
url = "http://www.crufty.net/ftp/pub/sjg/bmake-${finalAttrs.version}.tar.gz";
hash = "sha256-JM4L46z8i5PHWgeWxi7swWN246fAVXCzAtIEgOOOn1k=";
url = "https://www.crufty.net/ftp/pub/sjg/bmake-${finalAttrs.version}.tar.gz";
hash = "sha256-IhDM1FWwCN95Ufbb00e/zBg3xGRzAU5LjdX/MJGuKJQ=";
};
patches = [
# make bootstrap script aware of the prefix in /nix/store
./001-bootstrap-fix.diff
# decouple tests from build phase
./002-dont-test-while-installing.diff
# preserve PATH from build env in unit tests
@ -28,6 +27,43 @@ stdenv.mkDerivation (finalAttrs: {
./004-unconditional-ksh-test.diff
];
outputs = [ "out" "man" ];
nativeBuildInputs = [ getopt ];
nativeCheckInputs = [
bc
tzdata
] ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [
ksh
];
# The generated makefile is a small wrapper for calling ./boot-strap with a
# given op. On a case-insensitive filesystem this generated makefile clobbers
# a distinct, shipped Makefile and causes infinite recursion during tests
# which eventually fail with "fork: Resource temporarily unavailable"
configureFlags = [
"--without-makefile"
];
# Disabled tests:
# * directive-export{,-gmake}: another failure related to TZ variables
# * opt-chdir: ofborg complains about it somehow
# * opt-keep-going-indirect: not yet known
# * varmod-localtime: musl doesn't support TZDIR and this test relies on
# impure, implicit paths
env.BROKEN_TESTS = builtins.concatStringsSep " " [
"directive-export"
"directive-export-gmake"
"opt-chdir" # works on my machine -- AndersonTorres
"opt-keep-going-indirect"
"varmod-localtime"
];
strictDeps = true;
doCheck = true;
# 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)
@ -39,16 +75,6 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace unit-tests/opt-chdir.exp --replace "File name" "Filename"
'';
nativeBuildInputs = [ getopt ];
# The generated makefile is a small wrapper for calling ./boot-strap with a
# given op. On a case-insensitive filesystem this generated makefile clobbers
# a distinct, shipped, Makefile and causes infinite recursion during tests
# which eventually fail with "fork: Resource temporarily unavailable"
configureFlags = [
"--without-makefile"
];
buildPhase = ''
runHook preBuild
@ -65,29 +91,6 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
doCheck = true;
nativeCheckInputs = [
bc
tzdata
] ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [
ksh
];
# Disabled tests:
# directive-export{,-gmake}: another failure related to TZ variables
# opt-chdir: ofborg complains about it somehow
# opt-keep-going-indirect: not yet known
# varmod-localtime: musl doesn't support TZDIR and this test relies on impure,
# implicit paths
env.BROKEN_TESTS = builtins.concatStringsSep " " [
"directive-export"
"directive-export-gmake"
"opt-chdir" # works on my machine -- AndersonTorres
"opt-keep-going-indirect"
"varmod-localtime"
];
checkPhase = ''
runHook preCheck
@ -96,22 +99,24 @@ stdenv.mkDerivation (finalAttrs: {
runHook postCheck
'';
strictDeps = true;
setupHook = ./setup-hook.sh;
passthru.tests.bmakeMusl = pkgsMusl.bmake;
passthru = {
tests = {
bmakeMusl = pkgsMusl.bmake;
};
};
meta = {
homepage = "http://www.crufty.net/help/sjg/bmake.html";
homepage = "https://www.crufty.net/help/sjg/bmake.html";
description = "Portable version of NetBSD 'make'";
license = lib.licenses.bsd3;
mainProgram = "bmake";
maintainers = with lib.maintainers; [ thoughtpolice AndersonTorres ];
platforms = lib.platforms.unix;
# ofborg: x86_64-linux builds the musl package, aarch64-linux doesn't
broken = stdenv.hostPlatform.isMusl && stdenv.buildPlatform.isAarch64;
# requires strip
badPlatforms = [ lib.systems.inspect.platformPatterns.isStatic ];
};
})
# TODO: report the quirks and patches to bmake devteam (especially the Musl one)
# TODO: investigate Musl support
# TODO: investigate static support