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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,70 @@
{ lib, stdenv, fetchFromGitHub, fuse3, macfuse-stubs, pkg-config, pcre }:
let
fuse = if stdenv.isDarwin then macfuse-stubs else fuse3;
in stdenv.mkDerivation rec {
pname = "tup";
version = "0.7.11";
outputs = [ "bin" "man" "out" ];
src = fetchFromGitHub {
owner = "gittup";
repo = "tup";
rev = "v${version}";
hash = "sha256-Q2Y5ErcfhLChi9Wezn8+7eNXYX2UXW1fBOqEclmgzOo=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ fuse pcre ];
patches = [ ./fusermount-setuid.patch ];
configurePhase = ''
substituteInPlace src/tup/link.sh --replace '`git describe' '`echo ${version}'
substituteInPlace Tuprules.tup --replace 'pcre-config' 'pkg-config libpcre'
'';
# Regular tup builds require fusermount to have suid, which nix cannot
# currently provide in a build environment, so we bootstrap and use 'tup
# generate' instead
buildPhase = ''
runHook preBuild
./build.sh
./build/tup init
./build/tup generate script.sh
./script.sh
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D tup -t $bin/bin/
install -D tup.1 -t $man/share/man/man1/
runHook postInstall
'';
setupHook = ./setup-hook.sh;
meta = with lib; {
description = "A fast, file-based build system";
longDescription = ''
Tup is a file-based build system for Linux, OSX, and Windows. It inputs a list
of file changes and a directed acyclic graph (DAG), then processes the DAG to
execute the appropriate commands required to update dependent files. Updates are
performed with very little overhead since tup implements powerful build
algorithms to avoid doing unnecessary work. This means you can stay focused on
your project rather than on your build system.
'';
homepage = "http://gittup.org/tup/";
license = licenses.gpl2;
maintainers = with maintainers; [ ehmry ];
platforms = platforms.unix;
# TODO: Remove once nixpkgs uses newer SDKs that supports '*at' functions.
# Probably MacOS SDK 10.13 or later. Check the current version in
# ../../../../os-specific/darwin/apple-sdk/default.nix
#
# https://github.com/gittup/tup/commit/3697c74
broken = stdenv.isDarwin;
};
}

View file

@ -0,0 +1,31 @@
# Tup needs a setuid fusermount which may be outside $PATH.
diff --git a/src/tup/server/fuse_server.c b/src/tup/server/fuse_server.c
index d4ab648d..2dc9294b 100644
--- a/src/tup/server/fuse_server.c
+++ b/src/tup/server/fuse_server.c
@@ -105,16 +105,21 @@ static void *fuse_thread(void *arg)
#if defined(__linux__)
static int os_unmount(void)
{
- int rc;
#ifdef FUSE3
- rc = system("fusermount3 -u -z " TUP_MNT);
+#define FUSERMOUNT "fusermount3"
#else
- rc = system("fusermount -u -z " TUP_MNT);
+#define FUSERMOUNT "fusermount"
#endif
+ int rc;
+ const char *cmd = (access("/run/wrappers/bin/" FUSERMOUNT, X_OK) == 0)
+ ? "/run/wrappers/bin/" FUSERMOUNT " -u -z " TUP_MNT
+ : FUSERMOUNT " -u -z " TUP_MNT;
+ rc = system(cmd);
if(rc == -1) {
perror("system");
}
return rc;
+#undef FUSERMOUNT
}
#elif defined(__APPLE__)
static int os_unmount(void)

View file

@ -0,0 +1,44 @@
#!/bin/sh
tupConfigurePhase() {
runHook preConfigure
echo -n CONFIG_TUP_ARCH= >> tup.config
case "$system" in
"i686-*") echo i386 >> tup.config;;
"x86_64-*") echo x86_64 >> tup.config;;
"powerpc-*") echo powerpc >> tup.config;;
"powerpc64-*") echo powerpc64 >> tup.config;;
"ia64-*") echo ia64 >> tup.config;;
"alpha-*") echo alpha >> tup.config;;
"sparc-*") echo sparc >> tup.config;;
"aarch64-*") echo arm64 >> tup.config;;
"arm*") echo arm >> tup.config;;
esac
echo "${tupConfig-}" >> tup.config
tup init
tup generate --verbose tupBuild.sh
runHook postConfigure
}
if [ -z "${dontUseTupConfigure-}" -a -z "${configurePhase-}" ]; then
configurePhase=tupConfigurePhase
fi
tupBuildPhase() {
runHook preBuild
pushd .
./tupBuild.sh
popd
runHook postBuild
}
if [ -z "${dontUseTupBuild-}" -a -z "${buildPhase-}" ]; then
buildPhase=tupBuildPhase
fi