Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / stb / default.nix
blobf96bb0724bf28e39b7a4145992654a2627624090
1 { lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }:
3 stdenv.mkDerivation rec {
4   pname = "stb";
5   version = "unstable-2023-01-29";
7   src = fetchFromGitHub {
8     owner = "nothings";
9     repo = "stb";
10     rev = "5736b15f7ea0ffb08dd38af21067c314d6a3aae9";
11     hash = "sha256-s2ASdlT3bBNrqvwfhhN6skjbmyEnUgvNOrvhgUSRj98=";
12   };
14   nativeBuildInputs = [ copyPkgconfigItems ];
16   pkgconfigItems = [
17     (makePkgconfigItem rec {
18       name = "stb";
19       version = "1";
20       cflags = [ "-I${variables.includedir}/stb" ];
21       variables = rec {
22         prefix = "${placeholder "out"}";
23         includedir = "${prefix}/include";
24       };
25       inherit (meta) description;
26     })
27   ];
29   dontBuild = true;
31   installPhase = ''
32     runHook preInstall
33     mkdir -p $out/include/stb
34     cp *.h $out/include/stb/
35     runHook postInstall
36   '';
38   meta = with lib; {
39     description = "Single-file public domain libraries for C/C++";
40     homepage = "https://github.com/nothings/stb";
41     license = licenses.publicDomain;
42     platforms = platforms.all;
43     maintainers = with maintainers; [ ];
44   };