Skip to content

Commit 0bdbef6

Browse files
committed
dxvk,vkd3d-proton: use submodules with v4 npins format
1 parent 923e530 commit 0bdbef6

File tree

5 files changed

+80
-32
lines changed

5 files changed

+80
-32
lines changed

npins/default.nix

+55-20
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,80 @@ let
33
data = builtins.fromJSON (builtins.readFile ./sources.json);
44
version = data.version;
55

6-
mkSource = spec:
7-
assert spec ? type; let
6+
mkSource =
7+
spec:
8+
assert spec ? type;
9+
let
810
path =
9-
if spec.type == "Git" then mkGitSource spec
10-
else if spec.type == "GitRelease" then mkGitSource spec
11-
else if spec.type == "PyPi" then mkPyPiSource spec
12-
else if spec.type == "Channel" then mkChannelSource spec
13-
else builtins.throw "Unknown source type ${spec.type}";
11+
if spec.type == "Git" then
12+
mkGitSource spec
13+
else if spec.type == "GitRelease" then
14+
mkGitSource spec
15+
else if spec.type == "PyPi" then
16+
mkPyPiSource spec
17+
else if spec.type == "Channel" then
18+
mkChannelSource spec
19+
else
20+
builtins.throw "Unknown source type ${spec.type}"
21+
;
1422
in
1523
spec // { outPath = path; };
1624

17-
mkGitSource = { repository, revision, url ? null, hash, ... }:
25+
mkGitSource =
26+
{
27+
repository,
28+
revision,
29+
url ? null,
30+
submodules,
31+
hash,
32+
...
33+
}:
1834
assert repository ? type;
1935
# At the moment, either it is a plain git repository (which has an url), or it is a GitHub/GitLab repository
2036
# In the latter case, there we will always be an url to the tarball
21-
if url != null then
22-
(builtins.fetchTarball {
37+
if url != null && !submodules then
38+
builtins.fetchTarball {
2339
inherit url;
2440
sha256 = hash; # FIXME: check nix version & use SRI hashes
25-
})
26-
else assert repository.type == "Git"; builtins.fetchGit {
27-
url = repository.url;
28-
rev = revision;
29-
# hash = hash;
30-
};
41+
}
42+
else
43+
let
44+
url =
45+
if repository.type == "Git" then
46+
repository.url
47+
else if repository.type == "GitHub" then
48+
"https://github.com/${repository.owner}/${repository.repo}.git"
49+
else if repository.type == "GitLab" then
50+
"${repository.server}/${repository.repo_path}.git"
51+
else
52+
throw "Invalid JSON file"
53+
;
54+
in
55+
builtins.fetchGit {
56+
rev = revision;
57+
# hash = hash;
58+
inherit url submodules;
59+
}
60+
;
3161

32-
mkPyPiSource = { url, hash, ... }:
62+
mkPyPiSource =
63+
{ url, hash, ... }:
3364
builtins.fetchurl {
3465
inherit url;
3566
sha256 = hash;
3667
};
3768

38-
mkChannelSource = { url, hash, ... }:
69+
mkChannelSource =
70+
{ url, hash, ... }:
3971
builtins.fetchTarball {
4072
inherit url;
4173
sha256 = hash;
4274
};
4375
in
44-
if version == 3 then
76+
if version == 4 then
4577
builtins.mapAttrs (_: mkSource) data.pins
4678
else
47-
throw "Unsupported format version ${toString version} in sources.json. Try running `npins upgrade`"
79+
throw
80+
"Unsupported format version ${
81+
toString version
82+
} in sources.json. Try running `npins upgrade`"

npins/sources.json

