Diff ogre-1.12.9 with a ogre-2.1

/usr/portage/dev-games/ogre/ogre-2.1.ebuild 2020-08-26 01:09:00.000000000 +0300
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"
21 20

  
22
IUSE="assimp +cache cg debug deprecated doc double-precision egl examples +freeimage
23
	json openexr +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 )
58
	openexr? ( media-libs/openexr:= )
59 42
	opengl? (
60 43
		virtual/glu
61 44
		virtual/opengl
62 45
	)
63 46
	tools? ( dev-libs/tinyxml[stl] )
64 47
"
65
# 	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

  
66 52
DEPEND="
67 53
	${RDEPEND}
68 54
	x11-base/xorg-proto
......
73 59
"
74 60

  
75 61
PATCHES=(
76
	"${FILESDIR}"/${P}-media_path.patch
77
	"${FILESDIR}"/${P}-resource_path.patch
78
	"${FILESDIR}"/${P}-fix_Simple_demo.patch
79
	"${FILESDIR}"/${P}-gentoolize_imgui_inclusion.patch
80
	"${FILESDIR}"/${P}-fix_config_window_height.patch
81
	"${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"
82 70
)
83 71

  
84
src_unpack() {
85
	unpack ${P}.tar.gz || die "Unpacking ${P}.zip failed"
86

  
87
	# Ogre 1.12.9 includes imgui, but as a submodule, it is not included
88
	# in the release. The build system tries to download it, that may
89
	# fail and so we are doing it ourselves.
90
	cd "${S}" || die "Unpack incomplete"
91
	unpack ${IMGUI_P}.tar.gz || die "Unpacking ${IMGUI_P}.zip failed"
92
}
72
S=${WORKDIR}/${MY_P}
93 73

  
94 74
src_prepare() {
95
	local broken_png=(
96
		Icon@2x-72.png
97
		Default-Portrait~ipad.png
98
		Default-Portrait@2x~ipad.png
99
		Default-Landscape@2x~ipad.png
100
	)
101

  
102 75
	sed -i \
103
		-e "s:share/doc/OGRE:share/doc/${PF}:" \
76
		-e "s:share/OGRE/docs:share/doc/${PF}:" \
104 77
		Docs/CMakeLists.txt || die
78

  
105 79
	# In this series, the CMAKE_BUILD_TARGET is hard-wired to the
106
	# installation. And only Debug, MinSizeRel and RelWithDebInfo
80
	# installation. And only Release, Debug, MinSizeRel and RelWithDebInfo
107 81
	# are supported.
108 82
	sed -i \
109 83
		-e "s/$(usex debug Debug Release)/Gentoo/g" \
......
111 85
		CMake/Utils/OgreConfigTargets.cmake \
112 86
		|| die
113 87

  
114
	# Fix broken png files
115
	einfo "Fixing broken png files."
116
	pushd "${S}"/Samples/Common/misc 1>/dev/null 2>&1
117
	for png in "${broken_png[@]}"; do
118
		pngfix -q --out=out.png ${png}
119
		mv -f out.png "${png}" || die
120
	done
121
	popd 1>/dev/null 2>&1
122
	einfo "done ..."
123

  
124 88
	# Fix some path issues
125 89
	cmake_src_prepare
126 90
}
127 91

  
128 92
src_configure() {
129 93
	local mycmakeargs=(
130
		-DCMAKE_SKIP_INSTALL_RPATH=yes
131
		-DOGRE_BUILD_COMPONENT_BITES=yes
132
		-DOGRE_BUILD_COMPONENT_CSHARP=no
133
		-DOGRE_BUILD_COMPONENT_HLMS=$(usex deprecated)
134
		-DOGRE_BUILD_COMPONENT_JAVA=no
135
		-DOGRE_BUILD_COMPONENT_OVERLAY=yes
136
		-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=yes
137
		-DOGRE_BUILD_COMPONENT_PAGING=yes
138
		-DOGRE_BUILD_COMPONENT_PROPERTY=yes
139
		-DOGRE_BUILD_COMPONENT_PYTHON=no
140
		-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=yes
141
		-DOGRE_BUILD_COMPONENT_TERRAIN=yes
142
		-DOGRE_BUILD_COMPONENT_VOLUME=yes
143
		-DOGRE_BUILD_DEPENDENCIES=no
144
		-DOGRE_BUILD_PLUGIN_CG=$(usex cg)
145
		-DOGRE_BUILD_PLUGIN_FREEIMAGE=$(usex freeimage)
146
		-DOGRE_BUILD_PLUGIN_EXRCODEC=$(usex openexr)
147
		-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
148 101
		-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex opengl)
149 102
		-DOGRE_BUILD_RENDERSYSTEM_GLES2=no
150
		-DOGRE_BUILD_SAMPLES=$(usex examples)
151
		-DOGRE_BUILD_TESTS=no
103
		-DOGRE_BUILD_SAMPLES2=$(usex examples)
104
		-DOGRE_BUILD_TESTS=$(usex debug)
152 105
		-DOGRE_BUILD_TOOLS=$(usex tools)
153
		-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)
