From 6917c3116b8e1b24c171061fd98176276e45dded Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Tue, 24 Jan 2023 16:30:52 +0100 Subject: [PATCH 1/2] openmvg: build as shared library --- pkgs/applications/science/misc/openmvg/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/science/misc/openmvg/default.nix b/pkgs/applications/science/misc/openmvg/default.nix index 1c173b75238c..746dda16d9bf 100644 --- a/pkgs/applications/science/misc/openmvg/default.nix +++ b/pkgs/applications/science/misc/openmvg/default.nix @@ -27,6 +27,7 @@ stdenv.mkDerivation rec { "-DCMAKE_CXX_FLAGS=-std=c++11" "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}" "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}" + "-DOpenMVG_BUILD_SHARED=ON" ]; cmakeDir = "./src"; From a725652372085ad5119476e103cdee1c58525b23 Mon Sep 17 00:00:00 2001 From: Bouke van der Bijl Date: Wed, 25 Jan 2023 10:48:16 +0100 Subject: [PATCH 2/2] openmvg: don't build shared if isStatic --- pkgs/applications/science/misc/openmvg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/misc/openmvg/default.nix b/pkgs/applications/science/misc/openmvg/default.nix index 746dda16d9bf..9bd4cf12db03 100644 --- a/pkgs/applications/science/misc/openmvg/default.nix +++ b/pkgs/applications/science/misc/openmvg/default.nix @@ -4,6 +4,7 @@ , libpng ? null , eigen ? null , libtiff ? null +, enableShared ? !stdenv.hostPlatform.isStatic , enableExamples ? false , enableDocs ? false }: @@ -27,8 +28,7 @@ stdenv.mkDerivation rec { "-DCMAKE_CXX_FLAGS=-std=c++11" "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}" "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}" - "-DOpenMVG_BUILD_SHARED=ON" - ]; + ] ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON"; cmakeDir = "./src";