diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/deps.json b/pkgs/by-name/mo/modrinth-app-unwrapped/deps.json index a36c1f6b3e9f..63ca31d57eb6 100644 --- a/pkgs/by-name/mo/modrinth-app-unwrapped/deps.json +++ b/pkgs/by-name/mo/modrinth-app-unwrapped/deps.json @@ -126,10 +126,10 @@ "jar": "sha256-hSTqyQ9+jg8TZog/LGyCDJO/ph3z12hXyNPoA89nMV0=", "pom": "sha256-e2qAtqLSZ2oEIvaWg4EyMVQlUfYbMgxochz7nh9ZCdA=" }, - "org/jetbrains/kotlin#kotlin-stdlib/2.0.21": { - "jar": "sha256-8xzFPxBafkjAk2g7vVQ3Vh0SM5IFE3dLRwgFZBvtvAk=", - "module": "sha256-gf1tGBASSH7jJG7/TiustktYxG5bWqcpcaTd8b0VQe0=", - "pom": "sha256-/LraTNLp85ZYKTVw72E3UjMdtp/R2tHKuqYFSEA+F9o=" + "org/jetbrains/kotlin#kotlin-stdlib/2.3.0": { + "jar": "sha256-iHWHyRcTJQrVL+FK2RZtBCwzg1BJiQ6UN/NV/8WhlbE=", + "module": "sha256-CRCoo7aWD8eSxFxWqR18Oj8mKG8DKVVUtRnP83h1baI=", + "pom": "sha256-TVJW0+SETmVrDKQF9jUNbyF5XCQ3WzRSUmxUZ92ZtaI=" }, "org/junit#junit-bom/5.11.4": { "module": "sha256-qaTye+lOmbnVcBYtJGqA9obSd9XTGutUgQR89R2vRuQ=", diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix index 0a09dfcc4d3a..5e87b5f24f3b 100644 --- a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix +++ b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix @@ -5,7 +5,7 @@ cargo-tauri, desktop-file-utils, fetchFromGitHub, - gradle_8, + gradle_9, jdk17, makeBinaryWrapper, makeShellWrapper, @@ -25,7 +25,7 @@ }: let - gradle = gradle_8.override { java = jdk; }; + gradle = gradle_9.override { java = jdk; }; jdk = jdk17; in @@ -61,13 +61,21 @@ rustPlatform.buildRustPackage (finalAttrs: { ./remove-spotless.patch ]; + cargoPatches = [ + # Cidre 0.11.3 currently fails to build on darwin. Updating it to the latest version + # resolves this issue. + # Upstream PR is https://github.com/modrinth/code/pull/5862 + ./update-cidre.patch + ]; + # Let the app know about our actual version number postPatch = '' substituteInPlace {apps/app,packages/app-lib}/Cargo.toml apps/app-frontend/package.json \ --replace-fail '1.0.0-local' '${finalAttrs.version}' ''; - cargoHash = "sha256-Mnb16KO+xcocUuvQN4woUlb1aFNzzwyIeRP4mIcA1Fk="; + cargoHash = "sha256-GwangszzKTEYvflibPgkIyUkHlpfMgenD/mq3my5LIY="; + mitmCache = gradle.fetchDeps { inherit (finalAttrs) pname; data = ./deps.json; @@ -116,6 +124,8 @@ rustPlatform.buildRustPackage (finalAttrs: { env = { TURBO_BINARY_PATH = lib.getExe turbo; + # Cidre requires a target version of at least 10.15 + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-mmacosx-version-min=10.15"; }; preGradleUpdate = '' @@ -170,7 +180,7 @@ rustPlatform.buildRustPackage (finalAttrs: { # This builds on architectures like aarch64, but the launcher itself does not support them yet. # Darwin is the only exception # See https://github.com/modrinth/code/issues/776#issuecomment-1742495678 - broken = !stdenv.hostPlatform.isx86_64 || !stdenv.hostPlatform.isLinux; + broken = !stdenv.hostPlatform.isx86_64 && !stdenv.hostPlatform.isDarwin; sourceProvenance = with lib.sourceTypes; [ fromSource binaryBytecode # mitm cache diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/update-cidre.patch b/pkgs/by-name/mo/modrinth-app-unwrapped/update-cidre.patch new file mode 100644 index 000000000000..ec85dc1a0a52 --- /dev/null +++ b/pkgs/by-name/mo/modrinth-app-unwrapped/update-cidre.patch @@ -0,0 +1,41 @@ +diff --git a/Cargo.lock b/Cargo.lock +index ee2157d44..db41b81a3 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -1572,18 +1572,19 @@ dependencies = [ + + [[package]] + name = "cidre" +-version = "0.11.3" ++version = "0.15.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "0cc0eb4d7faf9f94493eaf7e7c0534dee2dfa9642353382039572abb4e0e56e9" ++checksum = "0c903ff1729987d29e07295d2c5841993db25ff86cca43bee04505878d3ec1a7" + dependencies = [ ++ "cc", + "cidre-macros", + ] + + [[package]] + name = "cidre-macros" +-version = "0.3.0" ++version = "0.5.0" + source = "registry+https://github.com/rust-lang/crates.io-index" +-checksum = "82bc2f84c0baaa09299da3a03864491549685912c1e338a54211e00589dc1e4c" ++checksum = "6facfeffa8b9792dc014bb4e65e364d13518b74e06783d56249810a3e48cfad7" + + [[package]] + name = "cityhash-rs" +diff --git a/Cargo.toml b/Cargo.toml +index 54865d6d3..a09ad3089 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -51,7 +51,7 @@ bytes = "1.10.1" + censor = "0.3.0" + chardetng = "0.1.17" + chrono = "0.4.42" +-cidre = { version = "0.11.3", default-features = false, features = [ ++cidre = { version = "0.15.0", default-features = false, features = [ + "macos_15_0" + ] } + clap = "4.5.48"