+19-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"pre_releases": false,
1111
"version_upper_bound": null,
12+
"submodules": false,
1213
"version": "v2023.10.0",
1314
"revision": "3cea4439c25285c282bc2a7e7caa989780a1bdeb",
1415
"url": "https://api.github.com/repos/FAForever/downlords-faf-client/tarball/v2023.10.0",
@@ -23,6 +24,7 @@
2324
},
2425
"pre_releases": true,
2526
"version_upper_bound": null,
27+
"submodules": false,
2628
"version": "v2023.10.1-alpha-1",
2729
"revision": "5ba10c41e889ad31c200e08db7cef0cab74939e0",
2830
"url": "https://api.github.com/repos/FAForever/downlords-faf-client/tarball/v2023.10.1-alpha-1",
@@ -36,11 +38,12 @@
3638
"repo": "dxvk"
3739
},
3840
"pre_releases": false,
39-
"version_upper_bound": null,
40-
"version": "v2.3",
41-
"revision": "f328343a23c9ad4af9148c06a0f75a77242c0457",
42-
"url": "https://api.github.com/repos/doitsujin/dxvk/tarball/v2.3",
43-
"hash": "1ykqbgsp22fsaca24ryiav9mgvqvw10rjbgi264mx1nl3yj6w0pi"
41+
"version_upper_bound": "2.1",
42+
"submodules": true,
43+
"version": "v2.0",
44+
"revision": "1f31c4e0e9865d028014c6976c9c2c991b19a109",
45+
"url": null,
46+
"hash": "01hhg70kapnva592kd6wbs6y9c3gcpjfx5cm1azgkchbhaz4a8wr"
4447
},
4548
"dxvk-async": {
4649
"type": "GitRelease",
@@ -51,6 +54,7 @@
5154
},
5255
"pre_releases": false,
5356
"version_upper_bound": null,
57+
"submodules": false,
5458
"version": "2.0",
5559
"revision": "8665e600c04f9df2958f1b7aa348fa63f2ae24a9",
5660
"url": "https://api.github.com/repos/Sporif/dxvk-async/tarball/2.0",
@@ -65,6 +69,7 @@
6569
},
6670
"pre_releases": false,
6771
"version_upper_bound": null,
72+
"submodules": false,
6873
"version": "v3.3.2",
6974
"revision": "2807bf94ad0dea9df950cd0277918c72c15ea3ee",
7075
"url": "https://api.github.com/repos/FAForever/java-ice-adapter/tarball/v3.3.2",
@@ -79,6 +84,7 @@
7984
},
8085
"pre_releases": false,
8186
"version_upper_bound": null,
87+
"submodules": false,
8288
"version": "v4.0.5",
8389
"revision": "5a2c98d2213492287b724429707f0bc7f6fa017f",
8490
"url": "https://api.github.com/repos/FAForever/uid/tarball/v4.0.5",
@@ -93,6 +99,7 @@
9399
},
94100
"pre_releases": false,
95101
"version_upper_bound": null,
102+
"submodules": false,
96103
"version": "2023.1026.0",
97104
"revision": "dbf0b2e318b6ead068b7f71848d1cd8e0fcd9148",
98105
"url": "https://api.github.com/repos/ppy/osu/tarball/2023.1026.0",
@@ -106,6 +113,7 @@
106113
"repo": "proton-wine"
107114
},
108115
"branch": "Proton8-22",
116+
"submodules": false,
109117
"revision": "d5a97061ec96dbbceccec3a7f3ba54b39738fbdd",
110118
"url": "https://github.com/GloriousEggroll/proton-wine/archive/d5a97061ec96dbbceccec3a7f3ba54b39738fbdd.tar.gz",
111119
"hash": "1fdj8jawh7jip4i0aiqr1x0hln5hydrrnzx2yacyv6d4fwhjnvvx"
@@ -119,10 +127,11 @@
119127
},
120128
"pre_releases": false,
121129
"version_upper_bound": null,
130+
"submodules": true,
122131
"version": "v2.10",
123132
"revision": "88e4f300cc0b5b6f0880c1233d562cf506b546fb",
124-
"url": "https://api.github.com/repos/HansKristian-Work/vkd3d-proton/tarball/v2.10",
125-
"hash": "12835ym6hvf29l4a5giysxr79z6kn134zx4i10cwc2g2qirlyz9p"
133+
"url": null,
134+
"hash": "1jlpd0am2282ryb84824ibsn0cxjjw62871ahhd6h0n74mn7kjl5"
126135
},
127136
"wine-discord-ipc-bridge": {
128137
"type": "GitRelease",
@@ -133,6 +142,7 @@
133142
},
134143
"pre_releases": false,
135144
"version_upper_bound": null,
145+
"submodules": false,
136146
"version": "v0.0.2",
137147
"revision": "dd649284cdbb41927e504b122a478aa5ae5ece60",
138148
"url": "https://api.github.com/repos/0e4ef622/wine-discord-ipc-bridge/tarball/v0.0.2",
@@ -146,10 +156,11 @@
146156
"repo": "wine-tkg"
147157
},
148158
"branch": "master",
159+
"submodules": false,
149160
"revision": "f4aed6f69f1a7d3e9482677b959524551e2aaab9",
150161
"url": "https://github.com/Kron4ek/wine-tkg/archive/f4aed6f69f1a7d3e9482677b959524551e2aaab9.tar.gz",
151162
"hash": "0b0407qjd2vks9ngwz90gkbldf7ypa7qd6snj0mv0dz4cbmrcs0s"
152163
}
153164
},
154-
"version": 3
165+
"version": 4
155166
}

