Merge pull request #156334 from fgaz/vengi-tools/0.0.17

vengi-tools: 0.0.14 -> 0.0.17 and related changes
This commit is contained in:
Manuel Bärenz 2022-02-04 10:04:19 +01:00 committed by GitHub
commit 16e16240cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 38 deletions

View file

@ -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;
};
}

View file

@ -0,0 +1,15 @@
{ stdenv
, vengi-tools
}:
stdenv.mkDerivation {
name = "vengi-tools-test-voxconvert-all-formats";
meta.timeout = 10;
buildCommand = ''
mkdir $out
for format in vox qef qbt qb vxm vxr binvox gox cub vxl csv; do
echo Testing $format export
${vengi-tools}/bin/vengi-voxconvert --input ${vengi-tools}/share/vengi-voxedit/chr_knight.qb --output $out/chr_knight.$format
done
'';
}

View file

@ -1,15 +0,0 @@
{ stdenv
, vengi-tools
}:
stdenv.mkDerivation {
name = "vengi-tools-test-voxconvert-roundtrip";
meta.timeout = 10;
buildCommand = ''
${vengi-tools}/bin/vengi-voxconvert ${vengi-tools}/share/vengi-voxedit/chr_knight.qb chr_knight.vox
${vengi-tools}/bin/vengi-voxconvert chr_knight.vox chr_knight.qb
${vengi-tools}/bin/vengi-voxconvert chr_knight.qb chr_knight1.vox
diff chr_knight.vox chr_knight1.vox
touch $out
'';
}

View file

@ -29531,7 +29531,7 @@ with pkgs;
vdpauinfo = callPackage ../tools/X11/vdpauinfo { };
vengi-tools = callPackage ../applications/graphics/vengi-tools {
inherit (darwin.apple_sdk.frameworks) Carbon OpenCL;
inherit (darwin.apple_sdk.frameworks) Carbon CoreServices OpenCL;
};
verbiste = callPackage ../applications/misc/verbiste {