Diff ogre-1.9.0-r2 with a ogre-1.12.9

/usr/portage/dev-games/ogre/ogre-1.12.9.ebuild 2020-09-22 00:39:00.000000000 +0300
1
# Copyright 1999-2021 Gentoo Authors
1
# Copyright 1999-2020 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=7
5 5

  
6 6
CMAKE_REMOVE_MODULES_LIST="FindFreetype FindDoxygen FindZLIB"
7
inherit cmake
7 8

  
8
inherit cmake vcs-snapshot
9
IMGUI_PN="imgui"
10
IMGUI_PV="1.77"
11
IMGUI_P="${IMGUI_PN}-${IMGUI_PV}"
9 12

  
10 13
DESCRIPTION="Object-oriented Graphics Rendering Engine"
11 14
HOMEPAGE="https://www.ogre3d.org/"
12
SRC_URI="https://bitbucket.org/sinbad/ogre/get/v${PV//./-}.tar.bz2 -> ${P}.tar.bz2"
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"
13 17

  
14 18
LICENSE="MIT public-domain"
15
SLOT="0/1.9.0"
16
KEYWORDS="amd64 ~arm x86"
19
SLOT="0/1.12"
20
KEYWORDS="~amd64 ~arm ~x86"
17 21

  
18
# gles1 currently broken wrt bug #418201
19
# gles1 does not even build wrt bug #506058
20
IUSE="+boost cg doc double-precision examples +freeimage gl3plus gles2 gles3 ois +opengl poco profile tbb threads tools +zip"
21

  
22
REQUIRED_USE="threads? ( ^^ ( boost poco tbb ) )
23
	examples? ( ois )
24
	poco? ( threads )
25
	tbb? ( threads )
26
	gl3plus? ( !gles2 !gles3 )
27
	gles3? ( gles2 )
28
	gl3plus? ( opengl )"
22
IUSE="assimp +cache cg debug deprecated doc double-precision egl examples +freeimage
23
	json openexr +opengl pch profile resman-pedantic tools"
24

  
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
"
29 41

  
30 42
RESTRICT="test" #139905
31 43

  
32 44
RDEPEND="
45
	dev-games/ois
46
	dev-libs/pugixml
47
	dev-libs/zziplib
33 48
	media-libs/freetype:2
34
	virtual/opengl
35
	virtual/glu
36 49
	x11-libs/libX11
37 50
	x11-libs/libXaw
38 51
	x11-libs/libXrandr
39 52
	x11-libs/libXt
40
	boost? ( dev-libs/boost:= )
53
	assimp? ( media-libs/assimp )
41 54
	cg? ( media-gfx/nvidia-cg-toolkit )
55
	egl? ( media-libs/mesa[egl] )
42 56
	freeimage? ( media-libs/freeimage )
43
	gles2? ( >=media-libs/mesa-9.0.0[gles2] )
44
	gles3? ( >=media-libs/mesa-10.0.0[gles2] )
45
	gl3plus? ( >=media-libs/mesa-9.2.5 )
46
	ois? ( dev-games/ois )
47
	threads? (
48
		poco? ( dev-libs/poco )
49
		tbb? ( dev-cpp/tbb )
57
	json? ( dev-libs/rapidjson )
58
	openexr? ( media-libs/openexr:= )
59
	opengl? (
60
		virtual/glu
61
		virtual/opengl
50 62
	)
51 63
	tools? ( dev-libs/tinyxml[stl] )
52
	zip? ( sys-libs/zlib dev-libs/zziplib )"
64
"
65
# 	gles2? ( media-libs/mesa[gles2] )
53 66
DEPEND="
54 67
	${RDEPEND}
55 68
	x11-base/xorg-proto
......
60 73
"
61 74

  
62 75
PATCHES=(
63
	"${FILESDIR}/${P}-remove_resource_path_to_bindir.patch"
64
	"${FILESDIR}/${P}-remove_media_path_to_bindir.patch"
65
	"${FILESDIR}/${P}-gcc52.patch"
66
	"${FILESDIR}/${P}-samples.patch"
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
67 82
)
68 83

  
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
}
93

  
69 94
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

  
70 102
	sed -i \
71
		-e "s:share/OGRE/docs:share/doc/${PF}:" \
103
		-e "s:share/doc/OGRE:share/doc/${PF}:" \
72 104
		Docs/CMakeLists.txt || die
73
	# Stupid build system hardcodes release names
105
	# In this series, the CMAKE_BUILD_TARGET is hard-wired to the
106
	# installation. And only Debug, MinSizeRel and RelWithDebInfo
