diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-03-09 16:37:47 +0100 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-03-09 16:57:34 +0100 |
commit | 22fdf59f27db7a2170b4369b54df5e223f82232b (patch) | |
tree | 55f28c2e879adaae0fb92303e2b4c8c3278e4764 | |
parent | 9289a0678efadcd95fae82ea8c82318d3a86694a (diff) | |
download | nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.tar nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.tar.gz nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.tar.bz2 nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.tar.lz nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.tar.xz nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.tar.zst nixlib-22fdf59f27db7a2170b4369b54df5e223f82232b.zip |
ogre: include imgui in overlays
-rw-r--r-- | pkgs/development/libraries/ogre/default.nix | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix index f6cd2987aa0d..b4fae743ef8a 100644 --- a/pkgs/development/libraries/ogre/default.nix +++ b/pkgs/development/libraries/ogre/default.nix @@ -34,7 +34,16 @@ }: let - common = { version, hash }: stdenv.mkDerivation { + common = { version, hash, imguiVersion, imguiHash }: + let + imgui.src = fetchFromGitHub { + owner = "ocornut"; + repo = "imgui"; + rev = "v${imguiVersion}"; + hash = imguiHash; + }; + in + stdenv.mkDerivation { pname = "ogre"; inherit version; @@ -45,6 +54,12 @@ let inherit hash; }; + postPatch = '' + mkdir -p build + cp -R ${imgui.src} build/imgui-${imguiVersion} + chmod -R u+w build/imgui-${imguiVersion} + ''; + nativeBuildInputs = [ cmake pkg-config @@ -80,11 +95,10 @@ let ]; cmakeFlags = [ - "-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=FALSE" - "-DOGRE_BUILD_DEPENDENCIES=OFF" - "-DOGRE_BUILD_SAMPLES=${toString withSamples}" + (lib.cmakeBool "OGRE_BUILD_DEPENDENCIES" false) + (lib.cmakeBool "OGRE_BUILD_SAMPLES" withSamples) ] ++ lib.optionals stdenv.isDarwin [ - "-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=FALSE" + (lib.cmakeBool "OGRE_BUILD_LIBS_AS_FRAMEWORKS" false) ]; meta = { @@ -100,10 +114,16 @@ in ogre_14 = common { version = "14.1.2"; hash = "sha256-qPoC5VXA9IC1xiFLrvE7cqCZFkuiEM0OMowUXDlmhF4="; + # https://github.com/OGRECave/ogre/blob/v14.1.2/Components/Overlay/CMakeLists.txt + imguiVersion = "1.89.8"; + imguiHash = "sha256-pkEm7+ZBYAYgAbMvXhmJyxm6DfyQWkECTXcTHTgfvuo="; }; ogre_13 = common { version = "13.6.5"; hash = "sha256-8VQqePrvf/fleHijVIqWWfwOusGjVR40IIJ13o+HwaE="; + # https://github.com/OGRECave/ogre/blob/v13.6.5/Components/Overlay/CMakeLists.txt + imguiVersion = "1.87"; + imguiHash = "sha256-H5rqXZFw+2PfVMsYvAK+K+pxxI8HnUC0GlPhooWgEYM="; }; } |