2021-11-21 12:26:56 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-01-23 15:36:47 +01:00
|
|
|
, writeText
|
2021-11-21 12:26:56 +01:00
|
|
|
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, ninja
|
|
|
|
, python3
|
|
|
|
, makeWrapper
|
|
|
|
|
|
|
|
, glm
|
|
|
|
, lua5_4
|
|
|
|
, SDL2
|
|
|
|
, SDL2_mixer
|
|
|
|
, enet
|
|
|
|
, libuv
|
|
|
|
, libuuid
|
|
|
|
, wayland-protocols
|
|
|
|
, Carbon
|
2022-01-23 15:36:47 +01:00
|
|
|
, CoreServices
|
2021-11-21 12:26:56 +01:00
|
|
|
# optionals
|
|
|
|
, opencl-headers
|
|
|
|
, OpenCL
|
|
|
|
|
|
|
|
, callPackage
|
2021-11-21 18:09:17 +01:00
|
|
|
, nixosTests
|
2021-11-21 12:26:56 +01:00
|
|
|
}:
|
|
|
|
|
2022-01-23 15:37:15 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-11-21 12:26:56 +01:00
|
|
|
pname = "vengi-tools";
|
2023-10-17 19:40:53 +02:00
|
|
|
version = "0.0.27";
|
2021-11-21 12:26:56 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mgerhardy";
|
2022-02-01 18:14:37 +01:00
|
|
|
repo = "vengi";
|
2021-11-21 12:26:56 +01:00
|
|
|
rev = "v${version}";
|
2023-10-17 19:40:53 +02:00
|
|
|
hash = "sha256-A37IY66wZZK7Tv0zWsORO6CuRRRj7YmKLnEPSbfAvwI=";
|
2021-11-21 12:26:56 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2022-01-23 15:37:15 +01:00
|
|
|
cmake
|
2021-11-21 12:26:56 +01:00
|
|
|
pkg-config
|
|
|
|
ninja
|
|
|
|
python3
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glm
|
|
|
|
lua5_4
|
|
|
|
SDL2
|
|
|
|
SDL2_mixer
|
|
|
|
enet
|
|
|
|
libuv
|
|
|
|
libuuid
|
|
|
|
# Only needed for the game
|
|
|
|
#postgresql
|
|
|
|
#libpqxx
|
|
|
|
#mosquitto
|
|
|
|
] ++ lib.optional stdenv.isLinux wayland-protocols
|
2022-01-23 15:36:47 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin [ Carbon CoreServices OpenCL ]
|
2021-11-21 12:26:56 +01:00
|
|
|
++ lib.optional (!stdenv.isDarwin) opencl-headers;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
# Disable tests due to a problem in linking gtest:
|
|
|
|
# ld: /build/vengi-tests-core.LDHlV1.ltrans0.ltrans.o: in function `main':
|
|
|
|
# <artificial>:(.text.startup+0x3f): undefined reference to `testing::InitGoogleMock(int*, char**)'
|
|
|
|
"-DUNITTESTS=OFF"
|
|
|
|
"-DVISUALTESTS=OFF"
|
|
|
|
# We're only interested in the generic tools
|
|
|
|
"-DGAMES=OFF"
|
|
|
|
"-DMAPVIEW=OFF"
|
|
|
|
"-DAIDEBUG=OFF"
|
2022-01-23 15:36:47 +01:00
|
|
|
] ++ lib.optional stdenv.isDarwin "-DCORESERVICES_LIB=${CoreServices}";
|
2021-11-21 12:26:56 +01: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 = {
|
2022-02-14 12:03:52 +01:00
|
|
|
voxconvert-roundtrip = callPackage ./test-voxconvert-roundtrip.nix {};
|
2021-12-28 16:24:31 +01:00
|
|
|
voxconvert-all-formats = callPackage ./test-voxconvert-all-formats.nix {};
|
2021-11-21 18:09:17 +01:00
|
|
|
run-voxedit = nixosTests.vengi-tools;
|
2021-11-21 12:26:56 +01: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.
|
|
|
|
'';
|
2022-02-01 18:14:37 +01:00
|
|
|
homepage = "https://mgerhardy.github.io/vengi/";
|
|
|
|
downloadPage = "https://github.com/mgerhardy/vengi/releases";
|
2021-11-21 12:26:56 +01:00
|
|
|
license = [ licenses.mit licenses.cc-by-sa-30 ];
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|