From 63fa907df02914c89061f6c8d98c656c796ef07c Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 14 Dec 2023 11:12:52 -0500 Subject: [PATCH 1/3] rapidcheck: Use stock installation, multiple outputs We had neglected to nice `RC_INSTALL_ALL_EXTRAS`, which will take care of installing the "extras" for us. Now that they are in a standard directory, we don't need to smuggle in the extra `-I` for Nix's tests either. (cherry picked from commit ab8cf01579ce0eba0202b0c84a71fd54ccfe4fc2) (cherry picked from commit 0acb4d6350b81f2d8276f1dd22a7ae7cec515a37) --- pkgs/development/libraries/rapidcheck/default.nix | 11 +++-------- pkgs/tools/package-management/nix/common.nix | 2 -- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/rapidcheck/default.nix b/pkgs/development/libraries/rapidcheck/default.nix index 6f3f43799ea4f..fed2c6ac296db 100644 --- a/pkgs/development/libraries/rapidcheck/default.nix +++ b/pkgs/development/libraries/rapidcheck/default.nix @@ -16,20 +16,15 @@ stdenv.mkDerivation rec { hash = "sha256-nq2VBDREkAOnvtdYr3m0TYNXx7mv9hbV5HZFVL2uTTg="; }; + outputs = [ "out" "dev" ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ "-DBUILD_SHARED_LIBS=${lib.toUpper (lib.boolToString (!stdenv.hostPlatform.isStatic))}" + "-DRC_INSTALL_ALL_EXTRAS=TRUE" ]; - # Install the extras headers - postInstall = '' - cp -r $src/extras $out - chmod -R +w $out/extras - rm $out/extras/CMakeLists.txt - rm $out/extras/**/CMakeLists.txt - ''; - passthru.updateScript = unstableGitUpdater { }; meta = with lib; { diff --git a/pkgs/tools/package-management/nix/common.nix b/pkgs/tools/package-management/nix/common.nix index 19b8d77bb4a7f..1c7c4033881c0 100644 --- a/pkgs/tools/package-management/nix/common.nix +++ b/pkgs/tools/package-management/nix/common.nix @@ -171,8 +171,6 @@ self = stdenv.mkDerivation { ] ++ lib.optionals (!atLeast24) [ # option was removed in 2.4 "--disable-init-state" - ] ++ lib.optionals atLeast214 [ - "CXXFLAGS=-I${lib.getDev rapidcheck}/extras/gtest/include" ] ++ lib.optionals stdenv.isLinux [ "--with-sandbox-shell=${busybox-sandbox-shell}/bin/busybox" ] ++ lib.optionals (atLeast210 && stdenv.isLinux && stdenv.hostPlatform.isStatic) [ From 6bca544be735854701c973a0449cd3e8a3579d22 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 14 Dec 2023 22:30:34 +0000 Subject: [PATCH 2/3] rapidcheck: unstable-2023-04-16 -> unstable-2023-12-14 (cherry picked from commit 789df4b46d8c43e30999f8d41f52ab9149427b5b) (cherry picked from commit bf66898be06827ba1a403b9efaf296b8b62ec12c) --- pkgs/development/libraries/rapidcheck/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/rapidcheck/default.nix b/pkgs/development/libraries/rapidcheck/default.nix index fed2c6ac296db..ae0d34e50fa9d 100644 --- a/pkgs/development/libraries/rapidcheck/default.nix +++ b/pkgs/development/libraries/rapidcheck/default.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation rec { pname = "rapidcheck"; - version = "unstable-2023-04-16"; + version = "unstable-2023-12-14"; src = fetchFromGitHub { owner = "emil-e"; repo = "rapidcheck"; - rev = "a5724ea5b0b00147109b0605c377f1e54c353ba2"; - hash = "sha256-nq2VBDREkAOnvtdYr3m0TYNXx7mv9hbV5HZFVL2uTTg="; + rev = "ff6af6fc683159deb51c543b065eba14dfcf329b"; + hash = "sha256-Ixz5RpY0n8Un/Pv4XoTfbs40+70iyMbkQUjDqoLaWOg="; }; outputs = [ "out" "dev" ]; From 0af53606be23379ca3961a60c59f3e1589787d47 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Thu, 14 Dec 2023 16:33:41 -0500 Subject: [PATCH 3/3] rapidcheck: Add `meta.pkgConfigModules` and test The last update added pkg-config support. Co-authored-by: Robert Hensing (cherry picked from commit a7447f9e338fbaa12aeda5849041a39e04dd4b11) (cherry picked from commit 96d3c843d3f859b5d26f1102843ca2a4ef1aa4cf) --- .../libraries/rapidcheck/default.nix | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/rapidcheck/default.nix b/pkgs/development/libraries/rapidcheck/default.nix index ae0d34e50fa9d..566e7acd7e8d6 100644 --- a/pkgs/development/libraries/rapidcheck/default.nix +++ b/pkgs/development/libraries/rapidcheck/default.nix @@ -3,9 +3,10 @@ , fetchFromGitHub , cmake , unstableGitUpdater +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "rapidcheck"; version = "unstable-2023-12-14"; @@ -25,13 +26,25 @@ stdenv.mkDerivation rec { "-DRC_INSTALL_ALL_EXTRAS=TRUE" ]; - passthru.updateScript = unstableGitUpdater { }; + passthru = { + updateScript = unstableGitUpdater { }; + tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + }; meta = with lib; { description = "A C++ framework for property based testing inspired by QuickCheck"; - inherit (src.meta) homepage; + inherit (finalAttrs.src.meta) homepage; maintainers = with maintainers; [ ]; license = licenses.bsd2; + pkgConfigModules = [ + "rapidcheck" + # Extras + "rapidcheck_boost" + "rapidcheck_boost_test" + "rapidcheck_catch" + "rapidcheck_doctest" + "rapidcheck_gtest" + ]; platforms = platforms.all; }; -} +})