Diff ogre-2.1-r1 with a ogre-13.6.1

/usr/portage/dev-games/ogre/ogre-13.6.1.ebuild 2023-10-09 14:52:29.364368347 +0300
1
# Copyright 1999-2022 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=7
4
EAPI=8
5 5

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

  
8
inherit cmake flag-o-matic
9

  
10
MY_PN="${PN}-next"
11
MY_P="${MY_PN}-${PV}"
9
IMGUI_PN="imgui"
10
IMGUI_PV="1.87"
11
IMGUI_P="${IMGUI_PN}-${IMGUI_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/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
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"
16 17

  
17 18
LICENSE="MIT public-domain"
18
SLOT="0/2.1"
19
KEYWORDS="~amd64 ~x86"
19
SLOT="0/13.6"
20
KEYWORDS="~amd64 ~arm ~x86"
20 21

  
21
IUSE="+cache debug doc double-precision egl examples fine-granularity +freeimage json
22
	legacy-animations +opengl profile tools"
22
IUSE="assimp bullet +cache cg debug deprecated doc double-precision egl examples +freeimage
23
	json +opengl pch profile resman-pedantic tools"
23 24

  
24
# USE flags that do not work, as their options aren't ported, yet.
25
#      cg
26
#      gles2
27
#      mobile
25
# Note: gles2 USE flag taken out for now, as even the configuration seems to be broken
26
#       ~~sed 2022-12-13 (sven@eden-worx.com)
27
#
28
# Note: The following dependencies might be considered for new ebuilds
29
#  + Vulkan SDK: Vulkan RenderSystem, glslang Plugin. Alternatively use system packages <https://vulkan.lunarg.com/>
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
REQUIRED_USE="
35
	examples? ( opengl )
36
"
28 37

  
29 38
RESTRICT="test" #139905
30 39

  
31 40
RDEPEND="
32 41
	dev-games/ois
42
	dev-libs/pugixml
33 43
	dev-libs/zziplib
34 44
	media-libs/freetype:2
35 45
	x11-libs/libX11
36 46
	x11-libs/libXaw
37 47
	x11-libs/libXrandr
38 48
	x11-libs/libXt
49
	assimp? ( media-libs/assimp:= )
50
	bullet? ( sci-physics/bullet:= )
51
	cg? ( media-gfx/nvidia-cg-toolkit )
39 52
	egl? ( media-libs/mesa[egl(+)] )
40 53
	freeimage? ( media-libs/freeimage )
41 54
	json? ( dev-libs/rapidjson )
......
45 58
	)
46 59
	tools? ( dev-libs/tinyxml[stl] )
47 60
"
48
# Dependencies for USE flags that do not work, yet.
49
#	cg? ( media-gfx/nvidia-cg-toolkit )
50
#	gles2? ( media-libs/mesa[gles2] )
51

  
52 61
DEPEND="
53 62
	${RDEPEND}
54 63
	x11-base/xorg-proto
