Merge pull request #205265 from wegank/mygui-darwin

authored by

Sandro and committed by
GitHub
e388728d 9e6f3ed4

+68 -8
+48 -8
pkgs/development/libraries/mygui/default.nix
··· 1 - { lib, stdenv, fetchFromGitHub, libX11, cmake, ois, freetype, libuuid, 2 - boost, pkg-config, withOgre ? false, ogre ? null, libGL, libGLU ? null } : 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , cmake 5 + , pkg-config 6 + , boost 7 + , freetype 8 + , libuuid 9 + , ois 10 + , withOgre ? false 11 + , ogre 12 + , libGL 13 + , libGLU 14 + , libX11 15 + , Cocoa 16 + }: 3 17 4 18 let 5 19 renderSystem = if withOgre then "3" else "4"; 6 - in stdenv.mkDerivation rec { 20 + in 21 + stdenv.mkDerivation rec { 7 22 pname = "mygui"; 8 23 version = "3.4.0"; 9 24 ··· 14 29 sha256 = "0a4zi8w18pjj813n7kmxldl1d9r1jp0iyhkw7pbqgl8f7qaq994w"; 15 30 }; 16 31 17 - nativeBuildInputs = [ cmake pkg-config ]; 18 - buildInputs = [ libX11 ois freetype libuuid boost ] 19 - ++ (if withOgre then [ ogre ] else [ libGL libGLU ]); 32 + patches = [ 33 + ./disable-framework.patch 34 + ]; 35 + 36 + nativeBuildInputs = [ 37 + cmake 38 + pkg-config 39 + ]; 40 + 41 + buildInputs = [ 42 + boost 43 + freetype 44 + libuuid 45 + ois 46 + ] ++ lib.optionals withOgre [ 47 + ogre 48 + ] ++ lib.optionals (!withOgre && stdenv.isLinux) [ 49 + libGL 50 + libGLU 51 + ] ++ lib.optionals stdenv.isLinux [ 52 + libX11 53 + ] ++ lib.optionals stdenv.isDarwin [ 54 + Cocoa 55 + ]; 20 56 21 57 # Tools are disabled due to compilation failures. 22 - cmakeFlags = [ "-DMYGUI_BUILD_TOOLS=OFF" "-DMYGUI_BUILD_DEMOS=OFF" "-DMYGUI_RENDERSYSTEM=${renderSystem}" ]; 58 + cmakeFlags = [ 59 + "-DMYGUI_BUILD_TOOLS=OFF" 60 + "-DMYGUI_BUILD_DEMOS=OFF" 61 + "-DMYGUI_RENDERSYSTEM=${renderSystem}" 62 + ]; 23 63 24 64 meta = with lib; { 25 65 homepage = "http://mygui.info/"; 26 66 description = "Library for creating GUIs for games and 3D applications"; 27 67 license = licenses.lgpl3Plus; 28 - platforms = platforms.linux; 68 + platforms = platforms.unix; 29 69 }; 30 70 }
+19
pkgs/development/libraries/mygui/disable-framework.patch
··· 1 + diff --git a/CMake/Utils/MyGUIConfigTargets.cmake b/CMake/Utils/MyGUIConfigTargets.cmake 2 + index bba3f91..8f4f351 100644 3 + --- a/CMake/Utils/MyGUIConfigTargets.cmake 4 + +++ b/CMake/Utils/MyGUIConfigTargets.cmake 5 + @@ -477,14 +477,6 @@ function(mygui_config_lib PROJECTNAME) 6 + if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") 7 + # add GCC visibility flags to shared library build 8 + set_target_properties(${PROJECTNAME} PROPERTIES COMPILE_FLAGS "${MYGUI_GCC_VISIBILITY_FLAGS}") 9 + - if (APPLE) 10 + - # deal with Mac OS X's framework system 11 + - set_target_properties(${PROJECTNAME} PROPERTIES FRAMEWORK TRUE) 12 + - set_target_properties(${PROJECTNAME} PROPERTIES PUBLIC_HEADER "${${PROJECTNAME}_HEADERS}") 13 + - set_target_properties(${PROJECTNAME} PROPERTIES OUTPUT_NAME ${PROJECTNAME}) 14 + - set_target_properties(${PROJECTNAME} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) 15 + - set_target_properties(${PROJECTNAME} PROPERTIES INSTALL_NAME_DIR "@executable_path/../Frameworks") 16 + - endif (APPLE) 17 + endif () 18 + endif (MYGUI_STATIC) 19 + mygui_install_target(${PROJECTNAME} "")
+1
pkgs/top-level/all-packages.nix
··· 21707 21707 mygpoclient = with python3.pkgs; toPythonApplication mygpoclient; 21708 21708 21709 21709 mygui = callPackage ../development/libraries/mygui { 21710 + inherit (darwin.apple_sdk.frameworks) Cocoa; 21710 21711 ogre = ogre1_9; 21711 21712 }; 21712 21713