test-drive: add option to build with cmake in addition to meson

+31 -3
+13
pkgs/by-name/te/test-drive/cmake.patch
···
··· 1 + diff --git a/config/template.pc b/config/template.pc 2 + index 3d6efbb..e338a42 100644 3 + --- a/config/template.pc 4 + +++ b/config/template.pc 5 + @@ -1,6 +1,6 @@ 6 + prefix=@CMAKE_INSTALL_PREFIX@ 7 + -libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ 8 + -includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ 9 + +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 10 + +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 11 + 12 + Name: @PROJECT_NAME@ 13 + Description: @PROJECT_DESCRIPTION@
+18 -3
pkgs/by-name/te/test-drive/package.nix
··· 3 lib, 4 fetchFromGitHub, 5 gfortran, 6 meson, 7 ninja, 8 mesonEmulatorHook, 9 }: 10 11 stdenv.mkDerivation rec { 12 pname = "test-drive"; 13 version = "0.5.0"; ··· 19 hash = "sha256-xRx8ErIN9xjxZt/nEsdIQkIGFRltuELdlI8lXA+M030="; 20 }; 21 22 nativeBuildInputs = [ 23 gfortran 24 meson 25 ninja 26 ] 27 - ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ 28 - mesonEmulatorHook 29 - ]; 30 31 mesonAutoFeatures = "auto"; 32
··· 3 lib, 4 fetchFromGitHub, 5 gfortran, 6 + buildType ? "meson", 7 meson, 8 ninja, 9 + cmake, 10 mesonEmulatorHook, 11 }: 12 13 + assert ( 14 + builtins.elem buildType [ 15 + "meson" 16 + "cmake" 17 + ] 18 + ); 19 + 20 stdenv.mkDerivation rec { 21 pname = "test-drive"; 22 version = "0.5.0"; ··· 28 hash = "sha256-xRx8ErIN9xjxZt/nEsdIQkIGFRltuELdlI8lXA+M030="; 29 }; 30 31 + patches = [ 32 + # Fix wrong generation of package config include paths 33 + ./cmake.patch 34 + ]; 35 + 36 nativeBuildInputs = [ 37 gfortran 38 + ] 39 + ++ lib.optionals (buildType == "meson") [ 40 meson 41 ninja 42 ] 43 + ++ lib.optional (buildType == "cmake") cmake 44 + ++ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) mesonEmulatorHook; 45 46 mesonAutoFeatures = "auto"; 47