about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/irrlicht
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/irrlicht')
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/common.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/mac.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch20
4 files changed, 112 insertions, 0 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
new file mode 100644
index 000000000000..e283a2909474
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchzip, libGLU, libGL, unzip, libXrandr, libX11, libXxf86vm }:
+
+let
+  common = import ./common.nix { inherit fetchzip; };
+in
+
+stdenv.mkDerivation rec {
+  pname = common.pname;
+  version = common.version;
+
+  src = common.src;
+
+  postPatch = ''
+    sed -ie '/sys\/sysctl.h/d' source/Irrlicht/COSOperator.cpp
+  '';
+
+  preConfigure = ''
+    cd source/Irrlicht
+  '';
+
+  buildPhase = ''
+    make sharedlib NDEBUG=1 "LDFLAGS=-lX11 -lGL -lXxf86vm"
+  '';
+
+  preInstall = ''
+    sed -i s,/usr/local/lib,$out/lib, Makefile
+    mkdir -p $out/lib
+  '';
+
+  buildInputs = [ unzip libGLU libGL libXrandr libX11 libXxf86vm ];
+
+  meta = {
+    homepage = "http://irrlicht.sourceforge.net/";
+    license = lib.licenses.zlib;
+    description = "Open source high performance realtime 3D engine written in C++";
+    platforms = lib.platforms.linux ++ 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..b41486ce9dd6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix
@@ -0,0 +1,43 @@
+{ lib, 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 = lib.licenses.zlib;
+    description = "Open source high performance realtime 3D engine written in C++";
+    platforms = 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];

+ 		}