nix flake

This commit is contained in:
bramderaeve
2026-05-05 03:16:10 +02:00
parent cb43446e86
commit f1158310dc
4 changed files with 151 additions and 0 deletions

38
package.nix Normal file
View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
meson,
ninja,
pkg-config,
cppcheck,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nbt-cpp";
version = "0-unstable-2026-05-05";
src = lib.cleanSource ./.;
nativeBuildInputs = [
meson
ninja
pkg-config
cppcheck
];
postPatch = ''
substituteInPlace meson.build \
--replace-fail "version : run_command('git', 'describe', '--abbrev=0', '--tags').stdout().strip()," \
"version : '${finalAttrs.version}',"
'';
doCheck = true;
meta = {
description = "NBT library and converter for C++17";
homepage = "https://github.com/HandTruth/nbt-cpp";
license = lib.licenses.mit;
maintainers = [ ];
platforms = lib.platforms.unix;
};
})