nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 cmake,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "unittest-cpp";
11 version = "2.0.0";
12
13 src = fetchFromGitHub {
14 owner = "unittest-cpp";
15 repo = "unittest-cpp";
16 rev = "v${finalAttrs.version}";
17 sha256 = "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i";
18 };
19
20 patches = [
21 # GCC12 Patch
22 (fetchpatch {
23 url = "https://github.com/unittest-cpp/unittest-cpp/pull/185/commits/f361c2a1034c02ba8059648f9a04662d6e2b5553.patch";
24 hash = "sha256-xyhV2VBelw/uktUXSZ3JBxgG+8/Mout/JiXEZVV2+2Y=";
25 })
26 ];
27
28 # Fix the build with CMake 4.
29 postPatch = ''
30 substituteInPlace CMakeLists.txt \
31 --replace-fail \
32 'cmake_minimum_required(VERSION 2.8.1)' \
33 'cmake_minimum_required(VERSION 3.10)'
34 '';
35
36 # Fix 'Version:' setting in .pc file. TODO: remove once upstreamed:
37 # https://github.com/unittest-cpp/unittest-cpp/pull/188
38 cmakeFlags = [ "-DPACKAGE_VERSION=${finalAttrs.version}" ];
39
40 nativeBuildInputs = [ cmake ];
41
42 doCheck = false;
43
44 meta = {
45 homepage = "https://github.com/unittest-cpp/unittest-cpp";
46 description = "Lightweight unit testing framework for C++";
47 license = lib.licenses.mit;
48 maintainers = [ ];
49 platforms = lib.platforms.unix;
50 };
51})