|
|
|
@@ -1,7 +1,7 @@
|
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, fetchurl
|
|
|
|
|
, writeText
|
|
|
|
|
|
|
|
|
|
, cmake
|
|
|
|
|
, pkg-config
|
|
|
|
@@ -18,6 +18,7 @@
|
|
|
|
|
, libuuid
|
|
|
|
|
, wayland-protocols
|
|
|
|
|
, Carbon
|
|
|
|
|
, CoreServices
|
|
|
|
|
# optionals
|
|
|
|
|
, opencl-headers
|
|
|
|
|
, OpenCL
|
|
|
|
@@ -26,30 +27,37 @@
|
|
|
|
|
, nixosTests
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
# cmake 3.21 inserts invalid `ldd` and `-Wl,--no-as-needed` calls, apparently
|
|
|
|
|
# related to
|
|
|
|
|
# https://cmake.org/cmake/help/v3.21/prop_tgt/LINK_WHAT_YOU_USE.html
|
|
|
|
|
let cmake3_22 = cmake.overrideAttrs (old: {
|
|
|
|
|
version = "3.22.0";
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "https://cmake.org/files/v3.22/cmake-3.22.0.tar.gz";
|
|
|
|
|
sha256 = "sha256-mYx7o0d40t/bPfimlUaeJLEeK/oh++QbNho/ReHJNF4=";
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "vengi-tools";
|
|
|
|
|
version = "0.0.14";
|
|
|
|
|
version = "0.0.17";
|
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "mgerhardy";
|
|
|
|
|
repo = "engine";
|
|
|
|
|
repo = "vengi";
|
|
|
|
|
rev = "v${version}";
|
|
|
|
|
sha256 = "sha256-v82hKskTSwM0NDgLVHpHZNRQW6tWug4pPIt91MrUwUo=";
|
|
|
|
|
sha256 = "sha256-h+R9L0BBD3NSFWUh43g4V2LBcNyqVInBeJiOLY03nRk=";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Patch from the project's author for fixing an issue with AnimationShaders.h
|
|
|
|
|
# not being included when turning off some components
|
|
|
|
|
patches = [(writeText "vengi-tools-fix-build.patch" ''
|
|
|
|
|
diff --git a/src/modules/voxelworldrender/CMakeLists.txt b/src/modules/voxelworldrender/CMakeLists.txt
|
|
|
|
|
index aebe5f97b..903e62b37 100644
|
|
|
|
|
--- a/src/modules/voxelworldrender/CMakeLists.txt
|
|
|
|
|
+++ b/src/modules/voxelworldrender/CMakeLists.txt
|
|
|
|
|
@@ -27,7 +27,7 @@ set(FILES
|
|
|
|
|
voxel/models/plants/3.qb
|
|
|
|
|
voxel/models/plants/4.qb
|
|
|
|
|
)
|
|
|
|
|
-engine_add_module(TARGET ''${LIB} SRCS ''${SRCS} ''${SRCS_SHADERS} FILES ''${FILES} DEPENDENCIES frontend voxelrender)
|
|
|
|
|
+engine_add_module(TARGET ''${LIB} SRCS ''${SRCS} ''${SRCS_SHADERS} FILES ''${FILES} DEPENDENCIES animation frontend voxelrender)
|
|
|
|
|
generate_shaders(''${LIB} world water postprocess)
|
|
|
|
|
|
|
|
|
|
set(TEST_SRCS
|
|
|
|
|
'')];
|
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
cmake3_22
|
|
|
|
|
cmake
|
|
|
|
|
pkg-config
|
|
|
|
|
ninja
|
|
|
|
|
python3
|
|
|
|
@@ -69,7 +77,7 @@ in stdenv.mkDerivation rec {
|
|
|
|
|
#libpqxx
|
|
|
|
|
#mosquitto
|
|
|
|
|
] ++ lib.optional stdenv.isLinux wayland-protocols
|
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Carbon OpenCL ]
|
|
|
|
|
++ lib.optionals stdenv.isDarwin [ Carbon CoreServices OpenCL ]
|
|
|
|
|
++ lib.optional (!stdenv.isDarwin) opencl-headers;
|
|
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
@@ -82,7 +90,7 @@ in stdenv.mkDerivation rec {
|
|
|
|
|
"-DGAMES=OFF"
|
|
|
|
|
"-DMAPVIEW=OFF"
|
|
|
|
|
"-DAIDEBUG=OFF"
|
|
|
|
|
];
|
|
|
|
|
] ++ lib.optional stdenv.isDarwin "-DCORESERVICES_LIB=${CoreServices}";
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
@@ -97,7 +105,10 @@ in stdenv.mkDerivation rec {
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
passthru.tests = {
|
|
|
|
|
voxconvert-roundtrip = callPackage ./test-voxconvert-roundtrip.nix {};
|
|
|
|
|
# There used to be a roundtrip test here, but it started failing on 0.0.17
|
|
|
|
|
# Relevant upstream ticket:
|
|
|
|
|
# https://github.com/mgerhardy/vengi/issues/113
|
|
|
|
|
voxconvert-all-formats = callPackage ./test-voxconvert-all-formats.nix {};
|
|
|
|
|
run-voxedit = nixosTests.vengi-tools;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -110,10 +121,12 @@ in stdenv.mkDerivation rec {
|
|
|
|
|
filemanager and a command line tool to convert between several voxel
|
|
|
|
|
formats.
|
|
|
|
|
'';
|
|
|
|
|
homepage = "https://mgerhardy.github.io/engine/";
|
|
|
|
|
downloadPage = "https://github.com/mgerhardy/engine/releases";
|
|
|
|
|
homepage = "https://mgerhardy.github.io/vengi/";
|
|
|
|
|
downloadPage = "https://github.com/mgerhardy/vengi/releases";
|
|
|
|
|
license = [ licenses.mit licenses.cc-by-sa-30 ];
|
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
# Requires SDK 10.14 https://github.com/NixOS/nixpkgs/issues/101229
|
|
|
|
|
broken = stdenv.isDarwin && stdenv.isx86_64;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|