Merge pull request #220750 from Netruk44/openmw-darwin-support
openmw: darwin support
This commit is contained in:
commit
47ca1928a0
@ -4,13 +4,13 @@ stdenv.mkDerivation rec {
|
|||||||
pname = "recastai";
|
pname = "recastai";
|
||||||
# use latest revision for the CMake build process and OpenMW
|
# use latest revision for the CMake build process and OpenMW
|
||||||
# OpenMW use e75adf86f91eb3082220085e42dda62679f9a3ea
|
# OpenMW use e75adf86f91eb3082220085e42dda62679f9a3ea
|
||||||
version = "unstable-2021-03-05";
|
version = "unstable-2023-01-02";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "recastnavigation";
|
owner = "recastnavigation";
|
||||||
repo = "recastnavigation";
|
repo = "recastnavigation";
|
||||||
rev = "c5cbd53024c8a9d8d097a4371215e3342d2fdc87";
|
rev = "405cc095ab3a2df976a298421974a2af83843baf";
|
||||||
sha256 = "sha256-QP3lMMFR6fiKQTksAkRL6X9yaoVz2xt4QSIP9g6piww=";
|
sha256 = "sha256-WVzDI7+UuAl10Tm1Zjkea/FMk0cIe7pWg0iyFLbwAdI=";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
@ -20,6 +20,11 @@ stdenv.mkDerivation rec {
|
|||||||
substituteInPlace CMakeLists.txt \
|
substituteInPlace CMakeLists.txt \
|
||||||
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
|
--replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
|
||||||
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
|
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
|
||||||
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||||
|
# Expects SDL2.framework in specific location, which we don't have
|
||||||
|
# Change where SDL2 headers are searched for to match what we do have
|
||||||
|
substituteInPlace RecastDemo/CMakeLists.txt \
|
||||||
|
--replace 'include_directories(''${SDL2_LIBRARY}/Headers)' 'include_directories(${SDL2.dev}/include/SDL2)'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
@ -29,7 +34,6 @@ stdenv.mkDerivation rec {
|
|||||||
buildInputs = [ libGL SDL2 libGLU ];
|
buildInputs = [ libGL SDL2 libGLU ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
broken = stdenv.isDarwin;
|
|
||||||
homepage = "https://github.com/recastnavigation/recastnavigation";
|
homepage = "https://github.com/recastnavigation/recastnavigation";
|
||||||
description = "Navigation-mesh Toolset for Games";
|
description = "Navigation-mesh Toolset for Games";
|
||||||
license = licenses.zlib;
|
license = licenses.zlib;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{ lib
|
{ lib
|
||||||
|
, stdenv
|
||||||
, mkDerivation
|
, mkDerivation
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
@ -16,6 +17,7 @@
|
|||||||
, libXt
|
, libXt
|
||||||
, lz4
|
, lz4
|
||||||
, recastnavigation
|
, recastnavigation
|
||||||
|
, VideoDecodeAcceleration
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -27,6 +29,15 @@ let
|
|||||||
rev = "bbe61c3bc510a4f5bb4aea21cce506519c2d24e6";
|
rev = "bbe61c3bc510a4f5bb4aea21cce506519c2d24e6";
|
||||||
sha256 = "sha256-t3smLqstp7wWfi9HXJoBCek+3acqt/ySBYF8RJOG6Mo=";
|
sha256 = "sha256-t3smLqstp7wWfi9HXJoBCek+3acqt/ySBYF8RJOG6Mo=";
|
||||||
};
|
};
|
||||||
|
patches = [
|
||||||
|
(fetchpatch {
|
||||||
|
# For Darwin, OSG doesn't build some plugins as they're redundant with QuickTime.
|
||||||
|
# OpenMW doesn't like this, and expects them to be there. Apply their patch for it.
|
||||||
|
name = "darwin-osg-plugins-fix.patch";
|
||||||
|
url = "https://gitlab.com/OpenMW/openmw-dep/-/raw/0abe3c9c3858211028d881d7706813d606335f72/macos/osg.patch";
|
||||||
|
sha256 = "sha256-/CLRZofZHot8juH78VG1/qhTHPhy5DoPMN+oH8hC58U=";
|
||||||
|
})
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
bullet_openmw = bullet.overrideDerivation (old: rec {
|
bullet_openmw = bullet.overrideDerivation (old: rec {
|
||||||
@ -65,10 +76,16 @@ mkDerivation rec {
|
|||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
sed '1i#include <memory>' -i components/myguiplatform/myguidatamanager.cpp # gcc12
|
sed '1i#include <memory>' -i components/myguiplatform/myguidatamanager.cpp # gcc12
|
||||||
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
|
# Don't fix Darwin app bundle
|
||||||
|
sed -i '/fixup_bundle/d' CMakeLists.txt
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
|
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
|
||||||
|
|
||||||
|
# If not set, OSG plugin .so files become shell scripts on Darwin.
|
||||||
|
dontWrapQtApps = true;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
SDL2
|
SDL2
|
||||||
boost
|
boost
|
||||||
@ -81,12 +98,16 @@ mkDerivation rec {
|
|||||||
unshield
|
unshield
|
||||||
lz4
|
lz4
|
||||||
recastnavigation
|
recastnavigation
|
||||||
|
] ++ lib.optionals stdenv.isDarwin [
|
||||||
|
VideoDecodeAcceleration
|
||||||
];
|
];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
# as of 0.46, openmw is broken with GLVND
|
# as of 0.46, openmw is broken with GLVND
|
||||||
"-DOpenGL_GL_PREFERENCE=LEGACY"
|
"-DOpenGL_GL_PREFERENCE=LEGACY"
|
||||||
"-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1"
|
"-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1"
|
||||||
|
] ++ lib.optionals stdenv.isDarwin [
|
||||||
|
"-DOPENMW_OSX_DEPLOYMENT=ON"
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
@ -94,6 +115,6 @@ mkDerivation rec {
|
|||||||
homepage = "https://openmw.org";
|
homepage = "https://openmw.org";
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
maintainers = with maintainers; [ abbradar marius851000 ];
|
maintainers = with maintainers; [ abbradar marius851000 ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,6 @@ stdenv.mkDerivation rec {
|
|||||||
description = "Tool and library to extract CAB files from InstallShield installers";
|
description = "Tool and library to extract CAB files from InstallShield installers";
|
||||||
homepage = "https://github.com/twogood/unshield";
|
homepage = "https://github.com/twogood/unshield";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux ++ platforms.darwin;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -35850,7 +35850,9 @@ with pkgs;
|
|||||||
|
|
||||||
openloco = pkgsi686Linux.callPackage ../games/openloco { };
|
openloco = pkgsi686Linux.callPackage ../games/openloco { };
|
||||||
|
|
||||||
openmw = libsForQt5.callPackage ../games/openmw { };
|
openmw = libsForQt5.callPackage ../games/openmw {
|
||||||
|
inherit (darwin.apple_sdk.frameworks) VideoDecodeAcceleration;
|
||||||
|
};
|
||||||
|
|
||||||
openmw-tes3mp = libsForQt5.callPackage ../games/openmw/tes3mp.nix { };
|
openmw-tes3mp = libsForQt5.callPackage ../games/openmw/tes3mp.nix { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user