From 956bdd6f2268a0ba2fe9b95d6842b570bb36065f Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:08:12 +0200 Subject: [PATCH] ogre_14: init at 14.0.1 --- pkgs/development/libraries/ogre/default.nix | 129 +++++++++++--------- pkgs/games/opendungeons/default.nix | 4 +- pkgs/games/stuntrally/default.nix | 6 +- pkgs/top-level/all-packages.nix | 7 +- 4 files changed, 80 insertions(+), 66 deletions(-) diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix index ce4951937165..6bac6c5a425b 100644 --- a/pkgs/development/libraries/ogre/default.nix +++ b/pkgs/development/libraries/ogre/default.nix @@ -27,72 +27,85 @@ , libXxf86vm , xorgproto # darwin -, Cocoa +, darwin # optional , withNvidiaCg ? false , nvidia_cg_toolkit , withSamples ? false }: -stdenv.mkDerivation rec { - pname = "ogre"; - version = "13.6.4"; +let + common = { version, hash }: stdenv.mkDerivation { + pname = "ogre"; + inherit version; - src = fetchFromGitHub { - owner = "OGRECave"; - repo = "ogre"; - rev = "v${version}"; - hash = "sha256-MSBWCO0s46t+ExWDdmqi16OxmcQXnduhgFt6I4BG1g8="; + src = fetchFromGitHub { + owner = "OGRECave"; + repo = "ogre"; + rev = "v${version}"; + inherit hash; + }; + + nativeBuildInputs = [ + cmake + pkg-config + unzip + ]; + + buildInputs = [ + SDL2 + boost + freeimage + freetype + libpng + ois + pugixml + zziplib + ] ++ lib.optionals stdenv.isLinux [ + freeglut + libGL + libGLU + libICE + libSM + libX11 + libXaw + libXmu + libXrandr + libXrender + libXt + libXxf86vm + xorgproto + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Cocoa + ] ++ lib.optionals withNvidiaCg [ + nvidia_cg_toolkit + ]; + + cmakeFlags = [ + "-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=FALSE" + "-DOGRE_BUILD_DEPENDENCIES=OFF" + "-DOGRE_BUILD_SAMPLES=${toString withSamples}" + ] ++ lib.optionals stdenv.isDarwin [ + "-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=FALSE" + ]; + + meta = { + description = "3D Object-Oriented Graphics Rendering Engine"; + homepage = "https://www.ogre3d.org/"; + maintainers = with lib.maintainers; [ raskin wegank ]; + platforms = lib.platforms.unix; + license = lib.licenses.mit; + }; + }; +in +{ + ogre_14 = common { + version = "14.0.1"; + hash = "sha256-jtUm0jy0GsxkGlFdODGodPsuSaQgiE77BORnA6SFViU="; }; - nativeBuildInputs = [ - cmake - pkg-config - unzip - ]; - - buildInputs = [ - SDL2 - boost - freeimage - freetype - libpng - ois - pugixml - zziplib - ] ++ lib.optionals stdenv.isLinux [ - freeglut - libGL - libGLU - libICE - libSM - libX11 - libXaw - libXmu - libXrandr - libXrender - libXt - libXxf86vm - xorgproto - ] ++ lib.optionals stdenv.isDarwin [ - Cocoa - ] ++ lib.optionals withNvidiaCg [ - nvidia_cg_toolkit - ]; - - cmakeFlags = [ - "-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=FALSE" - "-DOGRE_BUILD_DEPENDENCIES=OFF" - "-DOGRE_BUILD_SAMPLES=${toString withSamples}" - ] ++ lib.optionals stdenv.isDarwin [ - "-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=FALSE" - ]; - - meta = { - description = "3D Object-Oriented Graphics Rendering Engine"; - homepage = "https://www.ogre3d.org/"; - maintainers = with lib.maintainers; [ raskin wegank ]; - platforms = lib.platforms.unix; - license = lib.licenses.mit; + ogre_13 = common { + version = "13.6.5"; + hash = "sha256-8VQqePrvf/fleHijVIqWWfwOusGjVR40IIJ13o+HwaE="; }; } diff --git a/pkgs/games/opendungeons/default.nix b/pkgs/games/opendungeons/default.nix index a5fdb5cd9a8e..10bcf19a53e7 100644 --- a/pkgs/games/opendungeons/default.nix +++ b/pkgs/games/opendungeons/default.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , cmake , pkg-config -, ogre +, ogre_13 , cegui , boost , sfml @@ -12,7 +12,7 @@ }: let - ogre' = ogre.overrideAttrs (old: { + ogre' = ogre_13.overrideAttrs (old: { cmakeFlags = old.cmakeFlags ++ [ "-DOGRE_RESOURCEMANAGER_STRICT=0" ]; diff --git a/pkgs/games/stuntrally/default.nix b/pkgs/games/stuntrally/default.nix index af5535ec7ab6..b4b2268c33e9 100644 --- a/pkgs/games/stuntrally/default.nix +++ b/pkgs/games/stuntrally/default.nix @@ -3,7 +3,7 @@ , stdenv , cmake , boost -, ogre +, ogre_13 , mygui , ois , SDL2 @@ -19,7 +19,7 @@ }: let - stuntrally_ogre = ogre.overrideAttrs (old: { + stuntrally_ogre = ogre_13.overrideAttrs (old: { cmakeFlags = old.cmakeFlags ++ [ "-DOGRE_NODELESS_POSITIONING=ON" "-DOGRE_RESOURCEMANAGER_STRICT=0" @@ -27,7 +27,7 @@ let }); stuntrally_mygui = mygui.override { withOgre = true; - inherit ogre; + ogre = stuntrally_ogre; }; in diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 41f98db8e01a..5ec481322af4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23903,9 +23903,10 @@ with pkgs; ode = callPackage ../development/libraries/ode { }; - ogre = callPackage ../development/libraries/ogre { - inherit (darwin.apple_sdk.frameworks) Cocoa; - }; + inherit (callPackages ../development/libraries/ogre { }) + ogre_13 ogre_14; + + ogre = ogre_14; olm = callPackage ../development/libraries/olm { };