git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #125071 from sternenseemann/bmake

bmake: 20200902 -> 20210420

commit4542b54abd6ca91b1817294cfb67ccccdb72d3df authorJörg Thalheim <Mic92@users.noreply.github.com> dateTue 1 Jun 2021, 08:11 (5 years ago) parent8265aa910f8f08
3 files changed+68−11
pkgs/development/tools/build-managers/bmake/default.nix+38−4 pkgs/development/tools/build-managers/bmake/fix-localtime-test.patch+23 pkgs/development/tools/build-managers/bmake/fix-unexport-env-test.patch+7−7
pkgs/development/tools/build-managers/bmake/default.nix+38−4
@@ -1,21 +1,45 @@
1−{ lib, stdenv, fetchurl
2−, getopt
1+{ lib, stdenv, fetchurl, fetchpatch
2+, getopt, tzdata
33}:
44
55stdenv.mkDerivation rec {
66 pname = "bmake";
7− version = "20200902";
7+ version = "20210420";
88
99 src = fetchurl {
1010 url = "http://www.crufty.net/ftp/pub/sjg/${pname}-${version}.tar.gz";
11− sha256 = "1v1v81llsiy8qbpy38nml1x08dhrihwh040pqgwbwb9zy1108b08";
11+ sha256 = "1ajq8v5rq3pl5y9h1hlscs83007fsyk3lhcp87z09ma370lm3ra7";
1212 };
1313
14+ # Make tests work with musl
15+ # * Disable deptgt-delete_on_error test (alpine does this too)
16+ # * Fix test failing due to different strerror(3) output for musl and glibc
17+ postPatch = lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
18+ sed -i unit-tests/Makefile -e '/deptgt-delete_on_error/d'
19+ substituteInPlace unit-tests/opt-chdir.exp --replace "File name" "Filename"
20+ '';
21+
1422 nativeBuildInputs = [ getopt ];
1523
1624 patches = [
25+ # make bootstrap script aware of the prefix in /nix/store
1726 ./bootstrap-fix.patch
27+ # preserve PATH from build env in unit tests
1828 ./fix-unexport-env-test.patch
29+ # Fix localtime tests without global /etc/zoneinfo directory
30+ ./fix-localtime-test.patch
31+ # decouple tests from build phase
32+ (fetchpatch {
33+ name = "separate-tests.patch";
34+ url = "https://raw.githubusercontent.com/alpinelinux/aports/2a36f7b79df44136c4d2b8e9512f908af65adfee/community/bmake/separate-tests.patch";
35+ sha256 = "00s76jwyr83c6rkvq67b1lxs8jhm0gj2rjgy77xazqr5400slj9a";
36+ })
37+ # add a shebang to bmake's install(1) replacement
38+ (fetchpatch {
39+ name = "install-sh.patch";
40+ url = "https://raw.githubusercontent.com/alpinelinux/aports/34cd8c45397c63c041cf3cbe1ba5232fd9331196/community/bmake/install-sh.patch";
41+ sha256 = "0z8icd6akb96r4cksqnhynkn591vbxlmrrs4w6wil3r6ggk6mwa6";
42+ })
1943 ];
2044
2145 # The generated makefile is a small wrapper for calling ./boot-strap
@@ -43,6 +67,16 @@ stdenv.mkDerivation rec {
4367 runHook postInstall
4468 '';
4569
70+ doCheck = true;
71+ checkInputs = [ tzdata ];
72+ checkPhase = ''
73+ runHook preCheck
74+
75+ ./boot-strap -o . op=test
76+
77+ runHook postCheck
78+ '';
79+
4680 setupHook = ./setup-hook.sh;
4781
4882 meta = with lib; {
pkgs/development/tools/build-managers/bmake/fix-localtime-test.patchnew file+23
@@ -0,0 +1,23 @@
1+--- bmake/unit-tests/Makefile.orig 2021-05-30 14:24:38.822484317 +0200
2++++ bmake/unit-tests/Makefile 2021-05-31 13:25:21.645751428 +0200
3+@@ -455,7 +455,8 @@
4+ ENV.varmisc= FROM_ENV=env
5+ ENV.varmisc+= FROM_ENV_BEFORE=env
6+ ENV.varmisc+= FROM_ENV_AFTER=env
7+-ENV.varmod-localtime+= TZ=Europe/Berlin
8++# Set absolute path to tz file since musl doesn't support TZDIR
9++ENV.varmod-localtime+= TZDIR=${TZDIR} TZ=:${TZDIR}/Europe/Berlin
10+ ENV.varname-vpath+= VPATH=varname-vpath.dir:varname-vpath.dir2
11+
12+ # Override make flags for some of the tests; default is -k.
13+--- bmake/unit-tests/varmod-localtime.mk.orig 2021-05-30 14:30:34.397986246 +0200
14++++ bmake/unit-tests/varmod-localtime.mk 2021-05-31 13:24:41.430906606 +0200
15+@@ -3,7 +3,7 @@
16+ # Tests for the :localtime variable modifier, which formats a timestamp
17+ # using strftime(3) in local time.
18+
19+-.if ${TZ} != "Europe/Berlin" # see unit-tests/Makefile
20++.if ${TZ} != ":${TZDIR}/Europe/Berlin" # see unit-tests/Makefile
21+ . error
22+ .endif
23+
pkgs/development/tools/build-managers/bmake/fix-unexport-env-test.patch+7−7
@@ -1,13 +1,13 @@
1−--- bmake/unit-tests/unexport-env.mk.orig 2019-02-19 10:24:14.356713136 -0800
2−+++ bmake/unit-tests/unexport-env.mk 2019-02-19 10:25:43.838775388 -0800
3−@@ -3,8 +3,8 @@
4− # pick up a bunch of exported vars
1+--- bmake/unit-tests/unexport-env.mk.orig 2021-05-27 14:44:45.263392298 +0200
2++++ bmake/unit-tests/unexport-env.mk 2021-05-27 14:46:46.188881996 +0200
3+@@ -4,8 +4,8 @@
4+ FILTER_CMD= grep ^UT_
55 .include "export.mk"
66
77-# an example of setting up a minimal environment.
8−-PATH = /bin:/usr/bin:/sbin:/usr/sbin
8+-PATH= /bin:/usr/bin:/sbin:/usr/sbin
99+# preserve PATH so commands used in the "all" target are still available
10−+PATH := ${PATH}
10++PATH := ${PATH}
1111
1212 # now clobber the environment to just PATH and UT_TEST
13− UT_TEST = unexport-env
13+ UT_TEST= unexport-env