1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 CMAKE_REMOVE_MODULES_LIST="FindFreetype FindDoxygen FindZLIB"
8 inherit cmake flag-o-matic git-r3
10 DESCRIPTION="Object-oriented Graphics Rendering Engine"
11 HOMEPAGE="https://www.ogre3d.org/"
14 EGIT_COMMIT="5b682fb90c9e8e660e2fbf92bbf7797a9246700d"
15 EGIT_REPO_URI="https://github.com/OGRECave/ogre-next.git"
18 LICENSE="MIT public-domain"
22 IUSE="+cache debug doc egl examples +freeimage gles2 json
23 legacy-animations mobile +opengl profile tools"
25 # USE flags that do not work, as their options aren't ported, yet.
31 mobile? ( egl gles2 !opengl )"
33 RESTRICT="test" #139905
43 egl? ( media-libs/mesa[egl] )
44 freeimage? ( media-libs/freeimage )
45 gles2? ( media-libs/mesa[gles2] )
46 json? ( dev-libs/rapidjson )
51 tools? ( dev-libs/tinyxml[stl] )
53 # Dependencies for USE flags that do not work, yet.
54 # cg? ( media-gfx/nvidia-cg-toolkit )
59 doc? ( app-doc/doxygen )"
62 "${FILESDIR}/${PN}-2.1-samples.patch"
63 "${FILESDIR}/${PN}-2.1-resource_path.patch"
64 "${FILESDIR}/${PN}-2.1-media_path.patch"
65 "${FILESDIR}/${PN}-2.1-enhance_config_loading.patch"
70 -e "s:share/OGRE/docs:share/doc/${PF}:" \
71 Docs/CMakeLists.txt || die
72 # Stupid build system hardcodes release names
74 -e '/CONFIGURATIONS/s:CONFIGURATIONS Release.*::' \
75 CMake/Utils/OgreConfigTargets.cmake || die
77 # Fix some path issues
83 -DOGRE_BUILD_COMPONENT_HLMS_PBS=$( usex mobile no yes)
84 -DOGRE_BUILD_COMPONENT_HLMS_PBS_MOBILE=$( usex mobile)
85 -DOGRE_BUILD_COMPONENT_HLMS_UNLIT=$( usex mobile no yes)
86 -DOGRE_BUILD_COMPONENT_HLMS_UNLIT_MOBILE=$(usex mobile)
87 -DOGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS=yes
88 -DOGRE_BUILD_COMPONENT_SCENE_FORMAT=yes
89 -DOGRE_BUILD_PLATFORM_NACL=no
90 -DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex opengl)
91 -DOGRE_BUILD_RENDERSYSTEM_GLES=no
92 -DOGRE_BUILD_RENDERSYSTEM_GLES2=$(usex gles2)
93 -DOGRE_BUILD_SAMPLES2=$(usex examples)
95 -DOGRE_BUILD_TOOLS=$(usex tools)
96 -DOGRE_CONFIG_ALLOCATOR=$(usex debug 5 1)
97 -DOGRE_CONFIG_ENABLE_FINE_LIGHT_MASK_GRANULARITY=yes
98 -DOGRE_CONFIG_ENABLE_FREEIMAGE=$(usex freeimage)
99 -DOGRE_CONFIG_ENABLE_GL_STATE_CACHE_SUPPORT=$(usex cache)
100 -DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=$(\
102 usex mobile no yes) no)
103 -DOGRE_CONFIG_ENABLE_JSON=$(usex json)
104 -DOGRE_CONFIG_MEMTRACK_DEBUG=$(usex debug)
105 -DOGRE_CONFIG_THREADS=2
106 -DOGRE_CONFIG_THREAD_PROVIDER=std
108 -DOGRE_INSTALL_DOCS=$(usex doc)
109 -DOGRE_INSTALL_SAMPLES=$(usex examples)
110 -DOGRE_INSTALL_SAMPLES_SOURCE=$(usex examples)
111 -DOGRE_LEGACY_ANIMATIONS=$(usex legacy-animations)
112 -DOGRE_PROFILING_PROVIDER=$(usex profile none internal)
116 # The double-precision mode can not be enabled, yet.
117 # -DOGRE_CONFIG_DOUBLE=$(usex double-precision)
119 # The CgFxScriptLoader doesn't seem to be completely ported, yet.
122 -DOGRE_BUILD_PLUGIN_CG=no
125 # These components are off by default, as they might not be ported, yet.
126 # When advancing to a newer commit, try whether any of the disabled
127 # components can be activated now.
129 -DOGRE_BUILD_COMPONENT_PAGING=no
130 -DOGRE_BUILD_COMPONENT_PROPERTY=no
131 -DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=no
132 -DOGRE_BUILD_RTSHADERSYSTEM_CORE_SHADERS=no
133 -DOGRE_BUILD_RTSHADERSYSTEM_EXT_SHADERS=no
134 -DOGRE_BUILD_COMPONENT_TERRAIN=no
135 -DOGRE_BUILD_COMPONENT_VOLUME=no
138 # Take out the warning about deprecated copy, as Ogre emits thousands of
139 # those. But using a deprecated way of doing things isn't an error and
140 # mainly of interest for developers.
141 # (The warning is part of -Wextra and only effects C++ compilation.)
142 append-cxxflags $(test-flags-CXX -Wno-deprecated-copy)
144 # The same with the old ways of using memset(0...) on objects. It is
145 # no longer assumed to be a good idea, but a warning about it isn't
146 # of any value to the user. (And it happens many times in Ogre.)
147 append-cxxflags $(test-flags-CXX -Wno-class-memaccess)
156 SHAREDIR=/usr/share/OGRE
158 # plugins and resources are the main configuration
159 insinto "${CONFIGDIR}"
160 doins "${BUILD_DIR}"/bin/plugins.cfg
161 doins "${BUILD_DIR}"/bin/plugins_tools.cfg
162 doins "${BUILD_DIR}"/bin/resources.cfg
163 doins "${BUILD_DIR}"/bin/resources2.cfg
164 dosym "${CONFIGDIR}"/plugins.cfg "${SHAREDIR}"/plugins.cfg
165 dosym "${CONFIGDIR}"/plugins_tools.cfg "${SHAREDIR}"/plugins_tools.cfg
166 dosym "${CONFIGDIR}"/resources.cfg "${SHAREDIR}"/resources.cfg
167 dosym "${CONFIGDIR}"/resources2.cfg "${SHAREDIR}"/resources2.cfg
169 # These are only for the Samples
170 if use examples ; then
171 insinto "${SHAREDIR}"
172 doins "${BUILD_DIR}"/bin/samples.cfg