Skip to content

Commit

Permalink
Merge pull request #274297 from obsidiansystems/rapidcheck-simplify-i…
Browse files Browse the repository at this point in the history
…nstall

rapidcheck: Simplify installation, update, pkg-config
  • Loading branch information
roberth authored Dec 17, 2023
2 parents 49a0e28 + a7447f9 commit fbe9ea8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
38 changes: 23 additions & 15 deletions pkgs/development/libraries/rapidcheck/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,48 @@
, fetchFromGitHub
, cmake
, unstableGitUpdater
, testers
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
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" ];

nativeBuildInputs = [ cmake ];

cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "RC_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 { };
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;
};
}
})
2 changes: 0 additions & 2 deletions pkgs/tools/package-management/nix/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ self = stdenv.mkDerivation {
"--enable-gc"
] ++ lib.optionals (!enableDocumentation) [
"--disable-doc-gen"
] ++ 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) [
Expand Down

0 comments on commit fbe9ea8

Please sign in to comment.