pkgs/dxvk/default.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ in
3636
mesonFlags = ["--buildtype=release"];
3737

3838
postInstall = lib.optionalString stdenv.targetPlatform.isWindows ''
39-
ln -s ${windows.mcfgthreads}/bin/mcfgthread-12.dll $out/bin/mcfgthread-12.dll
39+
[ -f ${windows.mcfgthreads_pre_gcc_13}/bin/mcfgthread-12.dll ]
40+
ln -s ${windows.mcfgthreads_pre_gcc_13}/bin/mcfgthread-12.dll $out/bin/mcfgthread-12.dll
4041
'';
4142

4243
src = dxvk;

pkgs/vkd3d-proton/default.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ stdenv.mkDerivation {
3939
];
4040

4141
postInstall = lib.optionalString stdenv.targetPlatform.isWindows ''
42-
ln -s ${windows.mcfgthreads}/bin/mcfgthread-12.dll $out/bin/mcfgthread-12.dll
42+
[ -f ${windows.mcfgthreads_pre_gcc_13}/bin/mcfgthread-12.dll ]
43+
ln -s ${windows.mcfgthreads_pre_gcc_13}/bin/mcfgthread-12.dll $out/bin/mcfgthread-12.dll
4344
'';
4445

4546
mesonFlags =

pkgs/wineprefix-preparer/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ writeShellScriptBin "wineprefix-preparer"
3636
echo "Found 32 bit path $win32_sys_path and 64 bit path $win64_sys_path"
3737
3838
echo "Removing existing dxvk and vkd3d-proton DLLs"
39-
rm -rf {"$win32_sys_path","$win64_sys_path"}/{dxgi,d3d9,d3d10core,d3d11,d3d12}.dll
39+
rm -rf {"$win32_sys_path","$win64_sys_path"}/{dxgi,d3d9,d3d10core,d3d11,d3d12,d3d12core}.dll
4040
4141
echo "Installing dxvk DLLs"
4242
install -v -D -m644 -t "$win64_sys_path" ${dxvk-w64}/bin/*.dll
@@ -47,7 +47,7 @@ writeShellScriptBin "wineprefix-preparer"
4747
install -v -D -m644 -t "$win32_sys_path" ${vkd3d-proton-w32}/bin/*.dll
4848
4949
echo "Adding native DllOverrides"
50-
for dll in dxgi d3d9 d3d10core d3d11 d3d12; do
50+
for dll in dxgi d3d9 d3d10core d3d11 d3d12 d3d12core; do
5151
wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $dll /d native /f >/dev/null 2>&1
5252
done
5353
''

0 commit comments

Comments
 (0)