ja2-stracciatella: clean up and modernize

authored by TomaSajt and committed by Alyssa Ross 6f5506cd 882709be

+20 -13
+20 -13
pkgs/by-name/ja/ja2-stracciatella/package.nix
··· 15 }: 16 17 let 18 - stringTheoryUrl = "https://github.com/zrax/string_theory/archive/3.1.tar.gz"; 19 stringTheory = fetchurl { 20 - url = stringTheoryUrl; 21 - sha256 = "1flq26kkvx2m1yd38ldcq2k046yqw07jahms8a6614m924bmbv41"; 22 }; 23 in 24 stdenv.mkDerivation rec { ··· 28 src = fetchFromGitHub { 29 owner = "ja2-stracciatella"; 30 repo = "ja2-stracciatella"; 31 - rev = "v${version}"; 32 - sha256 = "0m6rvgkba29jy3yq5hs1sn26mwrjl6mamqnv4plrid5fqaivhn6j"; 33 }; 34 35 patches = [ 36 # Note: this patch is only relevant for darwin 37 ./dont-use-vendored-sdl2.patch 38 ]; 39 40 nativeBuildInputs = [ 41 cmake ··· 64 hash = "sha256-zkctR16QIjCTiDmrhFqPPOThbPwsm0T0nlnCekkXNN8="; 65 }; 66 67 - preConfigure = '' 68 - # Patch dependencies that are usually loaded by url 69 - substituteInPlace dependencies/lib-string_theory/builder/CMakeLists.txt.in \ 70 - --replace ${stringTheoryUrl} file://${stringTheory} 71 - 72 - cmakeFlagsArray+=("-DLOCAL_RAPIDJSON_LIB=OFF" "-DLOCAL_GTEST_LIB=OFF" "-DEXTRA_DATA_DIR=$out/share/ja2") 73 - ''; 74 75 # error: 'uint64_t' does not name a type 76 # gcc13 and above don't automatically include cstdint 77 env.CXXFLAGS = "-include cstdint"; 78 79 doInstallCheck = true; 80 installCheckPhase = '' 81 - HOME=/tmp $out/bin/ja2 -unittests 82 ''; 83 84 meta = { 85 description = "Jagged Alliance 2, with community fixes"; 86 license = "SFI Source Code license agreement"; 87 homepage = "https://ja2-stracciatella.github.io/"; 88 }; 89 }
··· 15 }: 16 17 let 18 stringTheory = fetchurl { 19 + url = "https://github.com/zrax/string_theory/archive/3.1.tar.gz"; 20 + hash = "sha256-gexVFxGpkmCMQrpCJQ/g2BsCpsCsUTSaD1X0PacRmLo="; 21 }; 22 in 23 stdenv.mkDerivation rec { ··· 27 src = fetchFromGitHub { 28 owner = "ja2-stracciatella"; 29 repo = "ja2-stracciatella"; 30 + tag = "v${version}"; 31 + hash = "sha256-0li4o8KutJjpJdviqqqhMvNqhNVBw4L98DIJtebb2VQ="; 32 }; 33 34 patches = [ 35 # Note: this patch is only relevant for darwin 36 ./dont-use-vendored-sdl2.patch 37 ]; 38 + 39 + postPatch = '' 40 + # Patch dependencies that are usually loaded by url 41 + substituteInPlace dependencies/lib-string_theory/builder/CMakeLists.txt.in \ 42 + --replace-fail ${stringTheory.url} file://${stringTheory} 43 + ''; 44 + 45 + strictDeps = true; 46 47 nativeBuildInputs = [ 48 cmake ··· 71 hash = "sha256-zkctR16QIjCTiDmrhFqPPOThbPwsm0T0nlnCekkXNN8="; 72 }; 73 74 + cmakeFlags = [ 75 + (lib.cmakeBool "LOCAL_RAPIDJSON_LIB" false) 76 + (lib.cmakeBool "LOCAL_GTEST_LIB" false) 77 + (lib.cmakeFeature "EXTRA_DATA_DIR" "${placeholder "out"}/share/ja2") 78 + ]; 79 80 # error: 'uint64_t' does not name a type 81 # gcc13 and above don't automatically include cstdint 82 env.CXXFLAGS = "-include cstdint"; 83 84 doInstallCheck = true; 85 + 86 installCheckPhase = '' 87 + HOME=$(mktemp -d) $out/bin/ja2 -unittests 88 ''; 89 90 meta = { 91 description = "Jagged Alliance 2, with community fixes"; 92 license = "SFI Source Code license agreement"; 93 homepage = "https://ja2-stracciatella.github.io/"; 94 + maintainers = [ ]; 95 }; 96 }