From dfdc09bbe31a76417baa6606236f91b115e38c22 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Mon, 27 Jan 2025 00:35:16 +0100 Subject: [PATCH] ja2-stracciatella: 0.17.0 -> 0.21.0 --- .../dont-use-vendored-sdl2.patch | 6 ++-- pkgs/by-name/ja/ja2-stracciatella/package.nix | 33 +++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/ja/ja2-stracciatella/dont-use-vendored-sdl2.patch b/pkgs/by-name/ja/ja2-stracciatella/dont-use-vendored-sdl2.patch index bf2a44062d41..ca95503404d4 100644 --- a/pkgs/by-name/ja/ja2-stracciatella/dont-use-vendored-sdl2.patch +++ b/pkgs/by-name/ja/ja2-stracciatella/dont-use-vendored-sdl2.patch @@ -9,9 +9,9 @@ index e4e5547af..a3017d197 100644 -if(APPLE) - file(GLOB APPLE_DIST_FILES "${CMAKE_CURRENT_SOURCE_DIR}/assets/distr-files-mac/*.txt") - install(FILES ${APPLE_DIST_FILES} DESTINATION .) -- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/lib-SDL2-2.0.8-macos/SDL2.framework DESTINATION .) +- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/dependencies/lib-SDL2-2.0.20-macos/SDL2.framework DESTINATION .) -endif() - - ## Uninstall + ## Build AppImage - add_custom_templated_target("uninstall") + add_custom_target(package-appimage diff --git a/pkgs/by-name/ja/ja2-stracciatella/package.nix b/pkgs/by-name/ja/ja2-stracciatella/package.nix index 4ea0e8a1f587..3fb6f4dea863 100644 --- a/pkgs/by-name/ja/ja2-stracciatella/package.nix +++ b/pkgs/by-name/ja/ja2-stracciatella/package.nix @@ -10,25 +10,33 @@ rustc, SDL2, fltk, + lua5_3, + miniaudio, rapidjson, + sol2, gtest, }: let stringTheory = fetchurl { - url = "https://github.com/zrax/string_theory/archive/3.1.tar.gz"; - hash = "sha256-gexVFxGpkmCMQrpCJQ/g2BsCpsCsUTSaD1X0PacRmLo="; + url = "https://github.com/zrax/string_theory/archive/3.8.tar.gz"; + hash = "sha256-mq7pW3qRZs03/SijzbTl1txJHCSW/TO+gvRLWZh/11M="; + }; + + magicEnum = fetchurl { + url = "https://github.com/Neargye/magic_enum/archive/v0.8.2.zip"; + hash = "sha256-oQ+mUDB8YJULcSploz+0bprJbqclhc+p/Pmsn1AsAes="; }; in stdenv.mkDerivation rec { pname = "ja2-stracciatella"; - version = "0.17.0"; + version = "0.21.0"; src = fetchFromGitHub { owner = "ja2-stracciatella"; repo = "ja2-stracciatella"; tag = "v${version}"; - hash = "sha256-0li4o8KutJjpJdviqqqhMvNqhNVBw4L98DIJtebb2VQ="; + hash = "sha256-zMCFDMSKcsYz5LjW8UJbBlSmuJX6ibr9zIS3BgZMgAg="; }; patches = [ @@ -40,6 +48,8 @@ stdenv.mkDerivation rec { # Patch dependencies that are usually loaded by url substituteInPlace dependencies/lib-string_theory/builder/CMakeLists.txt.in \ --replace-fail ${stringTheory.url} file://${stringTheory} + substituteInPlace dependencies/lib-magic_enum/getter/CMakeLists.txt.in \ + --replace-fail ${magicEnum.url} file://${magicEnum} ''; strictDeps = true; @@ -55,32 +65,35 @@ stdenv.mkDerivation rec { buildInputs = [ SDL2 fltk + lua5_3 rapidjson + sol2 gtest ]; cargoRoot = "rust"; - cargoDeps = rustPlatform.fetchCargoTarball { + cargoDeps = rustPlatform.fetchCargoVendor { inherit pname version src cargoRoot ; - hash = "sha256-zkctR16QIjCTiDmrhFqPPOThbPwsm0T0nlnCekkXNN8="; + hash = "sha256-5KZa5ocn6Q4qUeRmm7Tymgg09dr6aZoAuJvtF32CXNg="; }; cmakeFlags = [ + (lib.cmakeBool "FLTK_SKIP_FLUID" true) # otherwise `find_package(FLTK)` fails + (lib.cmakeBool "LOCAL_LUA_LIB" false) + (lib.cmakeBool "LOCAL_MINIAUDIO_LIB" false) + (lib.cmakeFeature "MINIAUDIO_INCLUDE_DIR" "${miniaudio}") (lib.cmakeBool "LOCAL_RAPIDJSON_LIB" false) + (lib.cmakeBool "LOCAL_SOL_LIB" false) (lib.cmakeBool "LOCAL_GTEST_LIB" false) (lib.cmakeFeature "EXTRA_DATA_DIR" "${placeholder "out"}/share/ja2") ]; - # error: 'uint64_t' does not name a type - # gcc13 and above don't automatically include cstdint - env.CXXFLAGS = "-include cstdint"; - doInstallCheck = true; installCheckPhase = ''