From e175845d6171778ff49b615b5ed7a08dda1387b4 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 23 Jan 2022 15:36:47 +0100 Subject: [PATCH 1/5] vengi-tools: 0.0.14 -> 0.0.17 --- .../graphics/vengi-tools/default.nix | 30 ++++++++++++++++--- .../vengi-tools/test-voxconvert-roundtrip.nix | 6 ++-- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix index 00b3d80adf04..96d3c35cb278 100644 --- a/pkgs/applications/graphics/vengi-tools/default.nix +++ b/pkgs/applications/graphics/vengi-tools/default.nix @@ -2,6 +2,7 @@ , stdenv , fetchFromGitHub , fetchurl +, writeText , cmake , pkg-config @@ -18,6 +19,7 @@ , libuuid , wayland-protocols , Carbon +, CoreServices # optionals , opencl-headers , OpenCL @@ -39,15 +41,33 @@ let cmake3_22 = cmake.overrideAttrs (old: { in stdenv.mkDerivation rec { pname = "vengi-tools"; - version = "0.0.14"; + version = "0.0.17"; src = fetchFromGitHub { owner = "mgerhardy"; repo = "engine"; 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 pkg-config @@ -69,7 +89,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 +102,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 @@ -115,5 +135,7 @@ in stdenv.mkDerivation rec { 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; }; } diff --git a/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix b/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix index 27b0305615a8..3d324d2c38d4 100644 --- a/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix +++ b/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix @@ -6,9 +6,9 @@ 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 + ${vengi-tools}/bin/vengi-voxconvert --input ${vengi-tools}/share/vengi-voxedit/chr_knight.qb --output chr_knight.vox + ${vengi-tools}/bin/vengi-voxconvert --input chr_knight.vox --output chr_knight.qb + ${vengi-tools}/bin/vengi-voxconvert --input chr_knight.qb --output chr_knight1.vox diff chr_knight.vox chr_knight1.vox touch $out ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cf403030224f..88c0e971fac0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -29238,7 +29238,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 { From c1366d7fb90ad2939f949dadb97ba5a9d00541d5 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 23 Jan 2022 15:37:15 +0100 Subject: [PATCH 2/5] vengi-tools: unpin cmake vengi-tools needed >=3.22, and the cmake package is now 3.22.1 --- .../graphics/vengi-tools/default.nix | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix index 96d3c35cb278..09e1672f6d84 100644 --- a/pkgs/applications/graphics/vengi-tools/default.nix +++ b/pkgs/applications/graphics/vengi-tools/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, fetchurl , writeText , cmake @@ -28,18 +27,7 @@ , 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.17"; @@ -69,7 +57,7 @@ in stdenv.mkDerivation rec { '')]; nativeBuildInputs = [ - cmake3_22 + cmake pkg-config ninja python3 From 8ed1c056225502e3662c8b7ff0fd6e9181b79727 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Tue, 28 Dec 2021 16:24:31 +0100 Subject: [PATCH 3/5] vengi-tools: add convert all formats test --- .../applications/graphics/vengi-tools/default.nix | 1 + .../vengi-tools/test-voxconvert-all-formats.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/applications/graphics/vengi-tools/test-voxconvert-all-formats.nix diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix index 09e1672f6d84..688bbcb046ea 100644 --- a/pkgs/applications/graphics/vengi-tools/default.nix +++ b/pkgs/applications/graphics/vengi-tools/default.nix @@ -106,6 +106,7 @@ stdenv.mkDerivation rec { passthru.tests = { voxconvert-roundtrip = callPackage ./test-voxconvert-roundtrip.nix {}; + voxconvert-all-formats = callPackage ./test-voxconvert-all-formats.nix {}; run-voxedit = nixosTests.vengi-tools; }; diff --git a/pkgs/applications/graphics/vengi-tools/test-voxconvert-all-formats.nix b/pkgs/applications/graphics/vengi-tools/test-voxconvert-all-formats.nix new file mode 100644 index 000000000000..00cdf8ae6f07 --- /dev/null +++ b/pkgs/applications/graphics/vengi-tools/test-voxconvert-all-formats.nix @@ -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 + ''; +} From 50dae31a148317bdf892cffb4e6b03d038cb2b49 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 23 Jan 2022 16:50:21 +0100 Subject: [PATCH 4/5] vengi-tools: remove failing roundtrip test --- .../applications/graphics/vengi-tools/default.nix | 4 +++- .../vengi-tools/test-voxconvert-roundtrip.nix | 15 --------------- 2 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix index 688bbcb046ea..b2aef5ed650a 100644 --- a/pkgs/applications/graphics/vengi-tools/default.nix +++ b/pkgs/applications/graphics/vengi-tools/default.nix @@ -105,7 +105,9 @@ 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; }; diff --git a/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix b/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix deleted file mode 100644 index 3d324d2c38d4..000000000000 --- a/pkgs/applications/graphics/vengi-tools/test-voxconvert-roundtrip.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ stdenv -, vengi-tools -}: - -stdenv.mkDerivation { - name = "vengi-tools-test-voxconvert-roundtrip"; - meta.timeout = 10; - buildCommand = '' - ${vengi-tools}/bin/vengi-voxconvert --input ${vengi-tools}/share/vengi-voxedit/chr_knight.qb --output chr_knight.vox - ${vengi-tools}/bin/vengi-voxconvert --input chr_knight.vox --output chr_knight.qb - ${vengi-tools}/bin/vengi-voxconvert --input chr_knight.qb --output chr_knight1.vox - diff chr_knight.vox chr_knight1.vox - touch $out - ''; -} From 97c0ce62adf48106ce9f5eec5225944068f2988c Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Tue, 1 Feb 2022 18:14:37 +0100 Subject: [PATCH 5/5] vengi-tools: update repo and website URLs engine -> vengi --- pkgs/applications/graphics/vengi-tools/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/graphics/vengi-tools/default.nix b/pkgs/applications/graphics/vengi-tools/default.nix index b2aef5ed650a..70cbabb4e796 100644 --- a/pkgs/applications/graphics/vengi-tools/default.nix +++ b/pkgs/applications/graphics/vengi-tools/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "mgerhardy"; - repo = "engine"; + repo = "vengi"; rev = "v${version}"; sha256 = "sha256-h+R9L0BBD3NSFWUh43g4V2LBcNyqVInBeJiOLY03nRk="; }; @@ -121,8 +121,8 @@ 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;