flightgear: darwin support (#508268)

This commit is contained in:
7c6f434c
2026-04-13 13:35:31 +00:00
committed by GitHub
3 changed files with 52 additions and 30 deletions
@@ -78,7 +78,10 @@ stdenv.mkDerivation {
})
];
cmakeFlags = [ "-DBUILD_OSG_APPLICATIONS=OFF" ];
cmakeFlags = [
(lib.cmakeBool "BUILD_OSG_APPLICATIONS" false)
]
++ lib.optional stdenv.hostPlatform.isDarwin (lib.cmakeFeature "OSG_WINDOWING_SYSTEM" "Cocoa");
meta = {
description = "3D graphics toolkit";
+34 -17
View File
@@ -20,6 +20,7 @@
libxmu,
libxt,
simgear,
xz,
zlib,
boost,
cmake,
@@ -72,15 +73,29 @@ stdenv.mkDerivation rec {
qt5.wrapQtAppsHook
];
buildInputs = [
libglut
freealut
libjpeg
openal
plib
(simgear.override { openscenegraph = openscenegraph; })
zlib
boost
libpng
fltk_1_3
apr
qt5.qtbase
qt5.qtquickcontrols2
glew
qt5.qtdeclarative
curl
openscenegraph
xz
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libglut
libGLU
libGL
libice
libjpeg
openal
openscenegraph
plib
libsm
libunwind
libx11
@@ -89,25 +104,27 @@ stdenv.mkDerivation rec {
libxi
libxmu
libxt
(simgear.override { openscenegraph = openscenegraph; })
zlib
boost
libpng
udev
fltk_1_3
apr
qt5.qtbase
qt5.qtquickcontrols2
glew
qt5.qtdeclarative
curl
];
cmakeFlags = lib.optional stdenv.hostPlatform.isDarwin (
lib.cmakeFeature "CMAKE_OSX_DEPLOYMENT_TARGET" "11.0"
);
qtWrapperArgs = [ "--set FG_ROOT ${data}/share/FlightGear" ];
postInstall = ''
# Remove redundant AppImage artifacts
rm -rf "$out/appdir"
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# The bundle copies OSG dylib dangling symlinks
rm -rf "$out/FlightGear.app/Contents/Frameworks"
# Place app bundle where macOS expects it
mkdir -p "$out/Applications"
mv "$out/FlightGear.app" "$out/Applications/"
# Provide fgfs in bin/ for CLI use, pointing into the bundle
ln -s "$out/Applications/FlightGear.app/Contents/MacOS/FlightGear" "$out/bin/fgfs"
'';
passthru.updateScript = nix-update-script { };
@@ -118,7 +135,7 @@ stdenv.mkDerivation rec {
raskin
kirillrdy
];
platforms = lib.platforms.linux;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
hydraPlatforms = [ ]; # disabled from hydra because it's so big
license = lib.licenses.gpl2Plus;
mainProgram = "fgfs";
+14 -12
View File
@@ -14,7 +14,7 @@
libxmu,
libGLU,
libGL,
boost179,
boost,
zlib,
libjpeg,
freealut,
@@ -44,6 +44,18 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ cmake ];
buildInputs = [
plib
boost
zlib
libjpeg
freealut
openscenegraph
openal
expat
apr
curl
xz
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libglut
xorgproto
libx11
@@ -55,16 +67,6 @@ stdenv.mkDerivation (finalAttrs: {
libxmu
libGLU
libGL
boost179
zlib
libjpeg
freealut
openscenegraph
openal
expat
apr
curl
xz
];
propagatedBuildInputs = [ c-ares ];
@@ -73,7 +75,7 @@ stdenv.mkDerivation (finalAttrs: {
description = "Simulation construction toolkit";
homepage = "https://wiki.flightgear.org/SimGear";
maintainers = with lib.maintainers; [ raskin ];
platforms = lib.platforms.linux;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
license = lib.licenses.lgpl2;
};
})