154 109
		-DOGRE_CONFIG_ENABLE_GL_STATE_CACHE_SUPPORT=$(usex cache)
155
		-DOGRE_CONFIG_ENABLE_GLES2_CG_SUPPORT=no
156
		-DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=no
157
		-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
158 114
		-DOGRE_CONFIG_THREAD_PROVIDER=std
159
		-DOGRE_ENABLE_PRECOMPILED_HEADERS=$(usex pch)
115
		-DOGRE_FULL_RPATH=no
160 116
		-DOGRE_INSTALL_DOCS=$(usex doc)
161 117
		-DOGRE_INSTALL_SAMPLES=$(usex examples)
162 118
		-DOGRE_INSTALL_SAMPLES_SOURCE=$(usex examples)
163
		-DOGRE_NODELESS_POSITIONING=$(usex deprecated)
164
		-DOGRE_PROFILING=$(usex profile)
165
		-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)
166 125
	)
167
#		-DOGRE_BUILD_RENDERSYSTEM_GLES2=$(usex gles2)
168
#		-DOGRE_CONFIG_ENABLE_GLES2_CG_SUPPORT=$(usex gles2 $(usex cg) no)
169
#		-DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=$(usex gles2)
170 126

  
171
	cmake_src_configure
172
}
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
	)
173 139

  
174
src_compile() {
175
	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
	)
176 152

  
177
	if use doc ; then
178
		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
179 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
180 172
}
181 173

  
182 174
src_install() {
......
188 180
	# plugins and resources are the main configuration
189 181
	insinto "${CONFIGDIR}"
190 182
	doins "${BUILD_DIR}"/bin/plugins.cfg
183
	doins "${BUILD_DIR}"/bin/plugins_tools.cfg
191 184
	doins "${BUILD_DIR}"/bin/resources.cfg
185
	doins "${BUILD_DIR}"/bin/resources2.cfg
192 186
	dosym "${CONFIGDIR}"/plugins.cfg "${SHAREDIR}"/plugins.cfg
187
	dosym "${CONFIGDIR}"/plugins_tools.cfg "${SHAREDIR}"/plugins_tools.cfg
193 188
	dosym "${CONFIGDIR}"/resources.cfg "${SHAREDIR}"/resources.cfg
189
	dosym "${CONFIGDIR}"/resources2.cfg "${SHAREDIR}"/resources2.cfg
194 190

  
195
	# These are only for the sample browser
191
	# These are only for the Samples
196 192
	if use examples ; then
197 193
		insinto "${SHAREDIR}"
198 194
		doins "${BUILD_DIR}"/bin/samples.cfg
199
		doins "${BUILD_DIR}"/bin/tests.cfg
200 195
	fi
201 196
}
202

  
203
pkg_postinst() {
204
	elog "If you experience crashes when starting /usr/bin/SampleBrowser,"
205
	elog "remove the cache directory at:"
206
	elog "  '~/.cache/OGRE Sample Browser'"
207
	elog "first, before filing a bug report."
208
}
Thank you!