about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ogre
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/ogre')
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/default.nix84
3 files changed, 80 insertions, 20 deletions
diff --git a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
index 849db216b921..616792787818 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
+++ b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
@@ -16,6 +16,14 @@ stdenv.mkDerivation {
      sha256 = "1zwvlx5dz9nwjazhnrhzb0w8ilpa84r0hrxrmmy69pgr1p1yif5a";
   };
 
+  # fix for ARM. sys/sysctl.h has moved in later glibcs, and
+  # https://github.com/OGRECave/ogre-next/issues/132 suggests it isn't
+  # needed anyway.
+  postPatch = ''
+    substituteInPlace OgreMain/src/OgrePlatformInformation.cpp \
+      --replace '#include <sys/sysctl.h>' ""
+  '';
+
   cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
     ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
            ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
diff --git a/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
index 30d1dd185547..7548ed48e7ae 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
+++ b/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
@@ -19,6 +19,14 @@ stdenv.mkDerivation rec {
     sha256 = "11lfgzqaps3728dswrq3cbwk7aicigyz08q4hfyy6ikc6m35r4wg";
   };
 
+  # fix for ARM. sys/sysctl.h has moved in later glibcs, and
+  # https://github.com/OGRECave/ogre-next/issues/132 suggests it isn't
+  # needed anyway.
+  postPatch = ''
+    substituteInPlace OgreMain/src/OgrePlatformInformation.cpp \
+      --replace '#include <sys/sysctl.h>' ""
+  '';
+
   cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
     ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
            ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
diff --git a/nixpkgs/pkgs/development/libraries/ogre/default.nix b/nixpkgs/pkgs/development/libraries/ogre/default.nix
index d097dc623e76..e93dfdfb144e 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ogre/default.nix
@@ -1,40 +1,84 @@
-{ fetchurl, stdenv, lib
-, cmake, libGLU, libGL
-, freetype, freeimage, zziplib, xorgproto, libXrandr
-, libXaw, freeglut, libXt, libpng, boost, ois
-, libX11, libXmu, libSM, pkg-config
-, libXxf86vm, libICE
+{ fetchFromGitHub
+, stdenv
+, lib
+, cmake
+, libGLU
+, libGL
+, freetype
+, freeimage
+, zziplib
+, xorgproto
+, libXrandr
+, libXaw
+, freeglut
+, libXt
+, libpng
+, boost
+, ois
+, libX11
+, libXmu
+, libSM
+, pkg-config
+, libXxf86vm
+, libICE
 , unzip
 , libXrender
 , SDL2
-, withNvidiaCg ? false, nvidia_cg_toolkit
-, withSamples ? false }:
+, withNvidiaCg ? false
+, nvidia_cg_toolkit
+, withSamples ? false
+}:
 
 stdenv.mkDerivation rec {
   pname = "ogre";
   version = "1.12.1";
 
-  src = fetchurl {
-     url = "https://github.com/OGRECave/ogre/archive/v${version}.zip";
-     sha256 = "1iv6k0dwdzg5nnzw2mcgcl663q4f7p2kj7nhs8afnsikrzxxgsi4";
+  src = fetchFromGitHub {
+    owner = "OGRECave";
+    repo = "ogre";
+    rev = "v${version}";
+    sha256 = "sha256-FHW0+DZhw6MLlhjh4DRYhA+6vBBXMN9K6GEVoR6P5kM=";
   };
 
+  # fix for ARM. sys/sysctl.h has moved in later glibcs, and
+  # https://github.com/OGRECave/ogre-next/issues/132 suggests it isn't
+  # needed anyway.
+  postPatch = ''
+    substituteInPlace OgreMain/src/OgrePlatformInformation.cpp \
+      --replace '#include <sys/sysctl.h>' ""
+  '';
+
   cmakeFlags = [ "-DOGRE_BUILD_DEPENDENCIES=OFF" "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
     ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
-           ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
+    ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
     ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
 
 
   nativeBuildInputs = [ cmake unzip pkg-config ];
   buildInputs =
-   [ cmake libGLU libGL
-     freetype freeimage zziplib xorgproto libXrandr
-     libXaw freeglut libXt libpng boost ois
-     libX11 libXmu libSM
-     libXxf86vm libICE
-     libXrender
-     SDL2
-   ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
+    [
+      cmake
+      libGLU
+      libGL
+      freetype
+      freeimage
+      zziplib
+      xorgproto
+      libXrandr
+      libXaw
+      freeglut
+      libXt
+      libpng
+      boost
+      ois
+      libX11
+      libXmu
+      libSM
+      libXxf86vm
+      libICE
+      libXrender
+      SDL2
+    ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
 
   meta = {
     description = "A 3D engine";