cargo-ui: unbreak on darwin

figsoda e3e4dbd7 d1fdabc1

+115 -9
+20 -6
pkgs/development/tools/rust/cargo-ui/default.nix
··· 1 1 { lib 2 2 , rustPlatform 3 3 , fetchCrate 4 - , cmake 5 4 , pkg-config 6 5 , makeWrapper 6 + , libgit2 7 7 , openssl 8 8 , stdenv 9 + , expat 9 10 , fontconfig 10 11 , libGL 11 12 , xorg 13 + , darwin 12 14 }: 13 15 14 16 rustPlatform.buildRustPackage rec { ··· 20 22 sha256 = "sha256-IL7BxiJg6eTuFM0pJ3qLxYCVofE/RjmgQjvOW96QF9A="; 21 23 }; 22 24 23 - cargoSha256 = "sha256-16mgp7GsjbizzCWN3MDpl6ps9CK1zdIpLiyNiKYjDI4="; 25 + # update dependencies so it is compatible with libgit2 1.5 26 + # libgit2-sys 0.14.3 is only compatible with libgit2 1.4 27 + cargoPatches = [ ./update-git2.patch ]; 24 28 25 - nativeBuildInputs = [ cmake pkg-config ] ++ lib.optionals stdenv.isLinux [ 29 + cargoSha256 = "sha256-i/ERVPzAWtN4884051VoA/ItypyURpHb/Py6w3KDOAo="; 30 + 31 + nativeBuildInputs = [ 32 + pkg-config 33 + ] ++ lib.optionals stdenv.isLinux [ 26 34 makeWrapper 27 35 ]; 28 36 29 - buildInputs = [ openssl ] ++ lib.optionals stdenv.isLinux [ 37 + buildInputs = [ 38 + libgit2 39 + openssl 40 + ] ++ lib.optionals stdenv.isLinux [ 41 + expat 30 42 fontconfig 31 43 libGL 32 44 xorg.libX11 ··· 34 46 xorg.libXi 35 47 xorg.libXrandr 36 48 xorg.libxcb 49 + ] ++ lib.optionals stdenv.isDarwin [ 50 + # dark-light doesn't build on apple sdk < 10.14 51 + # see https://github.com/frewsxcv/rust-dark-light/issues/14 52 + darwin.apple_sdk_11_0.frameworks.AppKit 37 53 ]; 38 54 39 55 postInstall = lib.optionalString stdenv.isLinux '' ··· 47 63 changelog = "https://github.com/slint-ui/cargo-ui/blob/v${version}/CHANGELOG.md"; 48 64 license = with licenses; [ mit asl20 gpl3Only ]; 49 65 maintainers = with maintainers; [ figsoda ]; 50 - # figsoda: I can't figure how to make it build on darwin 51 - broken = stdenv.isDarwin; 52 66 }; 53 67 }
+94
pkgs/development/tools/rust/cargo-ui/update-git2.patch
··· 1 + --- a/Cargo.lock 2 + +++ b/Cargo.lock 3 + @@ -720,9 +720,9 @@ dependencies = [ 4 + 5 + [[package]] 6 + name = "crates-index" 7 + -version = "0.18.7" 8 + +version = "0.18.10" 9 + source = "registry+https://github.com/rust-lang/crates.io-index" 10 + -checksum = "0044896374c388ccbf1497dad6384bf6111dbcad9d7069506df7450ce9b62ea3" 11 + +checksum = "3447ec855b0c44cad8eedb3d32b53837f233894d5f4584a2648a7ebc5d3feef4" 12 + dependencies = [ 13 + "git2", 14 + "hex", 15 + @@ -1387,9 +1387,9 @@ dependencies = [ 16 + 17 + [[package]] 18 + name = "git2" 19 + -version = "0.14.3" 20 + +version = "0.15.0" 21 + source = "registry+https://github.com/rust-lang/crates.io-index" 22 + -checksum = "5e77a14ffc6ba4ad5188d6cf428894c4fcfda725326b37558f35bb677e712cec" 23 + +checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" 24 + dependencies = [ 25 + "bitflags", 26 + "libc", 27 + @@ -1884,9 +1884,9 @@ checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" 28 + 29 + [[package]] 30 + name = "libgit2-sys" 31 + -version = "0.13.3+1.4.2" 32 + +version = "0.14.0+1.5.0" 33 + source = "registry+https://github.com/rust-lang/crates.io-index" 34 + -checksum = "c24d36c3ac9b9996a2418d6bf428cc0bc5d1a814a84303fc60986088c5ed60de" 35 + +checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b" 36 + dependencies = [ 37 + "cc", 38 + "libc", 39 + @@ -2712,9 +2712,9 @@ dependencies = [ 40 + 41 + [[package]] 42 + name = "rayon" 43 + -version = "1.5.2" 44 + +version = "1.5.3" 45 + source = "registry+https://github.com/rust-lang/crates.io-index" 46 + -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" 47 + +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" 48 + dependencies = [ 49 + "autocfg", 50 + "crossbeam-deque", 51 + diff --git a/Cargo.toml b/Cargo.toml 52 + index ca5269d..6fa4ec2 100644 53 + --- a/Cargo.toml 54 + +++ b/Cargo.toml 55 + @@ -33,7 +33,7 @@ version = "1.0.53" 56 + version = "0.14" 57 + 58 + [dependencies.crates-index] 59 + -version = "0.18.0" 60 + +version = "0.18.10" 61 + 62 + [dependencies.dunce] 63 + version = "1.0.2" 64 + @@ -42,7 +42,7 @@ version = "1.0.2" 65 + version = "0.3" 66 + 67 + [dependencies.git2] 68 + -version = "0.14.3" 69 + +version = "0.15.0" 70 + 71 + [dependencies.itertools] 72 + version = "0.10" 73 + diff --git a/Cargo.toml.orig b/Cargo.toml.orig 74 + index 52eadbd..ef8aa7c 100644 75 + --- a/Cargo.toml.orig 76 + +++ b/Cargo.toml.orig 77 + @@ -22,7 +22,7 @@ default = ["slint-backend-qt", "slint-backend-gl-all"] 78 + [dependencies] 79 + anyhow = "1.0.53" 80 + cargo_metadata = "0.14" 81 + -crates-index = { version = "0.18.0" } 82 + +crates-index = { version = "0.18.10" } 83 + dunce = "1.0.2" 84 + futures = "0.3" 85 + itertools = "0.10" 86 + @@ -34,7 +34,7 @@ shlex = "1.1" 87 + slint = { version = "0.2.4", default-features = false, features = [ "compat-0-2-0" ] } 88 + tokio = { version = "1.16.1", features= ["full"] } 89 + toml_edit = "0.14.3" 90 + -git2 = "0.14.3" 91 + +git2 = "0.15.0" 92 + 93 + [build-dependencies] 94 + slint-build = { version = "0.2.4" }
+1 -3
pkgs/top-level/all-packages.nix
··· 14915 14915 cargo-udeps = callPackage ../development/tools/rust/cargo-udeps { 14916 14916 inherit (darwin.apple_sdk.frameworks) CoreServices Security SystemConfiguration; 14917 14917 }; 14918 - cargo-ui = callPackage ../development/tools/rust/cargo-ui { 14919 - inherit (darwin.apple_sdk.frameworks); 14920 - }; 14918 + cargo-ui = darwin.apple_sdk_11_0.callPackage ../development/tools/rust/cargo-ui { }; 14921 14919 14922 14920 cargo-tauri = callPackage ../development/tools/rust/cargo-tauri { }; 14923 14921