......
59 68
"
60 69

  
61 70
PATCHES=(
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"
71
	"${FILESDIR}"/${PN}-13.5.3-media_path.patch
72
	"${FILESDIR}"/${PN}-13.5.3-resource_path.patch
73
	"${FILESDIR}"/${PN}-13.5.3-gentoolize_imgui_inclusion.patch
74
	"${FILESDIR}"/${PN}-1.10.12-use_system_tinyxml.patch
70 75
)
71 76

  
72
S=${WORKDIR}/${MY_P}
77
src_unpack() {
78
	unpack ${P}.tar.gz || die "Unpacking ${P}.zip failed"
79

  
80
	# Ogre includes imgui, but as a manual download done by Components/Overlay/CMakeLists.txt
81
	# That may fail and so we are doing it ourselves.
82
	cd "${S}" || die "Unpack incomplete"
83
	unpack ${IMGUI_P}.tar.gz || die "Unpacking ${IMGUI_P}.zip failed"
84
}
73 85

  
74 86
src_prepare() {
87
	local broken_png=(
88
		Icon@2x-72.png
89
		Default-Portrait~ipad.png
90
		Default-Portrait@2x~ipad.png
91
		Default-Landscape@2x~ipad.png
92
	)
93

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

  
79 97
	# In this series, the CMAKE_BUILD_TARGET is hard-wired to the
80
	# installation. And only Release, Debug, MinSizeRel and RelWithDebInfo
98
	# installation. And only Debug, MinSizeRel and RelWithDebInfo
81 99
	# are supported.
82 100
	sed -i \
83 101
		-e "s/$(usex debug Debug Release)/Gentoo/g" \
......
85 103
		CMake/Utils/OgreConfigTargets.cmake \
86 104
		|| die
87 105

  
106
	# Fix broken png files
107
	einfo "Fixing broken png files."
108
	pushd "${S}"/Samples/Common/misc 1>/dev/null 2>&1
109
	for png in "${broken_png[@]}"; do
110
		pngfix -q --out=out.png ${png}
111
		mv -f out.png "${png}" || die
112
	done
113
	popd 1>/dev/null 2>&1
114
	einfo "done ..."
115

  
88 116
	# Fix some path issues
89 117
	cmake_src_prepare
90 118
}
91 119

  
92 120
src_configure() {
93 121
	local mycmakeargs=(
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
122
		-DCMAKE_SKIP_INSTALL_RPATH=yes
123
		-DOGRE_ASSERT_MODE=1
124
		-DOGRE_BUILD_COMPONENT_BITES=yes
125
		-DOGRE_BUILD_COMPONENT_BULLET=$(usex bullet)
126
		-DOGRE_BUILD_COMPONENT_CSHARP=no
127
		-DOGRE_BUILD_COMPONENT_JAVA=no
128
		-DOGRE_BUILD_COMPONENT_OVERLAY=yes
129
		-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=yes
130
		-DOGRE_BUILD_COMPONENT_PAGING=yes
131
		-DOGRE_BUILD_COMPONENT_PROPERTY=yes
132
		-DOGRE_BUILD_COMPONENT_PYTHON=no
133
		-DOGRE_BUILD_COMPONENT_RTSHADERSYSTEM=yes
134
		-DOGRE_BUILD_COMPONENT_TERRAIN=yes
135
		-DOGRE_BUILD_COMPONENT_VOLUME=yes
136
		-DOGRE_BUILD_DEPENDENCIES=no
137
		-DOGRE_BUILD_PLUGIN_ASSIMP=$(usex assimp)
138
		-DOGRE_BUILD_PLUGIN_CG=$(usex cg)
139
		-DOGRE_BUILD_PLUGIN_FREEIMAGE=$(usex freeimage)
140
		-DOGRE_BUILD_PLUGIN_EXRCODEC=no
141
		-DOGRE_BUILD_RENDERSYSTEM_GL=$(usex opengl)
101 142
		-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=$(usex opengl)
102 143
		-DOGRE_BUILD_RENDERSYSTEM_GLES2=no
103
		-DOGRE_BUILD_SAMPLES2=$(usex examples)
104
		-DOGRE_BUILD_TESTS=$(usex debug)
144
		-DOGRE_BUILD_SAMPLES=$(usex examples)
145
		-DOGRE_BUILD_TESTS=no
105 146
		-DOGRE_BUILD_TOOLS=$(usex tools)
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)
147
		-DOGRE_CONFIG_DOUBLE=$(usex double-precision)
109 148
		-DOGRE_CONFIG_ENABLE_GL_STATE_CACHE_SUPPORT=$(usex cache)
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
149
		-DOGRE_CONFIG_ENABLE_GLES2_CG_SUPPORT=no
150
		-DOGRE_CONFIG_ENABLE_GLES3_SUPPORT=no
151
		-DOGRE_CONFIG_THREADS=3
114 152
		-DOGRE_CONFIG_THREAD_PROVIDER=std
115
		-DOGRE_FULL_RPATH=no
153
		-DOGRE_ENABLE_PRECOMPILED_HEADERS=$(usex pch)
154
		-DOGRE_GLSUPPORT_USE_EGL=$(usex egl)
116 155
		-DOGRE_INSTALL_DOCS=$(usex doc)
117 156
		-DOGRE_INSTALL_SAMPLES=$(usex examples)
118
		-DOGRE_INSTALL_SAMPLES_SOURCE=$(usex examples)
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)
157
		-DOGRE_NODELESS_POSITIONING=$(usex deprecated)
158
		-DOGRE_PROFILING=$(usex profile)
159
		-DOGRE_RESOURCEMANAGER_STRICT=$(usex resman-pedantic 1 2)
125 160
	)
126 161

  
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
	)
162
	cmake_src_configure
163
}
139 164

  
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
	)
165
src_compile() {
166
	cmake_src_compile
152 167

  
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
168
	if use doc ; then
169
		eninja -C "${BUILD_DIR}" OgreDoc
158 170
	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
172 171
}
173 172

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

  
191
	# These are only for the Samples
186
	# These are only for the sample browser
192 187
	if use examples ; then
193 188
		insinto "${SHAREDIR}"
194 189
		doins "${BUILD_DIR}"/bin/samples.cfg
195 190
	fi
196 191
}
192

  
193
pkg_postinst() {
194
	elog "If you experience crashes when starting /usr/bin/SampleBrowser,"
195
	elog "remove the cache directory at:"
196
	elog "  '~/.cache/OGRE Sample Browser'"
197
	elog "first, before filing a bug report."
198
}
Thank you!