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
54
pkgs/development/tools/build-managers/scons/common.nix
Normal file
54
pkgs/development/tools/build-managers/scons/common.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ version, sha256 }:
|
||||
|
||||
{ fetchurl, python, lib }:
|
||||
|
||||
python.pkgs.buildPythonApplication rec {
|
||||
pname = "scons";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/scons/${pname}-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
postPatch = lib.optionalString (lib.versionAtLeast version "4.0.0") ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace "build/dist" "dist"
|
||||
'' + lib.optionalString (lib.versionAtLeast version "4.1.0") ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace "build/doc/man/" ""
|
||||
'';
|
||||
|
||||
# The release tarballs don't contain any tests (runtest.py and test/*):
|
||||
doCheck = lib.versionOlder version "4.0.0";
|
||||
|
||||
postInstall = lib.optionalString (lib.versionAtLeast version "4.1.0") ''
|
||||
mkdir -p "$out/share/man/man1"
|
||||
mv "$out/"*.1 "$out/share/man/man1/"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
# expose the used python version so tools using this (and extensing scos with other python modules)
|
||||
# can use the exact same python version.
|
||||
inherit python;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "An improved, cross-platform substitute for Make";
|
||||
longDescription = ''
|
||||
SCons is an Open Source software construction tool. Think of
|
||||
SCons as an improved, cross-platform substitute for the classic
|
||||
Make utility with integrated functionality similar to
|
||||
autoconf/automake and compiler caches such as ccache. In short,
|
||||
SCons is an easier, more reliable and faster way to build
|
||||
software.
|
||||
'';
|
||||
homepage = "https://scons.org/";
|
||||
changelog = "https://raw.githubusercontent.com/SConsProject/scons/rel_${version}/src/CHANGES.txt";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.all;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
20
pkgs/development/tools/build-managers/scons/default.nix
Normal file
20
pkgs/development/tools/build-managers/scons/default.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ callPackage, python2, python3 }:
|
||||
|
||||
let
|
||||
mkScons = args: callPackage (import ./common.nix args) {
|
||||
python = python3;
|
||||
};
|
||||
in {
|
||||
scons_3_0_1 = (mkScons {
|
||||
version = "3.0.1";
|
||||
sha256 = "0wzid419mlwqw9llrg8gsx4nkzhqy16m4m40r0xnh6cwscw5wir4";
|
||||
}).override { python = python2; };
|
||||
scons_3_1_2 = (mkScons {
|
||||
version = "3.1.2";
|
||||
sha256 = "1yzq2gg9zwz9rvfn42v5jzl3g4qf1khhny6zfbi2hib55zvg60bq";
|
||||
}).override { python = python2; };
|
||||
scons_latest = mkScons {
|
||||
version = "4.1.0";
|
||||
sha256 = "11axk03142ziax6i3wwy9qpqp7r3i7h5jg9y2xzph9i15rv8vlkj";
|
||||
};
|
||||
}
|
||||
84
pkgs/development/tools/build-managers/scons/setup-hook.sh
Normal file
84
pkgs/development/tools/build-managers/scons/setup-hook.sh
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
sconsBuildPhase() {
|
||||
runHook preBuild
|
||||
|
||||
if [ -n "$prefix" ]; then
|
||||
mkdir -p "$prefix"
|
||||
fi
|
||||
|
||||
if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
|
||||
buildFlags="${prefixKey:-prefix=}$prefix $buildFlags"
|
||||
fi
|
||||
|
||||
local flagsArray=(
|
||||
${enableParallelBuilding:+-j${NIX_BUILD_CORES}}
|
||||
$sconsFlags ${sconsFlagsArray[@]}
|
||||
$buildFlags ${buildFlagsArray[@]}
|
||||
)
|
||||
|
||||
echoCmd 'build flags' "${flagsArray[@]}"
|
||||
scons "${flagsArray[@]}"
|
||||
|
||||
runHook postBuild
|
||||
}
|
||||
|
||||
sconsInstallPhase() {
|
||||
runHook preInstall
|
||||
|
||||
if [ -n "$prefix" ]; then
|
||||
mkdir -p "$prefix"
|
||||
fi
|
||||
|
||||
if [ -z "${dontAddPrefix:-}" ] && [ -n "$prefix" ]; then
|
||||
installFlags="${prefixKey:-prefix=}$prefix $installFlags"
|
||||
fi
|
||||
|
||||
local flagsArray=(
|
||||
$sconsFlags ${sconsFlagsArray[@]}
|
||||
$installFlags ${installFlagsArray[@]}
|
||||
${installTargets:-install}
|
||||
)
|
||||
|
||||
echoCmd 'install flags' "${flagsArray[@]}"
|
||||
scons "${flagsArray[@]}"
|
||||
|
||||
runHook postInstall
|
||||
}
|
||||
|
||||
sconsCheckPhase() {
|
||||
runHook preCheck
|
||||
|
||||
if [ -z "${checkTarget:-}" ]; then
|
||||
if scons -n check >/dev/null 2>&1; then
|
||||
checkTarget=check
|
||||
elif scons -n test >/dev/null 2>&1; then
|
||||
checkTarget=test
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "${checkTarget:-}" ]; then
|
||||
echo "no check/test target found, doing nothing"
|
||||
else
|
||||
local flagsArray=(
|
||||
${enableParallelChecking:+-j${NIX_BUILD_CORES}}
|
||||
$sconsFlags ${sconsFlagsArray[@]}
|
||||
${checkFlagsArray[@]}
|
||||
)
|
||||
|
||||
echoCmd 'check flags' "${flagsArray[@]}"
|
||||
scons "${flagsArray[@]}"
|
||||
fi
|
||||
|
||||
runHook postCheck
|
||||
}
|
||||
|
||||
if [ -z "${buildPhase-}" ]; then
|
||||
buildPhase=sconsBuildPhase
|
||||
fi
|
||||
|
||||
if [ -z "${dontUseSconsInstall-}" -a -z "${installPhase-}" ]; then
|
||||
installPhase=sconsInstallPhase
|
||||
fi
|
||||
|
||||
if [ -z "${checkPhase-}" ]; then
|
||||
checkPhase=sconsCheckPhase
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue