minetest: update to 5.1.0 and build on Darwin

authored by Roman Plášil and committed by Profpatsch fb285f21 24720dd2

+106 -5
+1 -1
pkgs/development/libraries/irrlicht/default.nix
··· 29 29 homepage = http://irrlicht.sourceforge.net/; 30 30 license = stdenv.lib.licenses.zlib; 31 31 description = "Open source high performance realtime 3D engine written in C++"; 32 - platforms = stdenv.lib.platforms.linux; 32 + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 33 33 }; 34 34 }
+50
pkgs/development/libraries/irrlicht/mac.nix
··· 1 + { stdenv, fetchzip, libGLU, libGL, unzip, fetchFromGitHub, cmake, Cocoa, OpenGL, IOKit }: 2 + 3 + let 4 + version = "1.8.4"; 5 + 6 + irrlichtZip = fetchzip { 7 + name = "irrlichtZip"; 8 + url = "mirror://sourceforge/irrlicht/irrlicht-${version}.zip"; 9 + sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f"; 10 + }; 11 + 12 + in 13 + 14 + stdenv.mkDerivation rec { 15 + pname = "irrlicht-mac"; 16 + inherit version; 17 + 18 + src = fetchFromGitHub { 19 + owner = "quiark"; 20 + repo = "IrrlichtCMake"; 21 + rev = "523a5e6ef84be67c3014f7b822b97acfced536ce"; 22 + sha256 = "10ahnry2zl64wphs233gxhvs6c0345pyf5nwa29mc6yn49x7bidi"; 23 + }; 24 + 25 + postUnpack = '' 26 + cp -r ${irrlichtZip}/* $sourceRoot/ 27 + chmod -R 777 $sourceRoot 28 + ''; 29 + 30 + patches = [ ./mac_device.patch ]; 31 + dontFixCmake = true; 32 + 33 + cmakeFlags = [ 34 + "-DIRRLICHT_STATIC_LIBRARY=ON" 35 + "-DIRRLICHT_BUILD_EXAMPLES=OFF" 36 + "-DIRRLICHT_INSTALL_MEDIA_FILES=OFF" 37 + "-DIRRLICHT_ENABLE_X11_SUPPORT=OFF" 38 + "-DIRRLICHT_BUILD_TOOLS=OFF" 39 + ]; 40 + 41 + nativeBuildInputs = [ cmake ]; 42 + buildInputs = [ unzip OpenGL Cocoa IOKit ]; 43 + 44 + meta = { 45 + homepage = http://irrlicht.sourceforge.net/; 46 + license = stdenv.lib.licenses.zlib; 47 + description = "Open source high performance realtime 3D engine written in C++"; 48 + platforms = stdenv.lib.platforms.darwin; 49 + }; 50 + }
+20
pkgs/development/libraries/irrlicht/mac_device.patch
··· 1 + --- a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm 2 + +++ b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm 3 + @@ -39,7 +39,7 @@ 4 + #include <IOKit/hidsystem/IOHIDUsageTables.h> 5 + #else 6 + /* The header was moved here in Mac OS X 10.1 */ 7 + -#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h> 8 + +#include <IOKit/hid/IOHIDUsageTables.h> 9 + #endif 10 + #include <IOKit/hid/IOHIDLib.h> 11 + #include <IOKit/hid/IOHIDKeys.h> 12 + @@ -496,7 +496,7 @@ 13 + { 14 + [[NSAutoreleasePool alloc] init]; 15 + [NSApplication sharedApplication]; 16 + - [NSApp setDelegate:(id<NSFileManagerDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; 17 + + [NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; 18 + [NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]]; 19 + [NSApp finishLaunching]; 20 + }
+6 -2
pkgs/games/minetest/default.nix
··· 1 1 { stdenv, fetchFromGitHub, cmake, irrlicht, libpng, bzip2, curl, libogg, jsoncpp 2 2 , libjpeg, libXxf86vm, libGLU, libGL, openal, libvorbis, sqlite, luajit 3 3 , freetype, gettext, doxygen, ncurses, graphviz, xorg, gmp, libspatialindex 4 - , leveldb, postgresql, hiredis 4 + , leveldb, postgresql, hiredis, libiconv, OpenGL, OpenAL ? openal, Carbon, Cocoa 5 5 }: 6 6 7 7 with stdenv.lib; ··· 39 39 ] ++ optionals buildClient [ 40 40 "-DOpenGL_GL_PREFERENCE=GLVND" 41 41 ]; 42 + 43 + patches = [ ./fix_wordsize_confusion.patch ]; 42 44 43 45 NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 44 46 ··· 47 49 buildInputs = [ 48 50 irrlicht luajit jsoncpp gettext freetype sqlite curl bzip2 ncurses 49 51 gmp libspatialindex 52 + ] ++ optionals stdenv.isDarwin [ 53 + libiconv OpenGL OpenAL Carbon Cocoa 50 54 ] ++ optionals buildClient [ 51 55 libpng libjpeg libGLU libGL openal libogg libvorbis xorg.libX11 libXxf86vm 52 56 ] ++ optionals buildServer [ ··· 62 66 homepage = http://minetest.net/; 63 67 description = "Infinite-world block sandbox game"; 64 68 license = licenses.lgpl21Plus; 65 - platforms = platforms.linux; 69 + platforms = platforms.linux ++ platforms.darwin; 66 70 maintainers = with maintainers; [ pyrolagus fpletz ]; 67 71 }; 68 72 };
+10
pkgs/games/minetest/disable_fixup.patch
··· 1 + --- a/src/CMakeLists.txt 2 + +++ b/src/CMakeLists.txt 3 + @@ -802,7 +802,6 @@ 4 + install(CODE " 5 + set(BU_CHMOD_BUNDLE_ITEMS ON) 6 + include(BundleUtilities) 7 + - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${BUNDLE_PATH}\" \"\" \"\${CMAKE_INSTALL_PREFIX}/${BINDIR}\") 8 + " COMPONENT Runtime) 9 + endif() 10 +
+10
pkgs/games/minetest/fix_wordsize_confusion.patch
··· 1 + --- a/src/main.cpp 2 + +++ b/src/main.cpp 3 + @@ -17,6 +17,7 @@ 4 + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 5 + */ 6 + 7 + +#include <cstdint> 8 + #include "irrlicht.h" // createDevice 9 + #include "irrlichttypes_extrabloated.h" 10 + #include "chat_interface.h"
+9 -2
pkgs/top-level/all-packages.nix
··· 12075 12075 12076 12076 ip2location-c = callPackage ../development/libraries/ip2location-c { }; 12077 12077 12078 - irrlicht = callPackage ../development/libraries/irrlicht { }; 12078 + irrlicht = if !stdenv.isDarwin then 12079 + callPackage ../development/libraries/irrlicht { } 12080 + else callPackage ../development/libraries/irrlicht/mac.nix { 12081 + inherit (darwin.apple_sdk.frameworks) Cocoa OpenGL IOKit; 12082 + }; 12079 12083 12080 12084 isocodes = callPackage ../development/libraries/iso-codes { }; 12081 12085 ··· 23266 23270 23267 23271 multimc = libsForQt5.callPackage ../games/multimc { }; 23268 23272 23269 - inherit (callPackages ../games/minetest { }) 23273 + inherit (callPackages ../games/minetest { 23274 + inherit (darwin) libiconv; 23275 + inherit (darwin.apple_sdk.frameworks) OpenGL OpenAL Carbon Cocoa; 23276 + }) 23270 23277 minetestclient_4 minetestserver_4 23271 23278 minetestclient_5 minetestserver_5; 23272 23279