Skip to content

Commit b19c3c8

Browse files
committed
gg-jj: use a patch to enable native-tls
The previous patch was impure, because native-tls and its dependencies weren't locked, and so Cargo would fetch the latest possible versions from the network. This meant that the gg-jj.cargoDeps FOD was broken since the first time native-tls or one of its dependencies released a new version. To do this reproducibly we need to include all the added dependencies in the lockfile.
1 parent 50dd4e3 commit b19c3c8

File tree

2 files changed

+357
-10
lines changed

2 files changed

+357
-10
lines changed
Lines changed: 351 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,351 @@
1+
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
2+
index 37a1a2d..45640a1 100644
3+
--- a/src-tauri/Cargo.lock
4+
+++ b/src-tauri/Cargo.lock
5+
@@ -778,9 +778,9 @@ dependencies = [
6+
"bitflags 2.6.0",
7+
"block",
8+
"cocoa-foundation",
9+
- "core-foundation",
10+
+ "core-foundation 0.10.0",
11+
"core-graphics",
12+
- "foreign-types",
13+
+ "foreign-types 0.5.0",
14+
"libc",
15+
"objc",
16+
]
17+
@@ -793,7 +793,7 @@ checksum = "e14045fb83be07b5acf1c0884b2180461635b433455fa35d1cd6f17f1450679d"
18+
dependencies = [
19+
"bitflags 2.6.0",
20+
"block",
21+
- "core-foundation",
22+
+ "core-foundation 0.10.0",
23+
"core-graphics-types",
24+
"libc",
25+
"objc",
26+
@@ -873,6 +873,16 @@ dependencies = [
27+
"version_check",
28+
]
29+
30+
+[[package]]
31+
+name = "core-foundation"
32+
+version = "0.9.4"
33+
+source = "registry+https://github.com/rust-lang/crates.io-index"
34+
+checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
35+
+dependencies = [
36+
+ "core-foundation-sys",
37+
+ "libc",
38+
+]
39+
+
40+
[[package]]
41+
name = "core-foundation"
42+
version = "0.10.0"
43+
@@ -896,9 +906,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
44+
checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1"
45+
dependencies = [
46+
"bitflags 2.6.0",
47+
- "core-foundation",
48+
+ "core-foundation 0.10.0",
49+
"core-graphics-types",
50+
- "foreign-types",
51+
+ "foreign-types 0.5.0",
52+
"libc",
53+
]
54+
55+
@@ -909,7 +919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
56+
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
57+
dependencies = [
58+
"bitflags 2.6.0",
59+
- "core-foundation",
60+
+ "core-foundation 0.10.0",
61+
"libc",
62+
]
63+
64+
@@ -1435,6 +1445,15 @@ version = "0.1.3"
65+
source = "registry+https://github.com/rust-lang/crates.io-index"
66+
checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2"
67+
68+
+[[package]]
69+
+name = "foreign-types"
70+
+version = "0.3.2"
71+
+source = "registry+https://github.com/rust-lang/crates.io-index"
72+
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
73+
+dependencies = [
74+
+ "foreign-types-shared 0.1.1",
75+
+]
76+
+
77+
[[package]]
78+
name = "foreign-types"
79+
version = "0.5.0"
80+
@@ -1442,7 +1461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
81+
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
82+
dependencies = [
83+
"foreign-types-macros",
84+
- "foreign-types-shared",
85+
+ "foreign-types-shared 0.3.1",
86+
]
87+
88+
[[package]]
89+
@@ -1456,6 +1475,12 @@ dependencies = [
90+
"syn 2.0.87",
91+
]
92+
93+
+[[package]]
94+
+name = "foreign-types-shared"
95+
+version = "0.1.1"
96+
+source = "registry+https://github.com/rust-lang/crates.io-index"
97+
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
98+
+
99+
[[package]]
100+
name = "foreign-types-shared"
101+
version = "0.3.1"
102+
@@ -2779,6 +2804,22 @@ dependencies = [
103+
"want",
104+
]
105+
106+
+[[package]]
107+
+name = "hyper-tls"
108+
+version = "0.6.0"
109+
+source = "registry+https://github.com/rust-lang/crates.io-index"
110+
+checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
111+
+dependencies = [
112+
+ "bytes",
113+
+ "http-body-util",
114+
+ "hyper",
115+
+ "hyper-util",
116+
+ "native-tls",
117+
+ "tokio",
118+
+ "tokio-native-tls",
119+
+ "tower-service",
120+
+]
121+
+
122+
[[package]]
123+
name = "hyper-util"
124+
version = "0.1.10"
125+
@@ -3418,9 +3459,9 @@ dependencies = [
126+
127+
[[package]]
128+
name = "libc"
129+
-version = "0.2.163"
130+
+version = "0.2.164"
131+
source = "registry+https://github.com/rust-lang/crates.io-index"
132+
-checksum = "1fdaeca4cf44ed4ac623e86ef41f056e848dbeab7ec043ecb7326ba300b36fd0"
133+
+checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f"
134+
135+
[[package]]
136+
name = "libgit2-sys"
137+
@@ -3453,7 +3494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
138+
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
139+
dependencies = [
140+
"cfg-if",
141+
- "windows-targets 0.52.6",
142+
+ "windows-targets 0.48.5",
143+
]
144+
145+
[[package]]
146+
@@ -3688,6 +3729,23 @@ dependencies = [
147+
"windows-sys 0.59.0",
148+
]
149+
150+
+[[package]]
151+
+name = "native-tls"
152+
+version = "0.2.13"
153+
+source = "registry+https://github.com/rust-lang/crates.io-index"
154+
+checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c"
155+
+dependencies = [
156+
+ "libc",
157+
+ "log",
158+
+ "openssl",
159+
+ "openssl-probe",
160+
+ "openssl-sys",
161+
+ "schannel",
162+
+ "security-framework",
163+
+ "security-framework-sys",
164+
+ "tempfile",
165+
+]
166+
+
167+
[[package]]
168+
name = "ndk"
169+
version = "0.9.0"
170+
@@ -4065,6 +4123,32 @@ dependencies = [
171+
"pathdiff",
172+
]
173+
174+
+[[package]]
175+
+name = "openssl"
176+
+version = "0.10.69"
177+
+source = "registry+https://github.com/rust-lang/crates.io-index"
178+
+checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e"
179+
+dependencies = [
180+
+ "bitflags 2.6.0",
181+
+ "cfg-if",
182+
+ "foreign-types 0.3.2",
183+
+ "libc",
184+
+ "once_cell",
185+
+ "openssl-macros",
186+
+ "openssl-sys",
187+
+]
188+
+
189+
+[[package]]
190+
+name = "openssl-macros"
191+
+version = "0.1.1"
192+
+source = "registry+https://github.com/rust-lang/crates.io-index"
193+
+checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
194+
+dependencies = [
195+
+ "proc-macro2",
196+
+ "quote",
197+
+ "syn 2.0.87",
198+
+]
199+
+
200+
[[package]]
201+
name = "openssl-probe"
202+
version = "0.1.5"
203+
@@ -4854,19 +4938,23 @@ dependencies = [
204+
"http-body",
205+
"http-body-util",
206+
"hyper",
207+
+ "hyper-tls",
208+
"hyper-util",
209+
"ipnet",
210+
"js-sys",
211+
"log",
212+
"mime",
213+
+ "native-tls",
214+
"once_cell",
215+
"percent-encoding",
216+
"pin-project-lite",
217+
+ "rustls-pemfile",
218+
"serde",
219+
"serde_json",
220+
"serde_urlencoded",
221+
"sync_wrapper",
222+
"tokio",
223+
+ "tokio-native-tls",
224+
"tokio-util 0.7.12",
225+
"tower-service",
226+
"url",
227+
@@ -5000,6 +5088,21 @@ dependencies = [
228+
"windows-sys 0.52.0",
229+
]
230+
231+
+[[package]]
232+
+name = "rustls-pemfile"
233+
+version = "2.2.0"
234+
+source = "registry+https://github.com/rust-lang/crates.io-index"
235+
+checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50"
236+
+dependencies = [
237+
+ "rustls-pki-types",
238+
+]
239+
+
240+
+[[package]]
241+
+name = "rustls-pki-types"
242+
+version = "1.10.0"
243+
+source = "registry+https://github.com/rust-lang/crates.io-index"
244+
+checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b"
245+
+
246+
[[package]]
247+
name = "rustversion"
248+
version = "1.0.18"
249+
@@ -5027,6 +5130,15 @@ version = "0.1.4"
250+
source = "registry+https://github.com/rust-lang/crates.io-index"
251+
checksum = "088c5d71572124929ea7549a8ce98e1a6fd33d0a38367b09027b382e67c033db"
252+
253+
+[[package]]
254+
+name = "schannel"
255+
+version = "0.1.26"
256+
+source = "registry+https://github.com/rust-lang/crates.io-index"
257+
+checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1"
258+
+dependencies = [
259+
+ "windows-sys 0.59.0",
260+
+]
261+
+
262+
[[package]]
263+
name = "schemars"
264+
version = "0.8.21"
265+
@@ -5089,6 +5201,29 @@ version = "4.1.0"
266+
source = "registry+https://github.com/rust-lang/crates.io-index"
267+
checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
268+
269+
+[[package]]
270+
+name = "security-framework"
271+
+version = "2.11.1"
272+
+source = "registry+https://github.com/rust-lang/crates.io-index"
273+
+checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
274+
+dependencies = [
275+
+ "bitflags 2.6.0",
276+
+ "core-foundation 0.9.4",
277+
+ "core-foundation-sys",
278+
+ "libc",
279+
+ "security-framework-sys",
280+
+]
281+
+
282+
+[[package]]
283+
+name = "security-framework-sys"
284+
+version = "2.12.1"
285+
+source = "registry+https://github.com/rust-lang/crates.io-index"
286+
+checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2"
287+
+dependencies = [
288+
+ "core-foundation-sys",
289+
+ "libc",
290+
+]
291+
+
292+
[[package]]
293+
name = "selectors"
294+
version = "0.22.0"
295+
@@ -5436,7 +5571,7 @@ dependencies = [
296+
"bytemuck",
297+
"cfg_aliases",
298+
"core-graphics",
299+
- "foreign-types",
300+
+ "foreign-types 0.5.0",
301+
"js-sys",
302+
"log",
303+
"objc2",
304+
@@ -5631,7 +5766,7 @@ checksum = "6682a07cf5bab0b8a2bd20d0a542917ab928b5edb75ebd4eda6b05cbaab872da"
305+
dependencies = [
306+
"bitflags 2.6.0",
307+
"cocoa",
308+
- "core-foundation",
309+
+ "core-foundation 0.10.0",
310+
"core-graphics",
311+
"crossbeam-channel",
312+
"dispatch",
313+
@@ -6208,6 +6343,16 @@ dependencies = [
314+
"syn 2.0.87",
315+
]
316+
317+
+[[package]]
318+
+name = "tokio-native-tls"
319+
+version = "0.3.1"
320+
+source = "registry+https://github.com/rust-lang/crates.io-index"
321+
+checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
322+
+dependencies = [
323+
+ "native-tls",
324+
+ "tokio",
325+
+]
326+
+
327+
[[package]]
328+
name = "tokio-util"
329+
version = "0.6.10"
330+
@@ -7006,7 +7151,7 @@ version = "0.1.9"
331+
source = "registry+https://github.com/rust-lang/crates.io-index"
332+
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
333+
dependencies = [
334+
- "windows-sys 0.59.0",
335+
+ "windows-sys 0.48.0",
336+
]
337+
338+
[[package]]
339+
diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml
340+
index 550b0cf..9b711a4 100644
341+
--- a/src-tauri/Cargo.toml
342+
+++ b/src-tauri/Cargo.toml
343+
@@ -14,7 +14,7 @@ zip = "0.6"
344+
assert_matches = "1.5"
345+
346+
[dependencies]
347+
-tauri = { version = "2.0.0", features = [] }
348+
+tauri = { version = "2.0.0", features = ["native-tls"] }
349+
tauri-codegen = "2.0.0"
350+
tauri-macros = "2.0.0"
351+
tauri-plugin = "2.0.0"

pkgs/by-name/gg/gg-jj/package.nix

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,18 @@ stdenv.mkDerivation (finalAttrs: {
3232
hash = "sha256-iQxPJgMxBtyindkNdQkehwPf7ZgWCI09PToqs2y1Hfw=";
3333
};
3434

35+
patches = [ ./native-tls.patch ];
3536
cargoRoot = "src-tauri";
3637
buildAndTestSubdir = "src-tauri";
3738

3839
# FIXME: Switch back to cargoHash when https://github.com/NixOS/nixpkgs/issues/356811 is fixed
3940
cargoDeps = rustPlatform.fetchCargoTarball {
40-
inherit (finalAttrs) pname version src;
41+
inherit (finalAttrs) pname version src patches;
42+
# Tries to apply patches inside cargoRoot.
43+
prePatch = "pushd ..";
44+
postPatch = "popd";
4145
sourceRoot = "${finalAttrs.src.name}/${finalAttrs.cargoRoot}";
42-
hash = "sha256-Lr/0GkWHvfDy/leRLxisuTzGPZYFo2beHq9UCl6XlDo=";
43-
44-
nativeBuildInputs = [ yq ];
45-
46-
# Work around https://github.com/rust-lang/cargo/issues/10801
47-
# See https://discourse.nixos.org/t/rust-tauri-v2-error-no-matching-package-found/56751/4
48-
preBuild = ''
49-
tomlq -it '.dependencies.tauri.features += ["native-tls"]' Cargo.toml
50-
'';
46+
hash = "sha256-inwETdMRKmJklkdjkcGuJuHaXwa5GyJEk7zo2r2li+M=";
5147
};
5248

5349
npmDeps = fetchNpmDeps {

0 commit comments

Comments
 (0)