4 |
4 |
EAPI=7
|
5 |
5 |
|
6 |
6 |
CMAKE_REMOVE_MODULES_LIST="FindFreetype FindDoxygen FindZLIB"
|
7 |
|
inherit cmake
|
8 |
7 |
|
9 |
|
IMGUI_PN="imgui"
|
10 |
|
IMGUI_PV="1.77"
|
11 |
|
IMGUI_P="${IMGUI_PN}-${IMGUI_PV}"
|
|
8 |
inherit cmake flag-o-matic
|
|
9 |
|
|
10 |
MY_PN="${PN}-next"
|
|
11 |
MY_P="${MY_PN}-${PV}"
|
12 |
12 |
|
13 |
13 |
DESCRIPTION="Object-oriented Graphics Rendering Engine"
|
14 |
14 |
HOMEPAGE="https://www.ogre3d.org/"
|
15 |
|
SRC_URI="https://github.com/OGRECave/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
16 |
|
https://github.com/ocornut/${IMGUI_PN}/archive/v${IMGUI_PV}.tar.gz -> ${IMGUI_P}.tar.gz"
|
|
15 |
SRC_URI="https://github.com/OGRECave/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
17 |
16 |
|
18 |
17 |
LICENSE="MIT public-domain"
|
19 |
|
SLOT="0/1.12"
|
20 |
|
KEYWORDS="~amd64 ~arm ~x86"
|
|
18 |
SLOT="0/2.1"
|
|
19 |
KEYWORDS="~amd64 ~x86"
|
21 |
20 |
|
22 |
|
IUSE="assimp +cache cg debug deprecated doc double-precision egl examples +freeimage
|
23 |
|
json +opengl pch profile resman-pedantic tools"
|
|
21 |
IUSE="+cache debug doc double-precision egl examples fine-granularity +freeimage json
|
|
22 |
legacy-animations +opengl profile tools"
|
24 |
23 |
|
25 |
|
# Note: gles2 USE flag taken out for now. It seems like the Ogre Devs now rely
|
26 |
|
# on HLSL2GLSL (https://github.com/aras-p/hlsl2glslfork) unconditionally
|
27 |
|
# for GLES2. So unless we have an ebuild for that, gles2/3 are off the
|
28 |
|
# table.
|
29 |
|
# ~~sed 2020-04-26 (yamakuzure@gmx.net)
|
30 |
|
#
|
31 |
|
# Note: Without gles2 USE flag, the opengl USE flag is next to useless. But
|
32 |
|
# there are packages which enforce it, so it has to stay.
|
33 |
|
#
|
34 |
|
# USE="gles2"
|
35 |
|
# REQUIRED_USE="
|
36 |
|
# || ( gles2 opengl )
|
37 |
|
# "
|
38 |
|
REQUIRED_USE="
|
39 |
|
examples? ( opengl )
|
40 |
|
"
|
|
24 |
# USE flags that do not work, as their options aren't ported, yet.
|
|
25 |
# cg
|
|
26 |
# gles2
|
|
27 |
# mobile
|
41 |
28 |
|
42 |
29 |
RESTRICT="test" #139905
|
43 |
30 |
|
44 |
31 |
RDEPEND="
|
45 |
32 |
dev-games/ois
|
46 |
|
dev-libs/pugixml
|
47 |
33 |
dev-libs/zziplib
|
48 |
34 |
media-libs/freetype:2
|
49 |
35 |
x11-libs/libX11
|
50 |
36 |
x11-libs/libXaw
|
51 |
37 |
x11-libs/libXrandr
|
52 |
38 |
x11-libs/libXt
|
53 |
|
assimp? ( media-libs/assimp:= )
|
54 |
|
cg? ( media-gfx/nvidia-cg-toolkit )
|
55 |
39 |
egl? ( media-libs/mesa[egl(+)] )
|
56 |
40 |
freeimage? ( media-libs/freeimage )
|
57 |
41 |
json? ( dev-libs/rapidjson )
|
... | ... | |
61 |
45 |
)
|
62 |
46 |
tools? ( dev-libs/tinyxml[stl] )
|
63 |
47 |
"
|
64 |
|
# gles2? ( media-libs/mesa[gles2] )
|
|
48 |
# Dependencies for USE flags that do not work, yet.
|
|
49 |
# cg? ( media-gfx/nvidia-cg-toolkit )
|
|
50 |
# gles2? ( media-libs/mesa[gles2] )
|
|
51 |
|
65 |
52 |
DEPEND="
|
66 |
53 |
${RDEPEND}
|
67 |
54 |
x11-base/xorg-proto
|
... | ... | |
72 |
59 |
"
|
73 |
60 |
|
74 |
61 |
PATCHES=(
|
75 |
|
"${FILESDIR}"/${P}-media_path.patch
|
76 |
|
"${FILESDIR}"/${P}-resource_path.patch
|
77 |
|
"${FILESDIR}"/${P}-fix_Simple_demo.patch
|
78 |
|
"${FILESDIR}"/${P}-gentoolize_imgui_inclusion.patch
|
79 |
|
"${FILESDIR}"/${P}-fix_config_window_height.patch
|
80 |
|
"${FILESDIR}"/${PN}-1.10.12-use_system_tinyxml.patch
|
|
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"
|
|
66 |
"${FILESDIR}/${PN}-2.1-fix_opengl_search.patch"
|
|
67 |
"${FILESDIR}/${PN}-2.1-fix_compilation_issues.patch"
|
|
68 |
"${FILESDIR}/${PN}-2.1-fix_warnings.patch"
|
|
69 |
"${FILESDIR}/${PN}-2.1-d1c1116.patch"
|
81 |
70 |
)
|
82 |
71 |
|
83 |
|
src_unpack() {
|
84 |
|
unpack ${P}.tar.gz || die "Unpacking ${P}.zip failed"
|
85 |
|
|
86 |
|
# Ogre 1.12.9 includes imgui, but as a submodule, it is not included
|
87 |
|
# in the release. The build system tries to download it, that may
|
88 |
|
# fail and so we are doing it ourselves.
|
89 |
|
cd "${S}" || die "Unpack incomplete"
|
90 |
|
unpack ${IMGUI_P}.tar.gz || die "Unpacking ${IMGUI_P}.zip failed"
|
91 |
|
}
|
|
72 |
S=${WORKDIR}/${MY_P}
|
92 |
73 |
|
93 |
74 |
src_prepare() {
|
94 |
|
local broken_png=(
|
95 |
|
Icon@2x-72.png
|
96 |
|
Default-Portrait~ipad.png
|
97 |
|
Default-Portrait@2x~ipad.png
|
98 |
|
Default-Landscape@2x~ipad.png
|
99 |
|
)
|
100 |
|
|
101 |
75 |
sed -i \
|
102 |
|
-e "s:share/doc/OGRE:share/doc/${PF}:" \
|
|
76 |
-e "s:share/OGRE/docs:share/doc/${PF}:" \
|
103 |
77 |
Docs/CMakeLists.txt || die
|
|
78 |
|
104 |
79 |
# In this series, the CMAKE_BUILD_TARGET is hard-wired to the
|
105 |
|
# installation. And only Debug, MinSizeRel and RelWithDebInfo
|
|
80 |
# installation. And only Release, Debug, MinSizeRel and RelWithDebInfo
|
106 |
81 |
# are supported.
|
107 |
82 |
sed -i \
|
108 |
83 |
-e "s/$(usex debug Debug Release)/Gentoo/g" \
|
... | ... | |
110 |
85 |
CMake/Utils/OgreConfigTargets.cmake \
|
111 |
86 |
|| die
|
112 |
87 |
|
113 |
|
# Fix broken png files
|
114 |
|
einfo "Fixing broken png files."
|
115 |
|
pushd "${S}"/Samples/Common/misc 1>/dev/null 2>&1
|
116 |
|
for png in "${broken_png[@]}"; do
|
117 |
|
pngfix -q --out=out.png ${png}
|
118 |
|
mv -f out.png "${png}" || die
|
119 |
|
done
|
120 |
|
popd 1>/dev/null 2>&1
|
121 |
|
einfo "done ..."
|
122 |
|
|
123 |
88 |
# Fix some path issues
|
124 |
89 |
cmake_src_prepare
|
125 |
90 |
}
|
126 |
91 |
|
127 |
92 |
src_configure() {
|
128 |
93 |
local mycmakeargs=(
|
129 |
|
-DCMAKE_SKIP_INSTALL_RPATH=yes
|
130 |
|
-DOGRE_BUILD_COMPONENT_BITES=yes
|
131 |
|
-DOGRE_BUILD_COMPONENT_CSHARP=no
|
132 |
|
-DOGRE_BUILD_COMPONENT_HLMS=$(usex deprecated)
|
133 |
|
-DOGRE_BUILD_COMPONENT_JAVA=no
|
134 |
|
-DOGRE_BUILD_COMPONENT_OVERLAY=yes
|
135 |
|
-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=yes
|
136 |
|
-DOGRE_BUILD_COMPONENT_PAGING=yes
|
137 |
|
-DOGRE_BUILD_COMPONENT_PROPERTY=yes
|
138 |
|
-DOGRE_BUILD_COMPONENT_PYTHON=no
|
139 |
|
-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=yes
|
140 |
|
-DOGRE_BUILD_COMPONENT_TERRAIN=yes
|
141 |
|
-DOGRE_BUILD_COMPONENT_VOLUME=yes
|
142 |
|
-DOGRE_BUILD_DEPENDENCIES=no
|
143 |
|
-DOGRE_BUILD_PLUGIN_CG=$(usex cg)
|
144 |
|
-DOGRE_BUILD_PLUGIN_FREEIMAGE=$(usex freeimage)
|
145 |
|
-DOGRE_BUILD_PLUGIN_EXRCODEC=no
|
146 |
|
-DOGRE_BUILD_RENDERSYSTEM_GL=$(usex opengl)
|
|
94 |
-DOGRE_BUILD_COMPONENT_HLMS_PBS=yes
|
|
95 |
-DOGRE_BUILD_COMPONENT_HLMS_PBS_MOBILE=no
|
|
96 |
-DOGRE_BUILD_COMPONENT_HLMS_UNLIT=yes
|
|
97 |
-DOGRE_BUILD_COMPONENT_HLMS_UNLIT_MOBILE=no
|
|
98 |
-DOGRE_BUILD_COMPONENT_PLANAR_REFLECTIONS=yes
|
|
99 |
-DOGRE_BUILD_COMPONENT_SCENE_FORMAT=yes
|
|
100 |
-DOGRE_BUILD_PLATFORM_NACL=no
|
147 |
101 |
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex opengl)
|
148 |
102 |
-DOGRE_BUILD_RENDERSYSTEM_GLES2=no
|
149 |
|
-DOGRE_BUILD_SAMPLES=$(usex examples)
|
150 |
|
-DOGRE_BUILD_TESTS=no
|
|
103 |
-DOGRE_BUILD_SAMPLES2=$(usex examples)
|
|
104 |
-DOGRE_BUILD_TESTS=$(usex debug)
|
151 |
105 |
-DOGRE_BUILD_TOOLS=$(usex tools)
|
152 |
|
-DOGRE_CONFIG_DOUBLE=$(usex double-precision)
|
|
106 |
-DOGRE_CONFIG_ALLOCATOR=$(usex debug 5 1)
|
|
107 |
-DOGRE_CONFIG_ENABLE_FINE_LIGHT_MASK_GRANULARITY=$(usex fine-granularity)
|
|
108 |
-DOGRE_CONFIG_ENABLE_FREEIMAGE=$(usex freeimage)
|
153 |
109 |
-DOGRE_CONFIG_ENABLE_GL_STATE_CACHE_SUPPORT=$(usex cache)
|
154 |
|
-DOGRE_CONFIG_ENABLE_GLES2_CG_SUPPORT=no
|
155 |
|
-DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=no
|
156 |
|
-DOGRE_CONFIG_THREADS=3
|
|
110 |
-DOGRE_CONFIG_ENABLE_JSON=$(usex json)
|
|
111 |
-DOGRE_CONFIG_MEMTRACK_DEBUG=$(usex debug)
|
|
112 |
-DOGRE_CONFIG_MEMTRACK_RELEASE=no
|
|
113 |
-DOGRE_CONFIG_THREADS=0
|
157 |
114 |
-DOGRE_CONFIG_THREAD_PROVIDER=std
|
158 |
|
-DOGRE_ENABLE_PRECOMPILED_HEADERS=$(usex pch)
|
|
115 |
-DOGRE_FULL_RPATH=no
|
159 |
116 |
-DOGRE_INSTALL_DOCS=$(usex doc)
|
160 |
117 |
-DOGRE_INSTALL_SAMPLES=$(usex examples)
|
161 |
118 |
-DOGRE_INSTALL_SAMPLES_SOURCE=$(usex examples)
|
162 |
|
-DOGRE_NODELESS_POSITIONING=$(usex deprecated)
|
163 |
|
-DOGRE_PROFILING=$(usex profile)
|
164 |
|
-DOGRE_RESOURCEMANAGER_STRICT=$(usex resman-pedantic 1 2)
|
|
119 |
-DOGRE_LEGACY_ANIMATIONS=$(usex legacy-animations)
|
|
120 |
-DOGRE_PROFILING_PROVIDER=$(usex profile none internal)
|
|
121 |
-DOGRE_USE_BOOST=no
|
|
122 |
-DOGRE_CONFIG_DOUBLE=$(usex double-precision)
|
|
123 |
-DOGRE_SIMD_NEON=$(usex double-precision no yes)
|
|
124 |
-DOGRE_SIMD_SSE2=$(usex double-precision no yes)
|
165 |
125 |
)
|
166 |
|
# -DOGRE_BUILD_RENDERSYSTEM_GLES2=$(usex gles2)
|
167 |
|
# -DOGRE_CONFIG_ENABLE_GLES2_CG_SUPPORT=$(usex gles2 $(usex cg) no)
|
168 |
|
# -DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=$(usex gles2)
|
169 |
126 |
|
170 |
|
cmake_src_configure
|
171 |
|
}
|
|
127 |
# GLES2 is not supported, yet
|
|
128 |
# -DOGRE_BUILD_COMPONENT_HLMS_PBS=$( usex mobile no yes)
|
|
129 |
# -DOGRE_BUILD_COMPONENT_HLMS_PBS_MOBILE=$( usex mobile)
|
|
130 |
# -DOGRE_BUILD_COMPONENT_HLMS_UNLIT=$( usex mobile no yes)
|
|
131 |
# -DOGRE_BUILD_COMPONENT_HLMS_UNLIT_MOBILE=$(usex mobile)
|
|
132 |
# -DOGRE_BUILD_RENDERSYSTEM_GLES2=$(usex gles2)
|
|
133 |
|
|
134 |
# The CgFxScriptLoader doesn't seem to be completely ported, yet.
|
|
135 |
# USE flag disabled.
|
|
136 |
mycmakeargs+=(
|
|
137 |
-DOGRE_BUILD_PLUGIN_CG=no
|
|
138 |
)
|
172 |
139 |
|
173 |
|
src_compile() {
|
174 |
|
cmake_src_compile
|
|
140 |
# These components are off by default, as they might not be ported, yet.
|
|
141 |
# When advancing to a newer commit, try whether any of the disabled
|
|
142 |
# components can be activated now.
|
|
143 |
mycmakeargs+=(
|
|
144 |
-DOGRE_BUILD_COMPONENT_PAGING=no
|
|
145 |
-DOGRE_BUILD_COMPONENT_PROPERTY=no
|
|
146 |
-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=no
|
|
147 |
-DOGRE_BUILD_RTSHADERSYSTEM_CORE_SHADERS=no
|
|
148 |
-DOGRE_BUILD_RTSHADERSYSTEM_EXT_SHADERS=no
|
|
149 |
-DOGRE_BUILD_COMPONENT_TERRAIN=no
|
|
150 |
-DOGRE_BUILD_COMPONENT_VOLUME=no
|
|
151 |
)
|
175 |
152 |
|
176 |
|
if use doc ; then
|
177 |
|
eninja -C "${BUILD_DIR}" OgreDoc
|
|
153 |
# In Release builds the system moans about unknown flags. Lets help!
|
|
154 |
if use debug; then
|
|
155 |
append-flags -DOGRE_DEBUG_MODE=1 -DDEBUG=1 -D_DEBUG=1
|
|
156 |
else
|
|
157 |
append-flags -DOGRE_DEBUG_MODE=0
|
178 |
158 |
fi
|
|
159 |
|
|
160 |
# Take out the warning about deprecated copy, as Ogre emits thousands of
|
|
161 |
# those. But using a deprecated way of doing things isn't an error and
|
|
162 |
# mainly of interest for developers.
|
|
163 |
# (The warning is part of -Wextra and only effects C++ compilation.)
|
|
164 |
append-cxxflags $(test-flags-CXX -Wno-deprecated-copy)
|
|
165 |
|
|
166 |
# The same with the old ways of using memset(0...) on objects. It is
|
|
167 |
# no longer assumed to be a good idea, but a warning about it isn't
|
|
168 |
# of any value to the user. (And it happens many times in Ogre.)
|
|
169 |
append-cxxflags $(test-flags-CXX -Wno-class-memaccess)
|
|
170 |
|
|
171 |
cmake_src_configure
|
179 |
172 |
}
|
180 |
173 |
|
181 |
174 |
src_install() {
|
... | ... | |
187 |
180 |
# plugins and resources are the main configuration
|
188 |
181 |
insinto "${CONFIGDIR}"
|
189 |
182 |
doins "${BUILD_DIR}"/bin/plugins.cfg
|
|
183 |
doins "${BUILD_DIR}"/bin/plugins_tools.cfg
|
190 |
184 |
doins "${BUILD_DIR}"/bin/resources.cfg
|
|
185 |
doins "${BUILD_DIR}"/bin/resources2.cfg
|
191 |
186 |
dosym "${CONFIGDIR}"/plugins.cfg "${SHAREDIR}"/plugins.cfg
|
|
187 |
dosym "${CONFIGDIR}"/plugins_tools.cfg "${SHAREDIR}"/plugins_tools.cfg
|
192 |
188 |
dosym "${CONFIGDIR}"/resources.cfg "${SHAREDIR}"/resources.cfg
|
|
189 |
dosym "${CONFIGDIR}"/resources2.cfg "${SHAREDIR}"/resources2.cfg
|
193 |
190 |
|
194 |
|
# These are only for the sample browser
|
|
191 |
# These are only for the Samples
|
195 |
192 |
if use examples ; then
|
196 |
193 |
insinto "${SHAREDIR}"
|
197 |
194 |
doins "${BUILD_DIR}"/bin/samples.cfg
|
198 |
|
doins "${BUILD_DIR}"/bin/tests.cfg
|
199 |
195 |
fi
|
200 |
196 |
}
|
201 |
|
|
202 |
|
pkg_postinst() {
|
203 |
|
elog "If you experience crashes when starting /usr/bin/SampleBrowser,"
|
204 |
|
elog "remove the cache directory at:"
|
205 |
|
elog " '~/.cache/OGRE Sample Browser'"
|
206 |
|
elog "first, before filing a bug report."
|
207 |
|
}
|