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,13 @@
{ callPackage, fetchurl, ... } @ args:
callPackage ./generic.nix (args // rec {
release = "8.5";
version = "${release}.18";
# Note: when updating, the hash in pkgs/development/libraries/tk/8.5.nix must also be updated!
src = fetchurl {
url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
sha256 = "1jfkqp2fr0xh6xvaqx134hkfa5kh7agaqbxm6lhjbpvvc1xfaaq3";
};
})

View file

@ -0,0 +1,13 @@
{ callPackage, fetchurl, ... } @ args:
callPackage ./generic.nix (args // rec {
release = "8.6";
version = "${release}.11";
# Note: when updating, the hash in pkgs/development/libraries/tk/8.6.nix must also be updated!
src = fetchurl {
url = "mirror://sourceforge/tcl/tcl${version}-src.tar.gz";
sha256 = "0n4211j80mxr6ql0xx52rig8r885rcbminfpjdb2qrw6hmk8c14c";
};
})

View file

@ -0,0 +1,67 @@
{ lib, stdenv, callPackage, makeSetupHook
# Version specific stuff
, release, version, src
, ...
}:
let
baseInterp =
stdenv.mkDerivation {
pname = "tcl";
inherit version src;
outputs = [ "out" "man" ];
setOutputFlags = false;
preConfigure = ''
cd unix
'';
configureFlags = [
"--enable-threads"
# Note: using $out instead of $man to prevent a runtime dependency on $man.
"--mandir=${placeholder "out"}/share/man"
"--enable-man-symlinks"
# Don't install tzdata because NixOS already has a more up-to-date copy.
"--with-tzdata=no"
"tcl_cv_strtod_unbroken=ok"
] ++ lib.optional stdenv.is64bit "--enable-64bit";
enableParallelBuilding = true;
postInstall = let
dllExtension = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
make install-private-headers
ln -s $out/bin/tclsh${release} $out/bin/tclsh
ln -s $out/lib/libtcl${release}${dllExtension} $out/lib/libtcl${dllExtension}
'';
meta = with lib; {
description = "The Tcl scripting language";
homepage = "https://www.tcl.tk/";
license = licenses.tcltk;
platforms = platforms.all;
maintainers = with maintainers; [ agbrooks ];
};
passthru = rec {
inherit release version;
libPrefix = "tcl${release}";
libdir = "lib/${libPrefix}";
tclPackageHook = callPackage ({ buildPackages }: makeSetupHook {
name = "tcl-package-hook";
deps = [ buildPackages.makeWrapper ];
} ./tcl-package-hook.sh) {};
};
};
mkTclDerivation = callPackage ./mk-tcl-derivation.nix { tcl = baseInterp; };
in baseInterp.overrideAttrs (self: {
passthru = self.passthru // {
inherit mkTclDerivation;
};
})

View file

@ -0,0 +1,69 @@
# Generic builder for tcl packages/applications, generally based on mk-python-derivation.nix
{ tcl
, lib
, makeWrapper
, runCommand
, writeScript
}:
{ buildInputs ? []
, nativeBuildInputs ? []
, propagatedBuildInputs ? []
, checkInputs ? []
# true if we should skip the configuration phase altogether
, dontConfigure ? false
# Extra flags passed to configure step
, configureFlags ? []
# Whether or not we should add common Tcl-related configure flags
, addTclConfigureFlags ? true
, meta ? {}
, passthru ? {}
, doCheck ? true
, ... } @ attrs:
let
inherit (tcl) stdenv;
inherit (lib) getBin optionalAttrs optionals;
defaultTclPkgConfigureFlags = [
"--with-tcl=${tcl}/lib"
"--with-tclinclude=${tcl}/include"
"--exec-prefix=${placeholder "out"}"
];
self = (stdenv.mkDerivation ((builtins.removeAttrs attrs [
"addTclConfigureFlags" "checkPhase" "checkInputs" "doCheck"
]) // {
buildInputs = buildInputs ++ [ tcl.tclPackageHook ];
nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper tcl ];
propagatedBuildInputs = propagatedBuildInputs ++ [ tcl ];
TCLSH = "${getBin tcl}/bin/tclsh";
# Run tests after install, at which point we've done all TCLLIBPATH setup
doCheck = false;
doInstallCheck = attrs.doCheck or ((attrs ? doInstallCheck) && attrs.doInstallCheck);
installCheckInputs = checkInputs ++ (optionals (attrs ? installCheckInputs) attrs.installCheckInputs);
# Add typical values expected by TEA for configureFlags
configureFlags =
if (!dontConfigure && addTclConfigureFlags)
then (configureFlags ++ defaultTclPkgConfigureFlags)
else configureFlags;
meta = {
platforms = tcl.meta.platforms;
} // meta;
} // optionalAttrs (attrs?checkPhase) {
installCheckPhase = attrs.checkPhase;
}
));
in lib.extendDerivation true passthru self

