Skip to content

Commit 801debd

Browse files
committed
thtk: init at 12-unstable-2025-05-06
1 parent 5cfc424 commit 801debd

1 file changed

Lines changed: 82 additions & 0 deletions

File tree

‎pkgs/by-name/th/thtk/package.nix‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
lib,
3+
stdenv,
4+
fetchFromGitHub,
5+
cmake,
6+
flex,
7+
bison,
8+
pkg-config,
9+
zlib,
10+
libpng,
11+
unstableGitUpdater,
12+
validatePkgConfig,
13+
testers,
14+
}:
15+
let
16+
thtypes = fetchFromGitHub {
17+
owner = "thpatch";
18+
repo = "thtypes";
19+
rev = "29ed7d6e1db555ad15fd29edcc0763754ad5b764";
20+
hash = "sha256-j3lrToLuS7SbzzdL3/8uB0nL1z04GtmfmKIC/v37jwI=";
21+
};
22+
in
23+
stdenv.mkDerivation (finalAttrs: {
24+
pname = "thtk";
25+
version = "12-unstable-2025-05-06";
26+
27+
src = fetchFromGitHub {
28+
owner = "thpatch";
29+
repo = "thtk";
30+
rev = "97dc32f48efb704a131acff4a18bc401b0662748";
31+
hash = "sha256-rgSl5VEMQkxMAhg1cMW/c9hH64MZJQ7WxqGsOYiANPM=";
32+
};
33+
34+
# Required header files for the build phase
35+
env.NIX_CFLAGS_COMPILE = "-I${thtypes}";
36+
37+
nativeBuildInputs = [
38+
cmake
39+
bison
40+
flex
41+
pkg-config
42+
validatePkgConfig
43+
];
44+
45+
buildInputs = [
46+
zlib
47+
libpng
48+
flex
49+
bison
50+
];
51+
52+
passthru = {
53+
updateScript = unstableGitUpdater { };
54+
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
55+
};
56+
57+
cmakeFlags = [
58+
(lib.cmakeBool "WITH_LIBPNG_SOURCE" false)
59+
];
60+
61+
postInstall = ''
62+
# Substitute includedir and libdir bad path prefix
63+
substituteInPlace "$out/lib/pkgconfig/thtk.pc" \
64+
--replace-fail "//nix" "/nix"
65+
'';
66+
67+
strictDeps = true;
68+
__structuredAttrs = true;
69+
70+
meta = {
71+
description = "Touhou Toolkit";
72+
homepage = "https://github.com/thpatch/thtk";
73+
changelog = "https://github.com/thpatch/thtk/releases";
74+
license = lib.licenses.bsd2;
75+
pkgConfigModules = [ "thtk" ];
76+
platforms = with lib.platforms; linux ++ windows;
77+
maintainers = with lib.maintainers; [
78+
theobori
79+
pagedMov
80+
];
81+
};
82+
})

0 commit comments

Comments
 (0)