diff --git a/pkgs/by-name/te/test-drive/cmake.patch b/pkgs/by-name/te/test-drive/cmake.patch new file mode 100644 index 000000000000..00c7e907733b --- /dev/null +++ b/pkgs/by-name/te/test-drive/cmake.patch @@ -0,0 +1,13 @@ +diff --git a/config/template.pc b/config/template.pc +index 3d6efbb..e338a42 100644 +--- a/config/template.pc ++++ b/config/template.pc +@@ -1,6 +1,6 @@ + prefix=@CMAKE_INSTALL_PREFIX@ +-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ ++libdir=@CMAKE_INSTALL_FULL_LIBDIR@ ++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + + Name: @PROJECT_NAME@ + Description: @PROJECT_DESCRIPTION@ diff --git a/pkgs/by-name/te/test-drive/package.nix b/pkgs/by-name/te/test-drive/package.nix index 71c7634c8808..4d70c4ea0629 100644 --- a/pkgs/by-name/te/test-drive/package.nix +++ b/pkgs/by-name/te/test-drive/package.nix @@ -3,11 +3,20 @@ lib, fetchFromGitHub, gfortran, + buildType ? "meson", meson, ninja, + cmake, mesonEmulatorHook, }: +assert ( + builtins.elem buildType [ + "meson" + "cmake" + ] +); + stdenv.mkDerivation rec { pname = "test-drive"; version = "0.5.0"; @@ -19,14 +28,20 @@ stdenv.mkDerivation rec { hash = "sha256-xRx8ErIN9xjxZt/nEsdIQkIGFRltuELdlI8lXA+M030="; }; + patches = [ + # Fix wrong generation of package config include paths + ./cmake.patch + ]; + nativeBuildInputs = [ gfortran + ] + ++ lib.optionals (buildType == "meson") [ meson ninja ] - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - mesonEmulatorHook - ]; + ++ lib.optional (buildType == "cmake") cmake + ++ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) mesonEmulatorHook; mesonAutoFeatures = "auto";