View file

@ -0,0 +1,78 @@
# This hook ensures that we do the following in post-fixup:
# * wrap any installed executables with a wrapper that configures TCLLIBPATH
# * write a setup hook that extends the TCLLIBPATH of any anti-dependencies
tclWrapperArgs=( ${tclWrapperArgs-} )
# Add a directory to TCLLIBPATH, provided that it exists
_addToTclLibPath() {
local tclPkg="$1"
if [[ -z "$tclPkg" ]]; then
return
fi
if [[ ! -d "$tclPkg" ]]; then
>&2 echo "can't add $tclPkg to TCLLIBPATH; that directory doesn't exist"
exit 1
fi
if [[ "$tclPkg" == *" "* ]]; then
tclPkg="{$tclPkg}"
fi
if [[ -z "${TCLLIBPATH-}" ]]; then
export TCLLIBPATH="$tclPkg"
else
if [[ "$TCLLIBPATH" != *"$tclPkg "* && "$TCLLIBPATH" != *"$tclPkg" ]]; then
export TCLLIBPATH="${TCLLIBPATH} $tclPkg"
fi
fi
}
# Locate any directory containing an installed pkgIndex file
findInstalledTclPkgs() {
local -r newLibDir="${!outputLib}/lib"
if [[ ! -d "$newLibDir" ]]; then
>&2 echo "Assuming no loadable tcl packages installed ($newLibDir does not exist)"
return
fi
echo "$(find "$newLibDir" -name pkgIndex.tcl -exec dirname {} \;)"
}
# Wrap any freshly-installed binaries and set up their TCLLIBPATH
wrapTclBins() {
if [[ -z "${TCLLIBPATH-}" ]]; then
echo "skipping automatic Tcl binary wrapping (nothing to do)"
return
fi
local -r tclBinsDir="${!outputBin}/bin"
if [[ ! -d "$tclBinsDir" ]]; then
echo "No outputBin found, not using any TCLLIBPATH wrapper"
return
fi
tclWrapperArgs+=(--prefix TCLLIBPATH ' ' "$TCLLIBPATH")
find "$tclBinsDir" -type f -executable -print |
while read -r someBin; do
echo "Adding TCLLIBPATH wrapper for $someBin"
wrapProgram "$someBin" "${tclWrapperArgs[@]}"
done
}
# Generate hook to adjust TCLLIBPATH in anti-dependencies
writeTclLibPathHook() {
local -r hookPath="${!outputLib}/nix-support/setup-hook"
mkdir -p "$(dirname "$hookPath")"
typeset -f _addToTclLibPath >> "$hookPath"
local -r tclPkgs=$(findInstalledTclPkgs)
while IFS= read -r tclPkg; do
echo "_addToTclLibPath \"$tclPkg\"" >> "$hookPath"
_addToTclLibPath "$tclPkg" true
done <<< "$tclPkgs"
}
postFixupHooks+=(writeTclLibPathHook)
postFixupHooks+=(wrapTclBins)