Merge pull request #125071 from sternenseemann/bmake

bmake: 20200902 -> 20210420

authored by Jörg Thalheim and committed by GitHub 4542b54a 8265aa91

+68 -11
+38 -4
pkgs/development/tools/build-managers/bmake/default.nix
··· 1 - { lib, stdenv, fetchurl 2 - , getopt 3 }: 4 5 stdenv.mkDerivation rec { 6 pname = "bmake"; 7 - version = "20200902"; 8 9 src = fetchurl { 10 url = "http://www.crufty.net/ftp/pub/sjg/${pname}-${version}.tar.gz"; 11 - sha256 = "1v1v81llsiy8qbpy38nml1x08dhrihwh040pqgwbwb9zy1108b08"; 12 }; 13 14 nativeBuildInputs = [ getopt ]; 15 16 patches = [ 17 ./bootstrap-fix.patch 18 ./fix-unexport-env-test.patch 19 ]; 20 21 # The generated makefile is a small wrapper for calling ./boot-strap ··· 41 ./boot-strap --prefix=$out -o . op=install 42 43 runHook postInstall 44 ''; 45 46 setupHook = ./setup-hook.sh;
··· 1 + { lib, stdenv, fetchurl, fetchpatch 2 + , getopt, tzdata 3 }: 4 5 stdenv.mkDerivation rec { 6 pname = "bmake"; 7 + version = "20210420"; 8 9 src = fetchurl { 10 url = "http://www.crufty.net/ftp/pub/sjg/${pname}-${version}.tar.gz"; 11 + sha256 = "1ajq8v5rq3pl5y9h1hlscs83007fsyk3lhcp87z09ma370lm3ra7"; 12 }; 13 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 + 22 nativeBuildInputs = [ getopt ]; 23 24 patches = [ 25 + # make bootstrap script aware of the prefix in /nix/store 26 ./bootstrap-fix.patch 27 + # preserve PATH from build env in unit tests 28 ./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 + }) 43 ]; 44 45 # The generated makefile is a small wrapper for calling ./boot-strap ··· 65 ./boot-strap --prefix=$out -o . op=install 66 67 runHook postInstall 68 + ''; 69 + 70 + doCheck = true; 71 + checkInputs = [ tzdata ]; 72 + checkPhase = '' 73 + runHook preCheck 74 + 75 + ./boot-strap -o . op=test 76 + 77 + runHook postCheck 78 ''; 79 80 setupHook = ./setup-hook.sh;
+23
pkgs/development/tools/build-managers/bmake/fix-localtime-test.patch
···
··· 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 +
+7 -7
pkgs/development/tools/build-managers/bmake/fix-unexport-env-test.patch
··· 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 5 .include "export.mk" 6 7 -# an example of setting up a minimal environment. 8 - -PATH = /bin:/usr/bin:/sbin:/usr/sbin 9 +# preserve PATH so commands used in the "all" target are still available 10 - +PATH := ${PATH} 11 12 # now clobber the environment to just PATH and UT_TEST 13 - UT_TEST = unexport-env
··· 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_ 5 .include "export.mk" 6 7 -# an example of setting up a minimal environment. 8 + -PATH= /bin:/usr/bin:/sbin:/usr/sbin 9 +# preserve PATH so commands used in the "all" target are still available 10 + +PATH := ${PATH} 11 12 # now clobber the environment to just PATH and UT_TEST 13 + UT_TEST= unexport-env