fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / in / iniparser / package.nix
blobb0bb4dce192fdbf07d3183049a880ad7568b548f
2   lib,
3   stdenv,
4   fetchFromGitLab,
5   fetchFromGitHub,
6   substituteAll,
7   symlinkJoin,
8   cmake,
9   doxygen,
10   ruby,
11   validatePkgConfig,
12   testers,
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "iniparser";
17   version = "4.2.4";
19   src = fetchFromGitLab {
20     owner = "iniparser";
21     repo = "iniparser";
22     rev = "v${finalAttrs.version}";
23     hash = "sha256-R069LuOmjCFj7dHXiMjuK7WUupk5+dVd8IDKY/wBn2o=";
24   };
26   patches = lib.optionals finalAttrs.finalPackage.doCheck [
27     (substituteAll {
28       # Do not let cmake's fetchContent download unity
29       src = ./remove-fetchcontent-usage.patch;
30       unitySrc = symlinkJoin {
31         name = "unity-with-iniparser-config";
32         paths = [
33           (fetchFromGitHub {
34             owner = "throwtheswitch";
35             repo = "unity";
36             rev = "v2.6.0";
37             hash = "sha256-SCcUGNN/UJlu3ALJiZ9bQKxYRZey3cm9QG+NOehp6Ow=";
38           })
39         ];
40         postBuild = ''
41           ln -s ${finalAttrs.src}/test/unity_config.h $out/src/unity_config.h
42         '';
43       };
44     })
45   ];
47   nativeBuildInputs = [
48     cmake
49     doxygen
50     validatePkgConfig
51   ] ++ lib.optionals finalAttrs.finalPackage.doCheck [ ruby ];
53   cmakeFlags = [ "-DBUILD_TESTING=${if finalAttrs.finalPackage.doCheck then "ON" else "OFF"}" ];
55   doCheck = false;
57   postFixup = ''
58     ln -sv $out/include/iniparser/*.h $out/include/
59   '';
61   passthru.tests = {
62     pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
63     iniparser-with-tests = finalAttrs.overrideAttrs (_: {
64       doCheck = true;
65     });
66   };
68   meta = with lib; {
69     homepage = "https://gitlab.com/iniparser/iniparser";
70     description = "Free standalone ini file parsing library";
71     changelog = "https://gitlab.com/iniparser/iniparser/-/releases/v${finalAttrs.version}";
72     license = licenses.mit;
73     platforms = platforms.unix;
74     pkgConfigModules = [ "iniparser" ];
75     maintainers = [ maintainers.primeos ];
76   };