Skip to content

Commit 4da53df

Browse files
authored
glycin-loaders: Fix cross (NixOS#434878)
2 parents e5058b1 + 4fc6b7b commit 4da53df

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkgs/by-name/gl/glycin-loaders/package.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
ninja,
2121
pkg-config,
2222
rustc,
23+
rustPlatform,
2324
}:
2425

2526
stdenv.mkDerivation (finalAttrs: {
@@ -39,6 +40,8 @@ stdenv.mkDerivation (finalAttrs: {
3940
finalAttrs.passthru.glycinPathsPatch
4041
];
4142

43+
cargoVendorDir = "vendor";
44+
4245
nativeBuildInputs = [
4346
cargo
4447
gettext # for msgfmt
@@ -47,6 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
4750
ninja
4851
pkg-config
4952
rustc
53+
rustPlatform.cargoSetupHook
5054
];
5155

5256
buildInputs = [
@@ -68,6 +72,13 @@ stdenv.mkDerivation (finalAttrs: {
6872

6973
strictDeps = true;
7074

75+
postPatch = ''
76+
substituteInPlace loaders/meson.build \
77+
--replace-fail "cargo_target_dir / rust_target / loader," "cargo_target_dir / '${stdenv.hostPlatform.rust.cargoShortTarget}' / rust_target / loader,"
78+
'';
79+
80+
env.CARGO_BUILD_TARGET = stdenv.hostPlatform.rust.rustcTargetSpec;
81+
7182
passthru = {
7283
updateScript = gnome.updateScript {
7384
attrPath = "glycin-loaders";

0 commit comments

Comments
 (0)