107
	# are supported.
74 108
	sed -i \
75
		-e '/CONFIGURATIONS/s:CONFIGURATIONS Release.*::' \
76
		CMake/Utils/OgreConfigTargets.cmake || die
77

  
78
	# make sure we're not using the included tinyxml
79
	rm -f Tools/XMLConverter/{include,src}/tiny*.*
109
		-e "s/$(usex debug Debug Release)/Gentoo/g" \
110
		CMake/InstallResources.cmake \
111
		CMake/Utils/OgreConfigTargets.cmake \
112
		|| die
113

  
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 ..."
80 123

  
81 124
	# Fix some path issues
82 125
	cmake_src_prepare
......
84 127

  
85 128
src_configure() {
86 129
	local mycmakeargs=(
87
		-DOGRE_FULL_RPATH=NO
88
		-DOGRE_USE_BOOST=$(usex boost)
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
89 144
		-DOGRE_BUILD_PLUGIN_CG=$(usex cg)
90
		-DOGRE_INSTALL_DOCS=$(usex doc)
91
		-DOGRE_CONFIG_DOUBLE=$(usex double-precision)
92
		-DOGRE_CONFIG_ENABLE_FREEIMAGE=$(usex freeimage)
145
		-DOGRE_BUILD_PLUGIN_FREEIMAGE=$(usex freeimage)
146
		-DOGRE_BUILD_PLUGIN_EXRCODEC=$(usex openexr)
93 147
		-DOGRE_BUILD_RENDERSYSTEM_GL=$(usex opengl)
94
		-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex gl3plus)
95
		-DOGRE_BUILD_RENDERSYSTEM_GLES=FALSE
96
		-DOGRE_BUILD_RENDERSYSTEM_GLES2=$(usex gles2)
97
		-DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=$(usex gles3)
98
		-DOGRE_PROFILING=$(usex profile)
148
		-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex opengl)
149
		-DOGRE_BUILD_RENDERSYSTEM_GLES2=no
99 150
		-DOGRE_BUILD_SAMPLES=$(usex examples)
151
		-DOGRE_BUILD_TESTS=no
152
		-DOGRE_BUILD_TOOLS=$(usex tools)
153
		-DOGRE_CONFIG_DOUBLE=$(usex double-precision)
154
		-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
158
		-DOGRE_CONFIG_THREAD_PROVIDER=std
159
		-DOGRE_ENABLE_PRECOMPILED_HEADERS=$(usex pch)
160
		-DOGRE_INSTALL_DOCS=$(usex doc)
100 161
		-DOGRE_INSTALL_SAMPLES=$(usex examples)
101 162
		-DOGRE_INSTALL_SAMPLES_SOURCE=$(usex examples)
102
		-DOGRE_BUILD_TESTS=FALSE
103
		-DOGRE_CONFIG_THREADS=$(usex threads 2 0)
104
		-DOGRE_BUILD_TOOLS=$(usex tools)
105
		-DOGRE_CONFIG_ENABLE_ZIP=$(usex zip)
163
		-DOGRE_NODELESS_POSITIONING=$(usex deprecated)
164
		-DOGRE_PROFILING=$(usex profile)
165
		-DOGRE_RESOURCEMANAGER_STRICT=$(usex resman-pedantic 1 2)
106 166
	)
107

  
108
	if use threads ; then
109
		local f
110
		for f in boost poco tbb ; do
111
			use ${f} || continue
112
			mycmakeargs+=( -DOGRE_CONFIG_THREAD_PROVIDER=${f} )
113
			break
114
		done
115
	fi
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)
116 170

  
117 171
	cmake_src_configure
118 172
}
119 173

  
174
src_compile() {
175
	cmake_src_compile
176

  
177
	if use doc ; then
178
		eninja -C "${BUILD_DIR}" OgreDoc
179
	fi
180
}
181

  
120 182
src_install() {
121 183
	cmake_src_install
122 184

  
......
131 193
	dosym "${CONFIGDIR}"/resources.cfg "${SHAREDIR}"/resources.cfg
132 194

  
133 195
	# These are only for the sample browser
134
	insinto "${SHAREDIR}"
135
	doins "${BUILD_DIR}"/bin/quakemap.cfg
136
	doins "${BUILD_DIR}"/bin/samples.cfg
196
	if use examples ; then
197
		insinto "${SHAREDIR}"
198
		doins "${BUILD_DIR}"/bin/samples.cfg
199
		doins "${BUILD_DIR}"/bin/tests.cfg
200
	fi
201
}
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."
137 208
}
Thank you!