uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
--- 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
|
||||
113
pkgs/development/tools/build-managers/bmake/default.nix
Normal file
113
pkgs/development/tools/build-managers/bmake/default.nix
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, getopt
|
||||
, tzdata
|
||||
, ksh
|
||||
, pkgsMusl # for passthru.tests
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "bmake";
|
||||
version = "20220208";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.crufty.net/ftp/pub/sjg/${pname}-${version}.tar.gz";
|
||||
hash = "sha256-ewDB4UYrLh5Upk2ND88n/HfursPxOSDv+NlST/BZ1to=";
|
||||
};
|
||||
|
||||
# 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' \
|
||||
-e '/shell-ksh/d'
|
||||
substituteInPlace unit-tests/opt-chdir.exp --replace "File name" "Filename"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ getopt ];
|
||||
|
||||
patches = [
|
||||
# make bootstrap script aware of the prefix in /nix/store
|
||||
./bootstrap-fix.patch
|
||||
# preserve PATH from build env in unit tests
|
||||
./fix-unexport-env-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";
|
||||
url = "https://raw.githubusercontent.com/alpinelinux/aports/2a36f7b79df44136c4d2b8e9512f908af65adfee/community/bmake/separate-tests.patch";
|
||||
sha256 = "00s76jwyr83c6rkvq67b1lxs8jhm0gj2rjgy77xazqr5400slj9a";
|
||||
})
|
||||
# add a shebang to bmake's install(1) replacement
|
||||
(fetchpatch {
|
||||
name = "install-sh.patch";
|
||||
url = "https://raw.githubusercontent.com/alpinelinux/aports/34cd8c45397c63c041cf3cbe1ba5232fd9331196/community/bmake/install-sh.patch";
|
||||
sha256 = "0z8icd6akb96r4cksqnhynkn591vbxlmrrs4w6wil3r6ggk6mwa6";
|
||||
})
|
||||
];
|
||||
|
||||
# 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:
|
||||
# varmod-localtime: musl doesn't support TZDIR and this test relies on impure,
|
||||
# implicit paths
|
||||
# opt-chdir: ofborg complains about it somehow
|
||||
BROKEN_TESTS = "varmod-localtime opt-chdir";
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
./boot-strap --prefix=$out -o . op=build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
./boot-strap --prefix=$out -o . op=install
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkInputs = [
|
||||
tzdata
|
||||
] ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [
|
||||
ksh
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
./boot-strap -o . op=test
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "http://www.crufty.net/help/sjg/bmake.html";
|
||||
description = "Portable version of NetBSD 'make'";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ thoughtpolice AndersonTorres ];
|
||||
platforms = platforms.unix;
|
||||
broken = stdenv.isAarch64; # ofborg complains
|
||||
};
|
||||
|
||||
passthru.tests.bmakeMusl = pkgsMusl.bmake;
|
||||
}
|
||||
# TODO: report the quirks and patches to bmake devteam (especially the Musl one)
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
--- bmake/unit-tests/Makefile.orig 2021-05-30 14:24:38.822484317 +0200
|
||||
+++ bmake/unit-tests/Makefile 2021-05-31 13:25:21.645751428 +0200
|
||||
@@ -455,7 +455,8 @@
|
||||
ENV.varmisc= FROM_ENV=env
|
||||
ENV.varmisc+= FROM_ENV_BEFORE=env
|
||||
ENV.varmisc+= FROM_ENV_AFTER=env
|
||||
-ENV.varmod-localtime+= TZ=Europe/Berlin
|
||||
+# Set absolute path to tz file since musl doesn't support TZDIR
|
||||
+ENV.varmod-localtime+= TZDIR=${TZDIR} TZ=:${TZDIR}/Europe/Berlin
|
||||
ENV.varname-vpath+= VPATH=varname-vpath.dir:varname-vpath.dir2
|
||||
|
||||
# Override make flags for some of the tests; default is -k.
|
||||
--- bmake/unit-tests/varmod-localtime.mk.orig 2021-05-30 14:30:34.397986246 +0200
|
||||
+++ bmake/unit-tests/varmod-localtime.mk 2021-05-31 13:24:41.430906606 +0200
|
||||
@@ -3,7 +3,7 @@
|
||||
# Tests for the :localtime variable modifier, which formats a timestamp
|
||||
# using strftime(3) in local time.
|
||||
|
||||
-.if ${TZ} != "Europe/Berlin" # see unit-tests/Makefile
|
||||
+.if ${TZ} != ":${TZDIR}/Europe/Berlin" # see unit-tests/Makefile
|
||||
. error
|
||||
.endif
|
||||
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
--- bmake/unit-tests/unexport-env.mk.orig 2021-05-27 14:44:45.263392298 +0200
|
||||
+++ bmake/unit-tests/unexport-env.mk 2021-05-27 14:46:46.188881996 +0200
|
||||
@@ -4,8 +4,8 @@
|
||||
FILTER_CMD= grep ^UT_
|
||||
.include "export.mk"
|
||||
|
||||
-# an example of setting up a minimal environment.
|
||||
-PATH= /bin:/usr/bin:/sbin:/usr/sbin
|
||||
+# preserve PATH so commands used in the "all" target are still available
|
||||
+PATH := ${PATH}
|
||||
|
||||
# now clobber the environment to just PATH and UT_TEST
|
||||
UT_TEST= unexport-env
|
||||
127
pkgs/development/tools/build-managers/bmake/setup-hook.sh
Normal file
127
pkgs/development/tools/build-managers/bmake/setup-hook.sh
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
addMakeFlags() {
|
||||
export prefix="$out"
|
||||
export MANDIR="${!outputMan}/share/man"
|
||||
export MANTARGET=man
|
||||
export BINOWN=
|
||||
export STRIP_FLAG=
|
||||
}
|
||||
|
||||
preConfigureHooks+=(addMakeFlags)
|
||||
|
||||
bmakeBuildPhase() {
|
||||
runHook preBuild
|
||||
|
||||
local flagsArray=(
|
||||
${enableParallelBuilding:+-j${NIX_BUILD_CORES}}
|
||||
SHELL=$SHELL
|
||||
$makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
|
||||
$buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"}
|
||||
)
|
||||
|
||||
echoCmd 'build flags' "${flagsArray[@]}"
|
||||
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||
unset flagsArray
|
||||
|
||||
runHook postBuild
|
||||
}
|
||||
|
||||
if [ -z "${dontUseBmakeBuild-}" -a -z "${buildPhase-}" ]; then
|
||||
buildPhase=bmakeBuildPhase
|
||||
fi
|
||||
|
||||
bmakeCheckPhase() {
|
||||
runHook preCheck
|
||||
|
||||
if [ -z "${checkTarget:-}" ]; then
|
||||
#TODO(@oxij): should flagsArray influence make -n?
|
||||
if bmake -n ${makefile:+-f $makefile} check >/dev/null 2>&1; then
|
||||
checkTarget=check
|
||||
elif bmake -n ${makefile:+-f $makefile} test >/dev/null 2>&1; then
|
||||
checkTarget=test
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${checkTarget:-}" ]; then
|
||||
echo "no test target found in bmake, doing nothing"
|
||||
else
|
||||
# shellcheck disable=SC2086
|
||||
local flagsArray=(
|
||||
${enableParallelChecking:+-j${NIX_BUILD_CORES}}
|
||||
SHELL=$SHELL
|
||||
# Old bash empty array hack
|
||||
$makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
|
||||
${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"}
|
||||
${checkTarget}
|
||||
)
|
||||
|
||||
echoCmd 'check flags' "${flagsArray[@]}"
|
||||
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||
|
||||
unset flagsArray
|
||||
fi
|
||||
|
||||
runHook postCheck
|
||||
}
|
||||
|
||||
if [ -z "${dontUseBmakeCheck-}" -a -z "${checkPhase-}" ]; then
|
||||
checkPhase=bmakeCheckPhase
|
||||
fi
|
||||
|
||||
bmakeInstallPhase() {
|
||||
runHook preInstall
|
||||
|
||||
if [ -n "$prefix" ]; then
|
||||
mkdir -p "$prefix"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
local flagsArray=(
|
||||
SHELL=$SHELL
|
||||
# Old bash empty array hack
|
||||
$makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
|
||||
$installFlags ${installFlagsArray+"${installFlagsArray[@]}"}
|
||||
${installTargets:-install}
|
||||
)
|
||||
|
||||
echoCmd 'install flags' "${flagsArray[@]}"
|
||||
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||
unset flagsArray
|
||||
|
||||
runHook postInstall
|
||||
}
|
||||
|
||||
if [ -z "${dontUseBmakeInstall-}" -a -z "${installPhase-}" ]; then
|
||||
installPhase=bmakeInstallPhase
|
||||
fi
|
||||
|
||||
bmakeDistPhase() {
|
||||
runHook preDist
|
||||
|
||||
if [ -n "$prefix" ]; then
|
||||
mkdir -p "$prefix"
|
||||
fi
|
||||
|
||||
# Old bash empty array hack
|
||||
# shellcheck disable=SC2086
|
||||
local flagsArray=(
|
||||
$distFlags ${distFlagsArray+"${distFlagsArray[@]}"} ${distTarget:-dist}
|
||||
)
|
||||
|
||||
echo 'dist flags: %q' "${flagsArray[@]}"
|
||||
bmake ${makefile:+-f $makefile} "${flagsArray[@]}"
|
||||
|
||||
if [ "${dontCopyDist:-0}" != 1 ]; then
|
||||
mkdir -p "$out/tarballs"
|
||||
|
||||
# Note: don't quote $tarballs, since we explicitly permit
|
||||
# wildcards in there.
|
||||
# shellcheck disable=SC2086
|
||||
cp -pvd ${tarballs:-*.tar.gz} "$out/tarballs"
|
||||
fi
|
||||
|
||||
runHook postDist
|
||||
}
|
||||
|
||||
if [ -z "${dontUseBmakeDist-}" -a -z "${distPhase-}" ]; then
|
||||
distPhase=bmakeDistPhase
|
||||
fi
|
||||
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue