2022-06-22 17:24:31 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, copyPkgconfigItems, makePkgconfigItem }:
|
2018-07-14 21:45:07 +01:00
|
|
|
|
2022-06-22 17:24:31 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "stb";
|
2021-10-23 15:16:20 +01:00
|
|
|
version = "unstable-2021-09-10";
|
2018-07-14 21:45:07 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "nothings";
|
|
|
|
repo = "stb";
|
2021-10-23 15:16:20 +01:00
|
|
|
rev = "af1a5bc352164740c1cc1354942b1c6b72eacb8a";
|
|
|
|
sha256 = "0qq35cd747lll4s7bmnxb3pqvyp2hgcr9kyf758fax9lx76iwjhr";
|
2018-07-14 21:45:07 +01:00
|
|
|
};
|
|
|
|
|
2022-06-22 17:24:31 +01:00
|
|
|
nativeBuildInputs = [ copyPkgconfigItems ];
|
|
|
|
|
|
|
|
pkgconfigItems = [
|
|
|
|
(makePkgconfigItem rec {
|
|
|
|
name = "stb";
|
|
|
|
version = "1";
|
|
|
|
cflags = [ "-I${variables.includedir}/stb" ];
|
|
|
|
variables = rec {
|
|
|
|
prefix = "${placeholder "out"}";
|
|
|
|
includedir = "${prefix}/include";
|
|
|
|
};
|
|
|
|
inherit (meta) description;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2018-07-14 21:45:07 +01:00
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2022-06-22 17:24:31 +01:00
|
|
|
runHook preInstall
|
2018-07-14 21:45:07 +01:00
|
|
|
mkdir -p $out/include/stb
|
|
|
|
cp *.h $out/include/stb/
|
2022-06-22 17:24:31 +01:00
|
|
|
runHook postInstall
|
2018-07-14 21:45:07 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-07-14 21:45:07 +01:00
|
|
|
description = "Single-file public domain libraries for C/C++";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/nothings/stb";
|
2018-07-14 21:45:07 +01:00
|
|
|
license = licenses.publicDomain;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ jfrankenau ];
|
|
|
|
};
|
|
|
|
}
|