lol
1{ lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }:
2
3stdenv.mkDerivation rec {
4 pname = "stb";
5 version = "unstable-2023-01-29";
6
7 src = fetchFromGitHub {
8 owner = "nothings";
9 repo = "stb";
10 rev = "5736b15f7ea0ffb08dd38af21067c314d6a3aae9";
11 hash = "sha256-s2ASdlT3bBNrqvwfhhN6skjbmyEnUgvNOrvhgUSRj98=";
12 };
13
14 nativeBuildInputs = [ copyPkgconfigItems ];
15
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 ];
28
29 dontBuild = true;
30
31 installPhase = ''
32 runHook preInstall
33 mkdir -p $out/include/stb
34 cp *.h $out/include/stb/
35 runHook postInstall
36 '';
37
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 };
45}