python3Packages.halide: init at 18.0.0

This commit is contained in:
Tom Westerhout 2024-10-15 13:08:53 +02:00
parent 19c1507d6d
commit a90f538e38
2 changed files with 26 additions and 2 deletions

View File

@ -14,6 +14,8 @@
openblas, openblas,
blas, blas,
lapack, lapack,
pythonSupport ? false,
python3Packages ? null,
}: }:
assert blas.implementation == "openblas" && lapack.implementation == "openblas"; assert blas.implementation == "openblas" && lapack.implementation == "openblas";
@ -56,7 +58,7 @@ stdenv.mkDerivation rec {
cmakeFlags = [ cmakeFlags = [
"-DWARNINGS_AS_ERRORS=OFF" "-DWARNINGS_AS_ERRORS=OFF"
"-DWITH_PYTHON_BINDINGS=OFF" "-DWITH_PYTHON_BINDINGS=${if pythonSupport then "ON" else "OFF"}"
"-DTARGET_WEBASSEMBLY=OFF" "-DTARGET_WEBASSEMBLY=OFF"
# Disable performance tests since they may fail on busy machines # Disable performance tests since they may fail on busy machines
"-DWITH_TEST_PERFORMANCE=OFF" "-DWITH_TEST_PERFORMANCE=OFF"
@ -66,6 +68,7 @@ stdenv.mkDerivation rec {
"-DWITH_TEST_FUZZ=OFF" "-DWITH_TEST_FUZZ=OFF"
# Disable FetchContent for flatbuffers and use the version from nixpkgs instead # Disable FetchContent for flatbuffers and use the version from nixpkgs instead
"-DFLATBUFFERS_USE_FETCHCONTENT=OFF" "-DFLATBUFFERS_USE_FETCHCONTENT=OFF"
"-DPYBIND11_USE_FETCHCONTENT=OFF"
]; ];
doCheck = true; doCheck = true;
@ -86,6 +89,12 @@ stdenv.mkDerivation rec {
checkFlagsArray+=("ARGS=-E '${disabledTests}'") checkFlagsArray+=("ARGS=-E '${disabledTests}'")
''; '';
postInstall = lib.optionalString pythonSupport ''
mkdir -p $out/${builtins.dirOf python3Packages.python.sitePackages}
mv -v $out/lib/python3/site-packages $out/${python3Packages.python.sitePackages}
rmdir $out/lib/python3/
'';
# Note: only openblas and not atlas part of this Nix expression # Note: only openblas and not atlas part of this Nix expression
# see pkgs/development/libraries/science/math/liblapack/3.5.0.nix # see pkgs/development/libraries/science/math/liblapack/3.5.0.nix
# to get a hint howto setup atlas instead of openblas # to get a hint howto setup atlas instead of openblas
@ -106,7 +115,20 @@ stdenv.mkDerivation rec {
libGL libGL
]; ];
nativeBuildInputs = [ cmake flatbuffers ]; nativeBuildInputs =
[
cmake
flatbuffers
]
++ lib.optionals pythonSupport [
python3Packages.python
python3Packages.pybind11
];
propagatedBuildInputs = lib.optionals pythonSupport [
python3Packages.numpy
python3Packages.imageio
];
meta = with lib; { meta = with lib; {
description = "C++ based language for image processing and computational photography"; description = "C++ based language for image processing and computational photography";

View File

@ -5562,6 +5562,8 @@ self: super: with self; {
hakuin = callPackage ../development/python-modules/hakuin { }; hakuin = callPackage ../development/python-modules/hakuin { };
halide = toPythonModule (pkgs.halide.override { pythonSupport = true; python3Packages = self; });
halo = callPackage ../development/python-modules/halo { }; halo = callPackage ../development/python-modules/halo { };
halohome = callPackage ../development/python-modules/halohome { }; halohome = callPackage ../development/python-modules/halohome { };