Skip to content

Commit

Permalink
alice-vision: obtain compatible nanoflann version using overrideAttrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Isidor Zeuner committed Sep 20, 2023
1 parent 3bdd9a0 commit 10bfc04
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
21 changes: 18 additions & 3 deletions pkgs/development/libraries/alice-vision/3.0.0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
, cmake
, pkg-config

, pkgs

, assimp
# use the same boost as in cctag here
, boost179
Expand All @@ -15,7 +17,7 @@
, geogram
, lemon-graph
, lz4
, nanoflann
#, nanoflann
, openexr
, openimageio
, zlib
Expand All @@ -29,6 +31,19 @@
, enableOpenCV ? true, enableOpenCVContrib ? enableOpenCV, opencv
}:

let
nanoflann_1_4_2 = pkgs.nanoflann.overrideAttrs (
oldAttrs: rec {
version = "1.4.2";
src = fetchFromGitHub {
owner = "jlblancoc";
repo = "nanoflann";
rev = "v${version}";
hash = "sha256-znIX1S0mfOqLYPIcyVziUM1asBjENPEAdafLud1CfFI=";
};
}
);
in
stdenv.mkDerivation rec {
pname = "alice-vision";
version = "3.0.0";
Expand All @@ -49,7 +64,7 @@ stdenv.mkDerivation rec {

buildInputs = [
flann
nanoflann
nanoflann_1_4_2
openexr

# Temporary fix until flann 1.9.2 is in Nixpkgs
Expand Down Expand Up @@ -89,7 +104,7 @@ stdenv.mkDerivation rec {
# This speeds up fetching and reduces the source archive size
postPatch = ''
rmdir src/dependencies/nanoflann
ln -s ${nanoflann} src/dependencies/nanoflann
ln -s ${nanoflann_1_4_2} src/dependencies/nanoflann
rm -r src/dependencies/lemon
rm -r src/dependencies/flann
Expand Down
21 changes: 18 additions & 3 deletions pkgs/development/libraries/alice-vision/3.1.0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
, cmake
, pkg-config

, pkgs

, assimp
# use the same boost as in cctag here
, boost179
Expand All @@ -15,7 +17,7 @@
, geogram
, lemon-graph
, lz4
, nanoflann
#, nanoflann
, onnxruntime
, openexr
, openimageio
Expand All @@ -30,6 +32,19 @@
, enableOpenCV ? true, enableOpenCVContrib ? enableOpenCV, opencv
}:

let
nanoflann_1_4_2 = pkgs.nanoflann.overrideAttrs (
oldAttrs: rec {
version = "1.4.2";
src = fetchFromGitHub {
owner = "jlblancoc";
repo = "nanoflann";
rev = "v${version}";
hash = "sha256-znIX1S0mfOqLYPIcyVziUM1asBjENPEAdafLud1CfFI=";
};
}
);
in
stdenv.mkDerivation rec {
pname = "alice-vision";
version = "3.1.0";
Expand All @@ -50,7 +65,7 @@ stdenv.mkDerivation rec {

buildInputs = [
flann
nanoflann
nanoflann_1_4_2
onnxruntime
openexr

Expand Down Expand Up @@ -91,7 +106,7 @@ stdenv.mkDerivation rec {
# This speeds up fetching and reduces the source archive size
postPatch = ''
rmdir src/dependencies/nanoflann
ln -s ${nanoflann} src/dependencies/nanoflann
ln -s ${nanoflann_1_4_2} src/dependencies/nanoflann
rm -r src/dependencies/lemon
rm -r src/dependencies/flann
Expand Down

0 comments on commit 10bfc04

Please sign in to comment.