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
27
pkgs/development/python-modules/dlib/build-cores.patch
Normal file
27
pkgs/development/python-modules/dlib/build-cores.patch
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
diff --git a/setup.py b/setup.py
|
||||
index 0c8d8f16..565ef8ef 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -172,21 +172,7 @@ class CMakeBuild(build_ext):
|
||||
subprocess.check_call(cmake_build, cwd=build_folder)
|
||||
|
||||
def num_available_cpu_cores(ram_per_build_process_in_gb):
|
||||
- if 'TRAVIS' in os.environ and os.environ['TRAVIS']=='true':
|
||||
- # When building on travis-ci, just use 2 cores since travis-ci limits
|
||||
- # you to that regardless of what the hardware might suggest.
|
||||
- return 2
|
||||
- try:
|
||||
- mem_bytes = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
|
||||
- mem_gib = mem_bytes/(1024.**3)
|
||||
- num_cores = multiprocessing.cpu_count()
|
||||
- # make sure we have enough ram for each build process.
|
||||
- mem_cores = int(floor(mem_gib/float(ram_per_build_process_in_gb)+0.5));
|
||||
- # We are limited either by RAM or CPU cores. So pick the limiting amount
|
||||
- # and return that.
|
||||
- return max(min(num_cores, mem_cores), 1)
|
||||
- except ValueError:
|
||||
- return 2 # just assume 2 if we can't get the os to tell us the right answer.
|
||||
+ return os.getenv("NIX_BUILD_CORES", 1)
|
||||
|
||||
|
||||
from setuptools.command.test import test as TestCommand
|
||||
32
pkgs/development/python-modules/dlib/default.nix
Normal file
32
pkgs/development/python-modules/dlib/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ stdenv, buildPythonPackage, dlib, python, pytest, more-itertools
|
||||
, sse4Support ? stdenv.hostPlatform.sse4_1Support
|
||||
, avxSupport ? stdenv.hostPlatform.avxSupport
|
||||
}:
|
||||
|
||||
buildPythonPackage {
|
||||
inherit (dlib) name src nativeBuildInputs buildInputs meta;
|
||||
|
||||
# although AVX can be enabled, we never test with it. Some Hydra machines
|
||||
# fail because of this, however their build results are probably used on hardware
|
||||
# with AVX support.
|
||||
checkPhase = ''
|
||||
${python.interpreter} nix_run_setup test --no USE_AVX_INSTRUCTIONS
|
||||
'';
|
||||
|
||||
setupPyBuildFlags = [
|
||||
"--set USE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
|
||||
"--set USE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}"
|
||||
];
|
||||
|
||||
patches = [ ./build-cores.patch ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace "more-itertools<6.0.0" "more-itertools" \
|
||||
--replace "pytest==3.8" "pytest"
|
||||
'';
|
||||
|
||||
checkInputs = [ pytest more-itertools ];
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue