Diff clanlib-0.8.1-r2 with a clanlib-2.3.7-r3

/usr/portage/dev-games/clanlib/clanlib-2.3.7-r3.ebuild 2024-07-02 13:51:43.953851457 +0300
3 3

  
4 4
EAPI=7
5 5

  
6
inherit autotools flag-o-matic
6
inherit autotools toolchain-funcs
7 7

  
8
MY_P=ClanLib-${PV}
8 9
DESCRIPTION="Multi-platform game development library"
9 10
HOMEPAGE="https://github.com/sphair/ClanLib"
10
SRC_URI="mirror://gentoo/ClanLib-${PV}.tgz"
11
S="${WORKDIR}"/ClanLib-${PV}
11
SRC_URI="mirror://gentoo/${MY_P}.tgz"
12
S="${WORKDIR}"/${MY_P}
12 13

  
13 14
LICENSE="ZLIB"
14
SLOT="0.8"
15
# Not big endian safe! #82779
15
SLOT="2.3"
16 16
KEYWORDS="amd64 x86"
17
IUSE="doc ipv6 mikmod opengl sdl static-libs vorbis"
17
IUSE="doc ipv6 mikmod opengl +sound sqlite cpu_flags_x86_sse2 static-libs vorbis X"
18
REQUIRED_USE="opengl? ( X )"
18 19

  
19
# opengl keyword does not drop the GL/GLU requirement.
20
# Autoconf files need to be fixed
21
RDEPEND="
22
	media-libs/alsa-lib
23
	media-libs/libpng:0
24
	virtual/jpeg:0
25
	virtual/glu
26
	virtual/opengl
27
	x11-libs/libXi
28
	x11-libs/libXmu
29
	x11-libs/libXxf86vm
30
	mikmod? ( media-libs/libmikmod )
31
	sdl? (
32
		media-libs/libsdl[X]
33
		media-libs/sdl-gfx
20
BDEPEND="
21
	virtual/pkgconfig
22
	doc? (
23
		app-text/doxygen
24
		dev-lang/perl
25
		media-gfx/graphviz
34 26
	)
35
	vorbis? ( media-libs/libvorbis )
36 27
"
37
DEPEND="
38
	${RDEPEND}
39
	x11-base/xorg-proto
28
RDEPEND="
29
	sys-libs/zlib
30
	X? (
31
		app-arch/bzip2
32
		media-libs/libpng:0
33
		media-libs/freetype
34
		media-libs/fontconfig
35
		media-libs/libjpeg-turbo:0=
36
		x11-libs/libX11
37
		opengl? ( virtual/opengl )
38
	)
39
	mikmod? (
40
		media-libs/alsa-lib
41
		media-libs/libmikmod
42
	)
43
	sqlite? ( dev-db/sqlite:3 )
44
	sound? ( media-libs/alsa-lib )
45
	vorbis? (
46
		media-libs/alsa-lib
47
		media-libs/libogg
48
		media-libs/libvorbis
49
	)
40 50
"
51
DEPEND="${RDEPEND}"
41 52

  
42 53
PATCHES=(
43
	"${FILESDIR}/${P}-ndebug.patch"
44
	"${FILESDIR}/${P}-gcc43.patch"
45
	"${FILESDIR}/${P}-gcc44.patch"
46
	"${FILESDIR}/${P}-gcc47.patch"
47
	"${FILESDIR}/${P}-gcc6.patch"
48
	"${FILESDIR}/${P}-llvm.patch"
49
	"${FILESDIR}/${P}-libpng15.patch"
50
	"${FILESDIR}/${P}-docbuilder.patch"
51
	"${FILESDIR}/${P}-glibc2.34.patch"
52
	"${FILESDIR}/${P}-gcc12.patch"
53
	"${FILESDIR}"/${P}-makefile-duplicate-headers.patch
54
	"${FILESDIR}"/${P}-autotools.patch
55
	"${FILESDIR}"/${P}-doc.patch
56
	"${FILESDIR}"/${P}-freetype_pkgconfig.patch #764902
57
	"${FILESDIR}"/${P}-glibc2.34.patch
58
	"${FILESDIR}"/${P}-32bit-opengl.patch
59
	# From Fedora
60
	"${FILESDIR}"/${P}-gcc47.patch
61
	"${FILESDIR}"/${P}-gcc7.patch
62
	"${FILESDIR}"/${P}-non-x86.patch
63
	"${FILESDIR}"/${P}-no-ldflags-for-conftest.patch
64
	"${FILESDIR}"/${P}-no-wm_type-in-fs.patch
54 65
)
55 66

  
56
DOCS=(
57
	CODING_STYLE CREDITS NEWS PATCHES
58
	README{,.anjuta,.distros,.kdevelop,.sdl,.upgrade} INSTALL.linux
59
)
67
DOCS=( CODING_STYLE CREDITS PATCHES README )
60 68

  
61 69
src_prepare() {
62 70
	default
71

  
63 72
	eautoreconf
64
	# See #739358
65
	sed -i -e "s:libdir=\${exec_prefix}/lib:libdir=@libdir@:g" \
66
		pkgconfig/*.pc.in || die
73

  
74
	ln -sf ../../../Sources/API Documentation/Utilities/ReferenceDocs/ClanLib || die
67 75
}
68 76

  
69 77
src_configure() {
70
	# -Werror=strict-aliasing
71
	# https://bugs.gentoo.org/855308
72
	# Fixed in newer versions
73
	# Do not trust with LTO either.
74
	append-flags -fno-strict-aliasing
75
	filter-lto
76

  
77
	# clanSound only controls mikmod/vorbis so there's
78
	# no need to pass --{en,dis}able-clanSound ...
79
	# clanDisplay only controls X, SDL, OpenGL plugins
80
	# so no need to pass --{en,dis}able-clanDisplay
81
	# also same reason why we don't have to use clanGUI
82
	econf \
83
		--enable-dyn \
84
		--enable-clanNetwork \
85
		$(use_enable x86 asm386) \
86
		$(use_enable doc docs) \
87
		$(use_enable opengl clanGL) \
88
		$(use_enable sdl clanSDL) \
89
		$(use_enable vorbis clanVorbis) \
90
		$(use_enable mikmod clanMikMod) \
91
		$(use_enable ipv6 getaddr) \
92
		$(use_enable static-libs static)
78
	# Add -DPACKAGE_BUGREPORT?
79
	local myeconfargs=(
80
		$(use_enable doc docs)
81
		$(use_enable cpu_flags_x86_sse2 sse2)
82
		$(use_enable opengl clanGL)
83
		$(use_enable opengl clanGL1)
84
		$(use_enable opengl clanGUI)
85
		$(use_enable X clanDisplay)
86
		$(use_enable vorbis clanVorbis)
87
		$(use_enable mikmod clanMikMod)
88
		$(use_enable sqlite clanSqlite)
89
		$(use_enable ipv6 getaddr)
90
	)
91

  
92
	use sound \
93
		|| use vorbis \
94
		|| use mikmod \
95
		|| myeconfargs+=( --disable-clanSound )
96

  
97
	tc-export PKG_CONFIG
98

  
99
	econf "${myeconfargs[@]}"
100
}
101

  
102
src_compile() {
103
	emake
104

  
105
	use doc && emake html
93 106
}
94 107

  
108
# html files are keeped in a directory that is dependent on the SLOT
109
# so to keep eventual bookmarks to the doc from version to version
95 110
src_install() {
96 111
	default
97 112

  
113
	find "${ED}" -type f -name '*.la' -delete || die
114

  
98 115
	if use doc ; then
99
		dodir /usr/share/doc/${PF}/html
100
		mv "${D}"/usr/share/doc/clanlib/* "${D}"/usr/share/doc/${PF}/html/ || die
101
		rm -rf "${D}"/usr/share/doc/clanlib
102
		cp -r Examples Resources "${D}"/usr/share/doc/${PF}/ || die
116
		emake DESTDIR="${D}" install-html
117
		dodoc -r Examples Resources
103 118
	fi
104

  
105
	find "${ED}" -name '*.la' -delete || die
106 119
}
Thank you!