From 1fa79bcc0680f8ebbf43f128cea89d05a64d2c05 Mon Sep 17 00:00:00 2001 From: daspk Date: Mon, 29 Jul 2024 17:24:31 +0700 Subject: [PATCH] [STYLE] Format via Alejandra --- flake.nix | 25 ++- pkgs/itk_4_13_3/default.nix | 318 ++++++++++++++++++------------------ pkgs/otb/default.nix | 302 +++++++++++++++++----------------- pkgs/shark/default.nix | 102 ++++++------ 4 files changed, 372 insertions(+), 375 deletions(-) diff --git a/flake.nix b/flake.nix index b37321e..8b5f0c4 100644 --- a/flake.nix +++ b/flake.nix @@ -7,22 +7,19 @@ flake-utils.url = "github:numtide/flake-utils"; }; - outputs = - { self - , nixpkgs - , nixpkgs-unstable - , flake-utils - , - }: + outputs = { + self, + nixpkgs, + nixpkgs-unstable, + flake-utils, + }: flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = import nixpkgs { inherit system; }; + system: let + pkgs = import nixpkgs {inherit system;}; python = pkgs.python312; # we fix python version to 3.12 here for the OTB - in - rec { - packages.shark = pkgs.callPackage ./pkgs/shark/. { inherit system; }; - packages.itk_4_13 = pkgs.callPackage ./pkgs/itk_4_13_3/. { inherit system; }; + in rec { + packages.shark = pkgs.callPackage ./pkgs/shark/. {inherit system;}; + packages.itk_4_13 = pkgs.callPackage ./pkgs/itk_4_13_3/. {inherit system;}; packages.otb = pkgs.callPackage ./pkgs/otb/. { inherit system; shark = packages.shark; diff --git a/pkgs/itk_4_13_3/default.nix b/pkgs/itk_4_13_3/default.nix index 4470110..1f50fad 100644 --- a/pkgs/itk_4_13_3/default.nix +++ b/pkgs/itk_4_13_3/default.nix @@ -1,166 +1,166 @@ -{ lib -, stdenv -, fetchgit -, cmake -, expat -, fftw -, fftwFloat -, gdcm -, hdf5-cpp -, libjpeg -, libminc -, libtiff -, libpng -, libuuid -, xz -, vtk -, zlib -, ... -}: -let +{ + lib, + stdenv, + fetchgit, + cmake, + expat, + fftw, + fftwFloat, + gdcm, + hdf5-cpp, + libjpeg, + libminc, + libtiff, + libpng, + libuuid, + xz, + vtk, + zlib, + ... +}: let versionMeta = builtins.fromJSON (builtins.readFile ./version.json); in -stdenv.mkDerivation rec { - pname = "itk"; - version = versionMeta.version; + stdenv.mkDerivation rec { + pname = "itk"; + version = versionMeta.version; - src = builtins.fetchGit { - name = pname; - url = "https://github.com/InsightSoftwareConsortium/ITK"; - # version is same as OTB Superbuild - # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/SuperBuild/CMake/External_itk.cmake?ref_type=heads#L149 - ref = "refs/tags/v${version}"; - rev = versionMeta.rev; - }; + src = builtins.fetchGit { + name = pname; + url = "https://github.com/InsightSoftwareConsortium/ITK"; + # version is same as OTB Superbuild + # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/SuperBuild/CMake/External_itk.cmake?ref_type=heads#L149 + ref = "refs/tags/v${version}"; + rev = versionMeta.rev; + }; - # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/develop/SuperBuild/patches/ITK?ref_type=heads - # todo: check if all the patches are required for nix - patches = [ - ./itk-1-fftw-all.diff - ./itk-2-itktestlib-all.diff - ./itk-3-remove-gcc-version-debian-medteam-all.diff - ]; + # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/develop/SuperBuild/patches/ITK?ref_type=heads + # todo: check if all the patches are required for nix + patches = [ + ./itk-1-fftw-all.diff + ./itk-2-itktestlib-all.diff + ./itk-3-remove-gcc-version-debian-medteam-all.diff + ]; - # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/SuperBuild/CMake/External_itk.cmake?ref_type=heads - cmakeFlags = [ - "-DBUILD_TESTING=OFF" - "-DBUILD_EXAMPLES=OFF" - "-DBUILD_SHARED_LIBS=ON" - "-DITK_BUILD_DEFAULT_MODULES=OFF" - "-DITKGroup_Core=OFF" - "-DITK_FORBID_DOWNLOADS=ON" - "-DITK_USE_SYSTEM_LIBRARIES=ON" # finds common libraries e.g. hdf5, libpng, libtiff, libjpeg, zlib etc - # "-DITK_USE_KWSTYLE=OFF" - # todo: check if this needs to be enabled as nixpkgs for ITK 5.2.X has this disabled - "-DITK_USE_SYSTEM_EIGEN=OFF" - # "-DITK_USE_SYSTEM_EXPAT=ON" - # "-DITK_USE_SYSTEM_ZLIB=ON" - # "-DITK_USE_SYSTEM_TIFF=ON" - # "-DITK_USE_SYSTEM_PNG=ON" - "-DModule_ITKCommon=ON" - #"-DModule_ITKTestKernel=ON" - "-DModule_ITKFiniteDifference=ON" - "-DModule_ITKGPUCommon=ON" - "-DModule_ITKGPUFiniteDifference=ON" - "-DModule_ITKImageAdaptors=ON" - "-DModule_ITKImageFunction=ON" - "-DModule_ITKMesh=ON" - "-DModule_ITKQuadEdgeMesh=ON" - "-DModule_ITKSpatialObjects=ON" - "-DModule_ITKTransform=ON" - "-DModule_ITKTransformFactory=ON" - "-DModule_ITKIOTransformBase=ON" - "-DModule_ITKIOTransformInsightLegacy=ON" - "-DModule_ITKIOTransformMatlab=ON" - "-DModule_ITKAnisotropicSmoothing=ON" - "-DModule_ITKAntiAlias=ON" - "-DModule_ITKBiasCorrection=ON" - "-DModule_ITKBinaryMathematicalMorphology=ON" - "-DModule_ITKColormap=ON" - "-DModule_ITKConvolution=ON" - "-DModule_ITKCurvatureFlow=ON" - "-DModule_ITKDeconvolution=ON" - "-DModule_ITKDenoising=ON" - #-DModule_ITKDiffusionTensorImage=ON - "-DModule_ITKDisplacementField=ON" - "-DModule_ITKDistanceMap=ON" - "-DModule_ITKFastMarching=ON" - "-DModule_ITKFFT=ON" - "-DModule_ITKGPUAnisotropicSmoothing=ON" - "-DModule_ITKGPUImageFilterBase=ON" - "-DModule_ITKGPUSmoothing=ON" - "-DModule_ITKGPUThresholding=ON" - "-DModule_ITKImageCompare=ON" - "-DModule_ITKImageCompose=ON" - "-DModule_ITKImageFeature=ON" - "-DModule_ITKImageFilterBase=ON" - "-DModule_ITKImageFusion=ON" - "-DModule_ITKImageGradient=ON" - "-DModule_ITKImageGrid=ON" - "-DModule_ITKImageIntensity=ON" - "-DModule_ITKImageLabel=ON" - "-DModule_ITKImageSources=ON" - "-DModule_ITKImageStatistics=ON" - "-DModule_ITKLabelMap=ON" - "-DModule_ITKMathematicalMorphology=ON" - "-DModule_ITKPath=ON" - "-DModule_ITKQuadEdgeMeshFiltering=ON" - "-DModule_ITKSmoothing=ON" - "-DModule_ITKSpatialFunction=ON" - "-DModule_ITKThresholding=ON" - "-DModule_ITKEigen=ON" - #"-DModule_ITKFEM=ON" - "-DModule_ITKNarrowBand=ON" - "-DModule_ITKNeuralNetworks=ON" - "-DModule_ITKOptimizers=ON" - "-DModule_ITKOptimizersv4=ON" - "-DModule_ITKPolynomials=ON" - "-DModule_ITKStatistics=ON" - "-DModule_ITKRegistrationCommon=ON" - #"-DModule_ITKFEMRegistration=ON" - "-DModule_ITKGPURegistrationCommon=ON" - "-DModule_ITKGPUPDEDeformableRegistration=ON" - "-DModule_ITKMetricsv4=ON" - "-DModule_ITKPDEDeformableRegistration=ON" - "-DModule_ITKRegistrationMethodsv4=ON" - #"-DModule_ITKBioCell=ON" - "-DModule_ITKClassifiers=ON" - "-DModule_ITKConnectedComponents=ON" - "-DModule_ITKDeformableMesh=ON" - "-DModule_ITKKLMRegionGrowing=ON" - "-DModule_ITKLabelVoting=ON" - "-DModule_ITKLevelSets=ON" - "-DModule_ITKLevelSetsv4=ON" - #"-DModule_ITKLevelSetsv4Visualization=ON" - "-DModule_ITKMarkovRandomFieldsClassifiers=ON" - "-DModule_ITKRegionGrowing=ON" - "-DModule_ITKSignedDistanceFunction=ON" - "-DModule_ITKVoronoi=ON" - "-DModule_ITKWatersheds=ON" - ]; + # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/SuperBuild/CMake/External_itk.cmake?ref_type=heads + cmakeFlags = [ + "-DBUILD_TESTING=OFF" + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_SHARED_LIBS=ON" + "-DITK_BUILD_DEFAULT_MODULES=OFF" + "-DITKGroup_Core=OFF" + "-DITK_FORBID_DOWNLOADS=ON" + "-DITK_USE_SYSTEM_LIBRARIES=ON" # finds common libraries e.g. hdf5, libpng, libtiff, libjpeg, zlib etc + # "-DITK_USE_KWSTYLE=OFF" + # todo: check if this needs to be enabled as nixpkgs for ITK 5.2.X has this disabled + "-DITK_USE_SYSTEM_EIGEN=OFF" + # "-DITK_USE_SYSTEM_EXPAT=ON" + # "-DITK_USE_SYSTEM_ZLIB=ON" + # "-DITK_USE_SYSTEM_TIFF=ON" + # "-DITK_USE_SYSTEM_PNG=ON" + "-DModule_ITKCommon=ON" + #"-DModule_ITKTestKernel=ON" + "-DModule_ITKFiniteDifference=ON" + "-DModule_ITKGPUCommon=ON" + "-DModule_ITKGPUFiniteDifference=ON" + "-DModule_ITKImageAdaptors=ON" + "-DModule_ITKImageFunction=ON" + "-DModule_ITKMesh=ON" + "-DModule_ITKQuadEdgeMesh=ON" + "-DModule_ITKSpatialObjects=ON" + "-DModule_ITKTransform=ON" + "-DModule_ITKTransformFactory=ON" + "-DModule_ITKIOTransformBase=ON" + "-DModule_ITKIOTransformInsightLegacy=ON" + "-DModule_ITKIOTransformMatlab=ON" + "-DModule_ITKAnisotropicSmoothing=ON" + "-DModule_ITKAntiAlias=ON" + "-DModule_ITKBiasCorrection=ON" + "-DModule_ITKBinaryMathematicalMorphology=ON" + "-DModule_ITKColormap=ON" + "-DModule_ITKConvolution=ON" + "-DModule_ITKCurvatureFlow=ON" + "-DModule_ITKDeconvolution=ON" + "-DModule_ITKDenoising=ON" + #-DModule_ITKDiffusionTensorImage=ON + "-DModule_ITKDisplacementField=ON" + "-DModule_ITKDistanceMap=ON" + "-DModule_ITKFastMarching=ON" + "-DModule_ITKFFT=ON" + "-DModule_ITKGPUAnisotropicSmoothing=ON" + "-DModule_ITKGPUImageFilterBase=ON" + "-DModule_ITKGPUSmoothing=ON" + "-DModule_ITKGPUThresholding=ON" + "-DModule_ITKImageCompare=ON" + "-DModule_ITKImageCompose=ON" + "-DModule_ITKImageFeature=ON" + "-DModule_ITKImageFilterBase=ON" + "-DModule_ITKImageFusion=ON" + "-DModule_ITKImageGradient=ON" + "-DModule_ITKImageGrid=ON" + "-DModule_ITKImageIntensity=ON" + "-DModule_ITKImageLabel=ON" + "-DModule_ITKImageSources=ON" + "-DModule_ITKImageStatistics=ON" + "-DModule_ITKLabelMap=ON" + "-DModule_ITKMathematicalMorphology=ON" + "-DModule_ITKPath=ON" + "-DModule_ITKQuadEdgeMeshFiltering=ON" + "-DModule_ITKSmoothing=ON" + "-DModule_ITKSpatialFunction=ON" + "-DModule_ITKThresholding=ON" + "-DModule_ITKEigen=ON" + #"-DModule_ITKFEM=ON" + "-DModule_ITKNarrowBand=ON" + "-DModule_ITKNeuralNetworks=ON" + "-DModule_ITKOptimizers=ON" + "-DModule_ITKOptimizersv4=ON" + "-DModule_ITKPolynomials=ON" + "-DModule_ITKStatistics=ON" + "-DModule_ITKRegistrationCommon=ON" + #"-DModule_ITKFEMRegistration=ON" + "-DModule_ITKGPURegistrationCommon=ON" + "-DModule_ITKGPUPDEDeformableRegistration=ON" + "-DModule_ITKMetricsv4=ON" + "-DModule_ITKPDEDeformableRegistration=ON" + "-DModule_ITKRegistrationMethodsv4=ON" + #"-DModule_ITKBioCell=ON" + "-DModule_ITKClassifiers=ON" + "-DModule_ITKConnectedComponents=ON" + "-DModule_ITKDeformableMesh=ON" + "-DModule_ITKKLMRegionGrowing=ON" + "-DModule_ITKLabelVoting=ON" + "-DModule_ITKLevelSets=ON" + "-DModule_ITKLevelSetsv4=ON" + #"-DModule_ITKLevelSetsv4Visualization=ON" + "-DModule_ITKMarkovRandomFieldsClassifiers=ON" + "-DModule_ITKRegionGrowing=ON" + "-DModule_ITKSignedDistanceFunction=ON" + "-DModule_ITKVoronoi=ON" + "-DModule_ITKWatersheds=ON" + ]; - nativeBuildInputs = [ cmake xz ]; - buildInputs = [ - libuuid - ]; - propagatedBuildInputs = [ - # The dependencies we've un-vendored from ITK, must be propagated, - # otherwise other software built against ITK fails to configure since ITK headers - # refer to these previously vendored libraries: - expat - fftw - fftwFloat - hdf5-cpp - libjpeg - libpng - libtiff - zlib - ]; + nativeBuildInputs = [cmake xz]; + buildInputs = [ + libuuid + ]; + propagatedBuildInputs = [ + # The dependencies we've un-vendored from ITK, must be propagated, + # otherwise other software built against ITK fails to configure since ITK headers + # refer to these previously vendored libraries: + expat + fftw + fftwFloat + hdf5-cpp + libjpeg + libpng + libtiff + zlib + ]; - meta = { - description = "Insight Segmentation and Registration Toolkit"; - homepage = "https://www.itk.org"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ daskpk04 ]; - }; -} + meta = { + description = "Insight Segmentation and Registration Toolkit"; + homepage = "https://www.itk.org"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [daskpk04]; + }; + } diff --git a/pkgs/otb/default.nix b/pkgs/otb/default.nix index 2b6f85f..7613aab 100644 --- a/pkgs/otb/default.nix +++ b/pkgs/otb/default.nix @@ -1,168 +1,168 @@ -{ cmake -, fetchgit -, makeWrapper -, lib -, stdenv -, swig -, which -, boost -, curl -, gdal -, itk_4_13 -, libsvm -, libgeotiff -, muparser -, muparserx -, opencv -, perl -, python3 -, shark -, tinyxml -, enableFeatureExtraction ? true -, enableHyperspectral ? true -, enableLearning ? true -, enableMiscellaneous ? true -, enableOpenMP ? false -, enablePython ? true -, extraPythonPackages ? ps: with ps; [ ] -, enableRemote ? true -, enableSAR ? true -, enableSegmentation ? true -, enableStereoProcessing ? true -, pkgs -, ... -}: -let +{ + cmake, + fetchgit, + makeWrapper, + lib, + stdenv, + swig, + which, + boost, + curl, + gdal, + itk_4_13, + libsvm, + libgeotiff, + muparser, + muparserx, + opencv, + perl, + python3, + shark, + tinyxml, + enableFeatureExtraction ? true, + enableHyperspectral ? true, + enableLearning ? true, + enableMiscellaneous ? true, + enableOpenMP ? false, + enablePython ? true, + extraPythonPackages ? ps: with ps; [], + enableRemote ? true, + enableSAR ? true, + enableSegmentation ? true, + enableStereoProcessing ? true, + pkgs, + ... +}: let versionMeta = builtins.fromJSON (builtins.readFile ./version.json); inherit (lib) optionalString optionals optional; pythonInputs = optionals enablePython - (with python3.pkgs; [ - numpy - ]) + (with python3.pkgs; [ + numpy + ]) ++ (extraPythonPackages python3.pkgs); - otb-shark = shark.override { enableOpenMP = enableOpenMP; }; + otb-shark = shark.override {enableOpenMP = enableOpenMP;}; in -stdenv.mkDerivation rec { - pname = "otb"; - version = versionMeta.version; + stdenv.mkDerivation rec { + pname = "otb"; + version = versionMeta.version; - src = builtins.fetchGit { - name = pname; - url = "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb"; - ref = "refs/tags/${version}"; - rev = versionMeta.rev; - }; + src = builtins.fetchGit { + name = pname; + url = "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb"; + ref = "refs/tags/${version}"; + rev = versionMeta.rev; + }; - nativeBuildInputs = - [ - cmake - makeWrapper - swig - which - ] - ++ optionals enablePython [ - python3.pkgs.wrapPython - ]; + nativeBuildInputs = + [ + cmake + makeWrapper + swig + which + ] + ++ optionals enablePython [ + python3.pkgs.wrapPython + ]; - buildInputs = - [ - boost - curl - gdal - itk_4_13 - libsvm - libgeotiff - muparser - muparserx - opencv - perl - otb-shark - tinyxml - ] - ++ optionals enablePython [ - python3 - ] - ++ optionals enablePython pythonInputs; + buildInputs = + [ + boost + curl + gdal + itk_4_13 + libsvm + libgeotiff + muparser + muparserx + opencv + perl + otb-shark + tinyxml + ] + ++ optionals enablePython [ + python3 + ] + ++ optionals enablePython pythonInputs; - # https://www.orfeo-toolbox.org/CookBook/CompilingOTBFromSource.html#native-build-with-system-dependencies - cmakeFlags = - [ - ] - ++ optionals enableFeatureExtraction [ - "-DOTB_BUILD_FeaturesExtraction=ON" - ] - ++ optionals enableHyperspectral [ - "-DOTB_BUILD_Hyperspectral=ON" - ] - ++ optionals enableLearning [ - "-DOTB_BUILD_Learning=ON" - ] - ++ optionals enableMiscellaneous [ - "-DOTB_BUILD_Miscellaneous=ON" - ] - ++ optionals enableRemote [ - "-DOTB_BUILD_RemoteModules=ON" - ] - ++ optionals enableSAR [ - "-DOTB_BUILD_SAR=ON" - ] - ++ optionals enableSegmentation [ - "-DOTB_BUILD_Segmentation=ON" - ] - ++ optionals enableStereoProcessing [ - "-DOTB_BUILD_StereoProcessing=ON" - ] - ++ optionals enablePython [ - "-DOTB_WRAP_PYTHON=ON" - ] - ++ optionals doInstallCheck [ - "-DBUILD_TESTING=ON" - ]; + # https://www.orfeo-toolbox.org/CookBook/CompilingOTBFromSource.html#native-build-with-system-dependencies + cmakeFlags = + [ + ] + ++ optionals enableFeatureExtraction [ + "-DOTB_BUILD_FeaturesExtraction=ON" + ] + ++ optionals enableHyperspectral [ + "-DOTB_BUILD_Hyperspectral=ON" + ] + ++ optionals enableLearning [ + "-DOTB_BUILD_Learning=ON" + ] + ++ optionals enableMiscellaneous [ + "-DOTB_BUILD_Miscellaneous=ON" + ] + ++ optionals enableRemote [ + "-DOTB_BUILD_RemoteModules=ON" + ] + ++ optionals enableSAR [ + "-DOTB_BUILD_SAR=ON" + ] + ++ optionals enableSegmentation [ + "-DOTB_BUILD_Segmentation=ON" + ] + ++ optionals enableStereoProcessing [ + "-DOTB_BUILD_StereoProcessing=ON" + ] + ++ optionals enablePython [ + "-DOTB_WRAP_PYTHON=ON" + ] + ++ optionals doInstallCheck [ + "-DBUILD_TESTING=ON" + ]; - # todo: check if these contains all the required packages for another package to be build against OTB (such remote modules) ? - propagatedBuildInputs = - [ - boost - curl - gdal - itk_4_13 - libgeotiff - libsvm - muparser - muparserx - opencv - perl - shark - swig - tinyxml - ] - ++ optionals enablePython [ - python3 - ] - ++ optionals enablePython pythonInputs; + # todo: check if these contains all the required packages for another package to be build against OTB (such remote modules) ? + propagatedBuildInputs = + [ + boost + curl + gdal + itk_4_13 + libgeotiff + libsvm + muparser + muparserx + opencv + perl + shark + swig + tinyxml + ] + ++ optionals enablePython [ + python3 + ] + ++ optionals enablePython pythonInputs; - doInstallCheck = false; + doInstallCheck = false; - pythonPath = optionals enablePython pythonInputs; + pythonPath = optionals enablePython pythonInputs; - # wrap the otbcli with the environment variable - postInstall = '' - wrapProgram $out/bin/otbcli \ - --set OTB_INSTALL_DIR "$out" \ - --set OTB_APPLICATION_PATH "$out/lib/otb/applications" - ''; + # wrap the otbcli with the environment variable + postInstall = '' + wrapProgram $out/bin/otbcli \ + --set OTB_INSTALL_DIR "$out" \ + --set OTB_APPLICATION_PATH "$out/lib/otb/applications" + ''; - # # todo: this still doesn't fix importing of otb via python - # postFixup = '' - # wrapPythonProgramsIn "$out/lib/otb/python" "$out $pythonPath" - # ''; + # # todo: this still doesn't fix importing of otb via python + # postFixup = '' + # wrapPythonProgramsIn "$out/lib/otb/python" "$out $pythonPath" + # ''; - meta = { - description = "Orfeo ToolBox"; - homepage = "https://www.orfeo-toolbox.org/"; - license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ daspk04 ]; - }; -} + meta = { + description = "Orfeo ToolBox"; + homepage = "https://www.orfeo-toolbox.org/"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [daspk04]; + }; + } diff --git a/pkgs/shark/default.nix b/pkgs/shark/default.nix index b0c6933..81073cf 100644 --- a/pkgs/shark/default.nix +++ b/pkgs/shark/default.nix @@ -1,59 +1,59 @@ -{ lib -, boost -, cmake -, fetchgit -, openssl -, stdenv -, enableOpenMP ? false -, pkgs -, ... -}: -let +{ + lib, + boost, + cmake, + fetchgit, + openssl, + stdenv, + enableOpenMP ? false, + pkgs, + ... +}: let versionMeta = builtins.fromJSON (builtins.readFile ./version.json); in -stdenv.mkDerivation rec { - pname = "shark"; - # fetch the latest master, differs from otb superbuild which was last updated 2 years back - version = versionMeta.version; + stdenv.mkDerivation rec { + pname = "shark"; + # fetch the latest master, differs from otb superbuild which was last updated 2 years back + version = versionMeta.version; - src = builtins.fetchGit { - name = pname; - url = "https://github.com/Shark-ML/Shark"; - ref = "master"; - rev = versionMeta.rev; - }; + src = builtins.fetchGit { + name = pname; + url = "https://github.com/Shark-ML/Shark"; + ref = "master"; + rev = versionMeta.rev; + }; - # todo: check if patches are needed for nix - # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/develop/SuperBuild/patches/SHARK?ref_type=heads - # patch of hdf5 seems to be not needed based on latest master branch of shark-ml as HDF5 has been removed - # c.f https://github.com/Shark-ML/Shark/commit/221c1f2e8abfffadbf3c5ef7cf324bc6dc9b4315 - patches = [ - # ./shark-1-disable-hdf5-all.diff - ./shark-2-ext-num-literals-all.diff - ]; + # todo: check if patches are needed for nix + # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/tree/develop/SuperBuild/patches/SHARK?ref_type=heads + # patch of hdf5 seems to be not needed based on latest master branch of shark-ml as HDF5 has been removed + # c.f https://github.com/Shark-ML/Shark/commit/221c1f2e8abfffadbf3c5ef7cf324bc6dc9b4315 + patches = [ + # ./shark-1-disable-hdf5-all.diff + ./shark-2-ext-num-literals-all.diff + ]; - # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/SuperBuild/CMake/External_shark.cmake?ref_type=heads - cmakeFlags = - [ - "-DBUILD_SHARED_LIBS=ON" - "-DBUILD_EXAMPLES=OFF" - "-DBUILD_DOCS=OFF" - "-DBUILD_TESTING=OFF" - # "-DENABLE_HDF5=OFF" no more needed based on latest master - "-DENABLE_CBLAS=OFF" - ] - ++ lib.optionals (!enableOpenMP) [ - "-DENABLE_OPENMP=OFF" + # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/blob/develop/SuperBuild/CMake/External_shark.cmake?ref_type=heads + cmakeFlags = + [ + "-DBUILD_SHARED_LIBS=ON" + "-DBUILD_EXAMPLES=OFF" + "-DBUILD_DOCS=OFF" + "-DBUILD_TESTING=OFF" + # "-DENABLE_HDF5=OFF" no more needed based on latest master + "-DENABLE_CBLAS=OFF" + ] + ++ lib.optionals (!enableOpenMP) [ + "-DENABLE_OPENMP=OFF" + ]; + buildInputs = [ + boost + openssl ]; - buildInputs = [ - boost - openssl - ]; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [cmake]; - meta = { - description = "The Shark Machine Leaning Library"; - homepage = "https://shark-ml.github.io/Shark/"; - }; -} + meta = { + description = "The Shark Machine Leaning Library"; + homepage = "https://shark-ml.github.io/Shark/"; + }; + }