mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
openttd: fix cross-compilation
This commit is contained in:
parent
045f0b2c79
commit
17effa31a8
1 changed files with 22 additions and 5 deletions
|
@ -34,6 +34,7 @@
|
||||||
alsa-lib,
|
alsa-lib,
|
||||||
libjack2,
|
libjack2,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
|
buildPackages,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -51,6 +52,18 @@ let
|
||||||
url = "https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip";
|
url = "https://cdn.openttd.org/openmsx-releases/0.4.2/openmsx-0.4.2-all.zip";
|
||||||
hash = "sha256-Cgrg2m+uTODFg39mKgX+hE8atV7v5bVyZd716vSZB8M=";
|
hash = "sha256-Cgrg2m+uTODFg39mKgX+hE8atV7v5bVyZd716vSZB8M=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# OpenTTD builds and uses some of its own tools during the build and we need those to be available for cross-compilation.
|
||||||
|
# Build the tools for buildPlatform with minimal dependencies, using the "OPTION_TOOLS_ONLY" flag.
|
||||||
|
crossTools = buildPackages.openttd.overrideAttrs (oldAttrs: {
|
||||||
|
pname = "openttd-tools";
|
||||||
|
buildInputs = [ ];
|
||||||
|
cmakeFlags = oldAttrs.cmakeFlags or [ ] ++ [ (lib.cmakeBool "OPTION_TOOLS_ONLY" true) ];
|
||||||
|
installPhase = ''
|
||||||
|
install -Dm555 src/strgen/strgen -t $out/bin
|
||||||
|
install -Dm555 src/settingsgen/settingsgen -t $out/bin
|
||||||
|
'';
|
||||||
|
});
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "openttd";
|
pname = "openttd";
|
||||||
|
@ -71,11 +84,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs =
|
||||||
cmake
|
[
|
||||||
pkg-config
|
cmake
|
||||||
makeWrapper
|
pkg-config
|
||||||
];
|
makeWrapper
|
||||||
|
]
|
||||||
|
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||||
|
crossTools
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[
|
[
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue