diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-04-01 15:50:50 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-04-01 15:50:50 +0000 |
commit | 75eafe97f7df0d653bec67f3962214d7c357831f (patch) | |
tree | 09f2cc901e0e637876cbb78d192dfe2fcfef8156 /nixpkgs/pkgs/development/libraries/irrlicht | |
parent | a53b121bf4331497da63df3b1b7f1a7897dad146 (diff) | |
parent | a2e06fc3423c4be53181b15c28dfbe0bcf67dd73 (diff) | |
download | nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.gz nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.bz2 nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.lz nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.xz nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.zst nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.zip |
Merge commit 'a2e06fc3423c4be53181b15c28dfbe0bcf67dd73'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/irrlicht')
4 files changed, 81 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/common.nix b/nixpkgs/pkgs/development/libraries/irrlicht/common.nix new file mode 100644 index 000000000000..f330c30fda11 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/irrlicht/common.nix @@ -0,0 +1,11 @@ +{ fetchzip }: + +rec { + pname = "irrlicht"; + version = "1.8.4"; + + src = fetchzip { + url = "mirror://sourceforge/irrlicht/${pname}-${version}.zip"; + sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f"; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/default.nix b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix index 788772888c6d..f411ecdeea65 100644 --- a/nixpkgs/pkgs/development/libraries/irrlicht/default.nix +++ b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix @@ -1,14 +1,14 @@ { stdenv, fetchzip, libGLU, libGL, unzip, libXrandr, libX11, libXxf86vm }: +let + common = import ./common.nix { inherit fetchzip; }; +in stdenv.mkDerivation rec { - pname = "irrlicht"; - version = "1.8.4"; + pname = common.pname; + version = common.version; - src = fetchzip { - url = "mirror://sourceforge/irrlicht/${pname}-${version}.zip"; - sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f"; - }; + src = common.src; preConfigure = '' cd source/Irrlicht @@ -29,6 +29,6 @@ stdenv.mkDerivation rec { homepage = http://irrlicht.sourceforge.net/; license = stdenv.lib.licenses.zlib; description = "Open source high performance realtime 3D engine written in C++"; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; }; } diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix b/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix new file mode 100644 index 000000000000..beead1f9b857 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix @@ -0,0 +1,43 @@ +{ stdenv, fetchzip, libGLU, libGL, unzip, fetchFromGitHub, cmake, Cocoa, OpenGL, IOKit }: + +let + common = import ./common.nix { inherit fetchzip; }; +in + +stdenv.mkDerivation rec { + pname = "irrlicht-mac"; + version = common.version; + + src = fetchFromGitHub { + owner = "quiark"; + repo = "IrrlichtCMake"; + rev = "523a5e6ef84be67c3014f7b822b97acfced536ce"; + sha256 = "10ahnry2zl64wphs233gxhvs6c0345pyf5nwa29mc6yn49x7bidi"; + }; + + postUnpack = '' + cp -r ${common.src}/* $sourceRoot/ + chmod -R 777 $sourceRoot + ''; + + patches = [ ./mac_device.patch ]; + dontFixCmake = true; + + cmakeFlags = [ + "-DIRRLICHT_STATIC_LIBRARY=ON" + "-DIRRLICHT_BUILD_EXAMPLES=OFF" + "-DIRRLICHT_INSTALL_MEDIA_FILES=OFF" + "-DIRRLICHT_ENABLE_X11_SUPPORT=OFF" + "-DIRRLICHT_BUILD_TOOLS=OFF" + ]; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ unzip OpenGL Cocoa IOKit ]; + + meta = { + homepage = http://irrlicht.sourceforge.net/; + license = stdenv.lib.licenses.zlib; + description = "Open source high performance realtime 3D engine written in C++"; + platforms = stdenv.lib.platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch b/nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch new file mode 100644 index 000000000000..dc68c509975c --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch @@ -0,0 +1,20 @@ +--- a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm ++++ b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm +@@ -39,7 +39,7 @@ + #include <IOKit/hidsystem/IOHIDUsageTables.h> + #else + /* The header was moved here in Mac OS X 10.1 */ +-#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h> ++#include <IOKit/hid/IOHIDUsageTables.h> + #endif + #include <IOKit/hid/IOHIDLib.h> + #include <IOKit/hid/IOHIDKeys.h> +@@ -496,7 +496,7 @@ + { + [[NSAutoreleasePool alloc] init]; + [NSApplication sharedApplication]; +- [NSApp setDelegate:(id<NSFileManagerDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; ++ [NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]]; + [NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]]; + [NSApp finishLaunching]; + } |