nixpkgs/pkgs/applications/graphics/vengi-tools/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

119 lines
2.7 KiB
Nix
Raw Normal View History

2021-11-21 11:26:56 +00:00
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, ninja
, python3
, makeWrapper
2024-08-07 14:27:26 +00:00
, backward-cpp
, curl
, enet
, freetype
2021-11-21 11:26:56 +00:00
, glm
2024-08-07 14:27:26 +00:00
, gtest
, libbfd
, libdwarf
, libjpeg
, libuuid
, libuv
2021-11-21 11:26:56 +00:00
, lua5_4
2024-08-07 14:27:26 +00:00
, lzfse
, opencl-headers
2021-11-21 11:26:56 +00:00
, SDL2
, SDL2_mixer
, wayland-protocols
, Carbon
2022-01-23 14:36:47 +00:00
, CoreServices
2021-11-21 11:26:56 +00:00
, OpenCL
, callPackage
2021-11-21 17:09:17 +00:00
, nixosTests
2021-11-21 11:26:56 +00:00
}:
2024-02-19 15:06:22 +00:00
stdenv.mkDerivation (finalAttrs: {
2021-11-21 11:26:56 +00:00
pname = "vengi-tools";
2024-08-07 14:27:26 +00:00
version = "0.0.33";
2021-11-21 11:26:56 +00:00
src = fetchFromGitHub {
owner = "mgerhardy";
repo = "vengi";
2024-02-19 15:06:22 +00:00
rev = "v${finalAttrs.version}";
2024-08-07 14:27:26 +00:00
hash = "sha256-ljB36A5b8K1KBBuQVISb1fkWxb/tTTwojE31KPMg1xQ=";
2021-11-21 11:26:56 +00:00
};
nativeBuildInputs = [
cmake
2021-11-21 11:26:56 +00:00
pkg-config
ninja
python3
makeWrapper
];
buildInputs = [
2024-08-07 14:27:26 +00:00
libbfd
libdwarf
backward-cpp
curl
enet
freetype
2021-11-21 11:26:56 +00:00
glm
2024-08-07 14:27:26 +00:00
libjpeg
libuuid
libuv
2021-11-21 11:26:56 +00:00
lua5_4
2024-08-07 14:27:26 +00:00
lzfse
2021-11-21 11:26:56 +00:00
SDL2
SDL2_mixer
] ++ lib.optional stdenv.isLinux wayland-protocols
2022-01-23 14:36:47 +00:00
++ lib.optionals stdenv.isDarwin [ Carbon CoreServices OpenCL ]
2021-11-21 11:26:56 +00:00
++ lib.optional (!stdenv.isDarwin) opencl-headers;
2024-08-07 14:27:26 +00:00
cmakeFlags =
lib.optional stdenv.isDarwin "-DCORESERVICES_LIB=${CoreServices}";
# error: "The plain signature for target_link_libraries has already been used"
doCheck = false;
checkInputs = [
gtest
];
2021-11-21 11:26:56 +00:00
# Set the data directory for each executable. We cannot set it at build time
# with the PKGDATADIR cmake variable because each executable needs a specific
# one.
# This is not needed on darwin, since on that platform data files are saved
# in *.app/Contents/Resources/ too, and are picked up automatically.
postInstall = lib.optionalString (!stdenv.isDarwin) ''
for prog in $out/bin/*; do
wrapProgram "$prog" \
--set CORE_PATH $out/share/$(basename "$prog")/
done
'';
passthru.tests = {
voxconvert-roundtrip = callPackage ./test-voxconvert-roundtrip.nix {};
voxconvert-all-formats = callPackage ./test-voxconvert-all-formats.nix {};
2021-11-21 17:09:17 +00:00
run-voxedit = nixosTests.vengi-tools;
2021-11-21 11:26:56 +00:00
};
meta = with lib; {
description = "Tools from the vengi voxel engine, including a thumbnailer, a converter, and the VoxEdit voxel editor";
longDescription = ''
Tools from the vengi C++ voxel game engine. It includes a voxel editor
with character animation support and loading/saving into a lot of voxel
volume formats. There are other tools like e.g. a thumbnailer for your
filemanager and a command line tool to convert between several voxel
formats.
'';
homepage = "https://mgerhardy.github.io/vengi/";
downloadPage = "https://github.com/mgerhardy/vengi/releases";
2021-11-21 11:26:56 +00:00
license = [ licenses.mit licenses.cc-by-sa-30 ];
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
2024-08-07 14:27:26 +00:00
broken = stdenv.isDarwin;
2021-11-21 11:26:56 +00:00
};
2024-02-19 15:06:22 +00:00
})