Skip to content

Commit ac429ef

Browse files
authored
vdrift: fix cross build, misc. cleanup (NixOS#373467)
2 parents 6e6ab46 + 0b54253 commit ac429ef

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

pkgs/by-name/vd/vdrift/package.nix

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ let
3434
sha256 = "sha256-DrzRF4WzwEXCNALq0jz8nHWZ1oYTEsdrvSYVYI1WkTI=";
3535
};
3636

37+
postPatch = ''
38+
substituteInPlace src/SConscript \
39+
--replace-fail sdl2-config "${lib.getExe' (lib.getDev SDL2) "sdl2-config"}"
40+
'';
41+
3742
nativeBuildInputs = [
3843
pkg-config
3944
scons
@@ -54,16 +59,19 @@ let
5459
];
5560

5661
buildPhase = ''
57-
sed -i -e s,/usr/local,$out, SConstruct
58-
export CXXFLAGS="$(pkg-config --cflags SDL2_image)"
62+
runHook preBuild
63+
substituteInPlace SConstruct \
64+
--replace-fail /usr/local "$out" \
65+
--replace-fail pkg-config "${stdenv.cc.targetPrefix}pkg-config"
66+
export CXXFLAGS="$(${stdenv.cc.targetPrefix}pkg-config --cflags SDL2_image)"
5967
scons -j$NIX_BUILD_CORES
68+
runHook postBuild
6069
'';
61-
installPhase = "scons install";
6270

6371
meta = {
6472
description = "Car racing game";
6573
mainProgram = "vdrift";
66-
homepage = "http://vdrift.net/";
74+
homepage = "https://vdrift.net/";
6775
license = lib.licenses.gpl2Plus;
6876
maintainers = [ ];
6977
platforms = lib.platforms.linux;

0 commit comments

Comments
 (0)