From 5641c103cd1146833e7608e4422e8b7a9e76abaf Mon Sep 17 00:00:00 2001 From: marius david Date: Fri, 5 Nov 2021 18:10:59 +0100 Subject: [PATCH 1/4] recastnavigation: init at 2021-03-05 --- .../libraries/recastnavigation/default.nix | 27 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/libraries/recastnavigation/default.nix diff --git a/pkgs/development/libraries/recastnavigation/default.nix b/pkgs/development/libraries/recastnavigation/default.nix new file mode 100644 index 000000000000..d39d1a713219 --- /dev/null +++ b/pkgs/development/libraries/recastnavigation/default.nix @@ -0,0 +1,27 @@ +{ stdenv, lib, fetchFromGitHub, cmake, libGL, SDL2, libGLU }: + +stdenv.mkDerivation rec { + pname = "recastai"; + # use latest revision for the CMake build process and OpenMW + # OpenMW use e75adf86f91eb3082220085e42dda62679f9a3ea + version = "unstable-2021-03-05"; + + src = fetchFromGitHub { + owner = "recastnavigation"; + repo = "recastnavigation"; + rev = "c5cbd53024c8a9d8d097a4371215e3342d2fdc87"; + sha256 = "sha256-QP3lMMFR6fiKQTksAkRL6X9yaoVz2xt4QSIP9g6piww="; + }; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ libGL SDL2 libGLU ]; + + meta = with lib; { + homepage = "https://github.com/recastnavigation/recastnavigation"; + description = "Navigation-mesh Toolset for Games"; + license = licenses.zlib; + maintainers = with maintainers; [ marius851000 ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ca55821a01eb..3663ebf41a16 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -19200,6 +19200,8 @@ with pkgs; readosm = callPackage ../development/libraries/readosm { }; + recastnavigation = callPackage ../development/libraries/recastnavigation { }; + rinutils = callPackage ../development/libraries/rinutils { }; kissfft = callPackage ../development/libraries/kissfft { }; From 0d7268648eae7fbb9d05a2c76c893e84a6a0116d Mon Sep 17 00:00:00 2001 From: marius david Date: Fri, 5 Nov 2021 18:33:09 +0100 Subject: [PATCH 2/4] collada-dom: init at rdiankov-2020-01-03 --- .../libraries/collada-dom/default.nix | 35 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/libraries/collada-dom/default.nix diff --git a/pkgs/development/libraries/collada-dom/default.nix b/pkgs/development/libraries/collada-dom/default.nix new file mode 100644 index 000000000000..1cb5c4853969 --- /dev/null +++ b/pkgs/development/libraries/collada-dom/default.nix @@ -0,0 +1,35 @@ +{ stdenv, lib, fetchFromGitHub, cmake, boost, libxml2, minizip, readline }: + +stdenv.mkDerivation { + pname = "collada-dom"; + version = "unstable-2020-01-03"; + + src = fetchFromGitHub { + owner = "rdiankov"; + repo = "collada-dom"; + rev = "c1e20b7d6ff806237030fe82f126cb86d661f063"; + sha256 = "sha256-A1ne/D6S0shwCzb9spd1MoSt/238HWA8dvgd+DC9cXc="; + }; + + postInstall = '' + chmod +w -R $out + ln -s $out/include/*/* $out/include + ''; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ + boost + libxml2 + minizip + readline + ]; + + meta = with lib; { + description = "Lightweight version of collada-dom, with only the parser."; + homepage = "https://github.com/rdiankov/collada-dom"; + license = licenses.mit; + maintainers = with maintainers; [ marius851000 ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3663ebf41a16..26cfd72ec40e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15818,6 +15818,8 @@ with pkgs; cointop = callPackage ../applications/misc/cointop { }; + collada-dom = callPackage ../development/libraries/collada-dom { }; + cog = callPackage ../development/web/cog { }; cosmopolitan = callPackage ../development/libraries/cosmopolitan { }; From 84dbadf81a0ab6291c978452d2479f5014cfd08d Mon Sep 17 00:00:00 2001 From: marius david Date: Fri, 5 Nov 2021 19:27:15 +0100 Subject: [PATCH 3/4] openscenegraph: fix collada support --- pkgs/development/libraries/openscenegraph/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/openscenegraph/default.nix b/pkgs/development/libraries/openscenegraph/default.nix index 6b446882ba13..6ed7d846de20 100644 --- a/pkgs/development/libraries/openscenegraph/default.nix +++ b/pkgs/development/libraries/openscenegraph/default.nix @@ -2,6 +2,7 @@ libX11, libXinerama, libXrandr, libGLU, libGL, glib, ilmbase, libxml2, pcre, zlib, AGL, Carbon, Cocoa, Foundation, + boost, jpegSupport ? true, libjpeg, exrSupport ? false, openexr, gifSupport ? true, giflib, @@ -9,7 +10,7 @@ tiffSupport ? true, libtiff, gdalSupport ? false, gdal, curlSupport ? true, curl, - colladaSupport ? false, opencollada, + colladaSupport ? false, collada-dom, opencascadeSupport ? false, opencascade, ffmpegSupport ? false, ffmpeg, nvttSupport ? false, nvidia-texture-tools, @@ -20,7 +21,7 @@ lasSupport ? false, libLAS, luaSupport ? false, lua, sdlSupport ? false, SDL2, - restSupport ? false, asio, boost, + restSupport ? false, asio, withApps ? false, withExamples ? false, fltk, wxGTK, }: @@ -48,7 +49,7 @@ stdenv.mkDerivation rec { ++ lib.optional tiffSupport libtiff ++ lib.optional gdalSupport gdal ++ lib.optional curlSupport curl - ++ lib.optional colladaSupport opencollada + ++ lib.optional colladaSupport collada-dom ++ lib.optional opencascadeSupport opencascade ++ lib.optional ffmpegSupport ffmpeg ++ lib.optional nvttSupport nvidia-texture-tools @@ -59,9 +60,10 @@ stdenv.mkDerivation rec { ++ lib.optional lasSupport libLAS ++ lib.optional luaSupport lua ++ lib.optional sdlSupport SDL2 - ++ lib.optionals restSupport [ asio boost ] + ++ lib.optional restSupport asio ++ lib.optionals withExamples [ fltk wxGTK ] ++ lib.optionals stdenv.isDarwin [ AGL Carbon Cocoa Foundation ] + ++ lib.optional (restSupport || colladaSupport) boost ; cmakeFlags = lib.optional (!withApps) "-DBUILD_OSG_APPLICATIONS=OFF" ++ lib.optional withExamples "-DBUILD_OSG_EXAMPLES=ON"; From 36e16d6979bec9ab3458b88a1a8804a975dadc8d Mon Sep 17 00:00:00 2001 From: marius david Date: Tue, 9 Nov 2021 20:56:25 +0100 Subject: [PATCH 4/4] openmw: 0.46 -> 0.47 --- pkgs/games/openmw/default.nix | 45 +++++++++++++++++++++++++---------- pkgs/games/openmw/tes3mp.nix | 9 ++++++- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/pkgs/games/openmw/default.nix b/pkgs/games/openmw/default.nix index cfde63ac7264..edc8147a2b77 100644 --- a/pkgs/games/openmw/default.nix +++ b/pkgs/games/openmw/default.nix @@ -13,29 +13,46 @@ , unshield , openal , libXt +, lz4 +, recastnavigation }: let - openscenegraph_ = openscenegraph.overrideDerivation (self: { + openscenegraph_openmw = (openscenegraph.override { colladaSupport = true; }) + .overrideDerivation (self: { + src = fetchFromGitHub { + owner = "OpenMW"; + repo = "osg"; + rev = "bbe61c3bc510a4f5bb4aea21cce506519c2d24e6"; + sha256 = "sha256-t3smLqstp7wWfi9HXJoBCek+3acqt/ySBYF8RJOG6Mo="; + }; + }); + + bullet_openmw = bullet.overrideDerivation (old: rec { + version = "3.17"; src = fetchFromGitHub { - owner = "OpenMW"; - repo = "osg"; - # commit does not exist on any branch on the target repository - rev = "1556cd7966ebc1c80b6626988d2b25fb43a744cf"; - sha256 = "0d74hijzmj82nx3jkv5qmr3pkgvplra0b8fbjx1y3vmzxamb0axd"; + owner = "bulletphysics"; + repo = "bullet3"; + rev = version; + sha256 = "sha256-uQ4X8F8nmagbcFh0KexrmnhHIXFSB3A1CCnjPVeHL3Q="; }; + patches = []; + cmakeFlags = (old.cmakeFlags or []) ++ [ + "-DUSE_DOUBLE_PRECISION=ON" + "-DBULLET2_MULTITHREADING=ON" + ]; }); in mkDerivation rec { - version = "0.46.0"; pname = "openmw"; + version = "0.47.0"; src = fetchFromGitHub { owner = "OpenMW"; repo = "openmw"; rev = "${pname}-${version}"; - sha256 = "0rm32zsmxvr6b0jjihfj543skhicbw5kg6shjx312clhlm035w2x"; + sha256 = "sha256-Xq9hDUTCQr79Zzjk0CsiXclVTHK6nrSowukIQqVdrKY="; }; nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ]; @@ -43,26 +60,28 @@ mkDerivation rec { buildInputs = [ SDL2 boost - bullet + bullet_openmw ffmpeg libXt mygui openal - openscenegraph_ + openscenegraph_openmw unshield + lz4 + recastnavigation ]; cmakeFlags = [ - "-DDESIRED_QT_VERSION:INT=5" # as of 0.46, openmw is broken with GLVND "-DOpenGL_GL_PREFERENCE=LEGACY" + "-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1" ]; meta = with lib; { description = "An unofficial open source engine reimplementation of the game Morrowind"; - homepage = "http://openmw.org"; + homepage = "https://openmw.org"; license = licenses.gpl3Plus; - maintainers = with maintainers; [ abbradar ]; + maintainers = with maintainers; [ abbradar marius851000 ]; platforms = platforms.linux; }; } diff --git a/pkgs/games/openmw/tes3mp.nix b/pkgs/games/openmw/tes3mp.nix index 72b698ceb730..37ad603d7cf5 100644 --- a/pkgs/games/openmw/tes3mp.nix +++ b/pkgs/games/openmw/tes3mp.nix @@ -9,6 +9,7 @@ , symlinkJoin , mygui , crudini +, bullet }: # revisions are taken from https://github.com/GrimKriegor/TES3MP-deploy @@ -70,7 +71,8 @@ let nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ makeWrapper ]; - buildInputs = oldAttrs.buildInputs ++ [ luajit ]; + buildInputs = (builtins.map (x: if x.pname or "" == "bullet" then bullet else x) oldAttrs.buildInputs) + ++ [ luajit ]; cmakeFlags = oldAttrs.cmakeFlags ++ [ "-DBUILD_OPENCS=OFF" @@ -79,6 +81,11 @@ let "-DRakNet_LIBRARY_DEBUG=${raknet}/lib/libRakNetLibStatic.a" ]; + prePatch = '' + substituteInPlace components/process/processinvoker.cpp \ + --replace "\"./\"" "\"$out/bin/\"" + ''; + # https://github.com/TES3MP/openmw-tes3mp/issues/552 patches = [ ./tes3mp.patch ];