Diff openra-20190314-r100 with a openra-20231010-r2

/usr/portage/games-strategy/openra/openra-20231010-r2.ebuild 2025-02-03 17:39:34.042671255 +0300
1
# Copyright 1999-2021 Gentoo Authors
1
# Copyright 1999-2025 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 6
LUA_COMPAT=( lua5-1 )
7 7

  
8
inherit lua-single mono-env xdg-utils
8
DOTNET_PKG_COMPAT=6.0
9
NUGETS="
10
discordrichpresence@1.1.3.18
11
linguini.bundle@0.5.0
12
linguini.shared@0.5.0
13
linguini.syntax@0.5.0
14
microsoft.extensions.dependencymodel@6.0.0
15
microsoft.netcore.platforms@1.1.0
16
microsoft.netcore.platforms@1.1.1
17
microsoft.netcore.platforms@5.0.0
18
microsoft.netcore.targets@1.1.0
19
microsoft.win32.primitives@4.3.0
20
microsoft.win32.registry@5.0.0
21
mono.nat@3.0.4
22
mp3sharp@1.0.5
23
newtonsoft.json@13.0.1
24
nuget.commandline@4.4.1
25
nvorbis@0.10.5
26
openra-eluant@1.0.22
27
openra-freetype6@1.0.11
28
openra-fuzzylogiclibrary@1.0.1
29
openra-openal-cs@1.0.22
30
openra-sdl2-cs@1.0.40
31
pfim@0.11.2
32
rix0rrr.beaconlib@1.0.2
33
runtime.any.system.collections@4.3.0
34
runtime.any.system.diagnostics.tracing@4.3.0
35
runtime.any.system.globalization.calendars@4.3.0
36
runtime.any.system.globalization@4.3.0
37
runtime.any.system.io@4.3.0
38
runtime.any.system.reflection.primitives@4.3.0
39
runtime.any.system.reflection@4.3.0
40
runtime.any.system.resources.resourcemanager@4.3.0
41
runtime.any.system.runtime.handles@4.3.0
42
runtime.any.system.runtime.interopservices@4.3.0
43
runtime.any.system.runtime@4.3.0
44
runtime.any.system.text.encoding.extensions@4.3.0
45
runtime.any.system.text.encoding@4.3.0
46
runtime.any.system.threading.tasks@4.3.0
47
runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl@4.3.2
48
runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl@4.3.2
49
runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl@4.3.2
50
runtime.native.system.net.http@4.3.0
51
runtime.native.system.security.cryptography.apple@4.3.0
52
runtime.native.system.security.cryptography.openssl@4.3.2
53
runtime.native.system@4.3.0
54
runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl@4.3.2
55
runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl@4.3.2
56
runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple@4.3.0
57
runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl@4.3.2
58
runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl@4.3.2
59
runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl@4.3.2
60
runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl@4.3.2
61
runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl@4.3.2
62
runtime.unix.microsoft.win32.primitives@4.3.0
63
runtime.unix.system.diagnostics.debug@4.3.0
64
runtime.unix.system.io.filesystem@4.3.0
65
runtime.unix.system.net.primitives@4.3.0
66
runtime.unix.system.private.uri@4.3.0
67
runtime.unix.system.runtime.extensions@4.3.0
68
sharpziplib@1.4.2
69
stylecop.analyzers.unstable@1.2.0.435
70
stylecop.analyzers@1.2.0-beta.435
71
system.buffers@4.3.0
72
system.buffers@4.5.1
73
system.collections.concurrent@4.3.0
74
system.collections@4.3.0
75
system.diagnostics.debug@4.3.0
76
system.diagnostics.diagnosticsource@4.3.0
77
system.diagnostics.tracing@4.3.0
78
system.globalization.calendars@4.3.0
79
system.globalization.extensions@4.3.0
80
system.globalization@4.3.0
81
system.io.filesystem.primitives@4.3.0
82
system.io.filesystem@4.3.0
83
system.io@4.3.0
84
system.linq@4.3.0
85
system.memory@4.5.3
86
system.memory@4.5.4
87
system.net.http@4.3.4
88
system.net.primitives@4.3.0
89
system.private.uri@4.3.0
90
system.reflection.primitives@4.3.0
91
system.reflection@4.3.0
92
system.resources.resourcemanager@4.3.0
93
system.runtime.compilerservices.unsafe@6.0.0
94
system.runtime.extensions@4.3.0
95
system.runtime.handles@4.3.0
96
system.runtime.interopservices@4.3.0
97
system.runtime.loader@4.3.0
98
system.runtime.numerics@4.3.0
99
system.runtime@4.3.0
100
system.security.accesscontrol@5.0.0
101
system.security.cryptography.algorithms@4.3.0
102
system.security.cryptography.cng@4.3.0
103
system.security.cryptography.csp@4.3.0
104
system.security.cryptography.encoding@4.3.0
105
system.security.cryptography.openssl@4.3.0
106
system.security.cryptography.primitives@4.3.0
107
system.security.cryptography.x509certificates@4.3.0
108
system.security.principal.windows@5.0.0
109
system.text.encoding.extensions@4.3.0
110
system.text.encoding@4.3.0
111
system.text.encodings.web@6.0.0
112
system.text.json@6.0.0
113
system.threading.channels@6.0.0
114
system.threading.tasks@4.3.0
115
system.threading@4.3.0
116
system.valuetuple@4.5.0
117
taglibsharp@2.3.0
118
"
9 119

  
10
MY_PV=release-${PV}
11
#MY_PV=playtest-${PV}
120
inherit check-reqs dotnet-pkg lua-single xdg
12 121

  
13 122
DESCRIPTION="A free RTS engine supporting games like Command & Conquer, Red Alert and Dune2k"
14
HOMEPAGE="https://www.openra.net/"
123
HOMEPAGE="https://www.openra.net/
124
	https://github.com/OpenRA/OpenRA/"
125

  
126
if [[ "${PV}" == *9999* ]] ; then
127
	inherit git-r3
128

  
129
	EGIT_REPO_URI="https://github.com/OpenRA/OpenRA.git"
130
else
131
	SRC_URI="https://github.com/OpenRA/OpenRA/archive/release-${PV}.tar.gz
132
		-> ${P}.tar.gz"
133
	S="${WORKDIR}/OpenRA-release-${PV}"
15 134

  
16
# This sed one-liner was used to generate the SRC_URI list
17
# below. Ideally we would package these DLLs separately instead but
18
# Gentoo Dotnet doesn't seem to be in great shape right now.
19
#
20
# sed -n -r -e 's@.*curl.*(https:[^ ]+/([^/]+)/([^.]+)([^ ]+)).*@\1 -> \3-\2\4@p' \
21
#           -e 's@.*noget\.sh ([^ ]+) ([^ ]+).*@https://www.nuget.org/api/v2/package/\1/\2 -> \1-\2.zip@p' \
22
#           "${S}"/thirdparty/fetch-thirdparty-deps.sh | grep -v 'NUnit\|StyleCop' | sort
23

  
24
SRC_URI="https://github.com/OpenRA/OpenRA/archive/${MY_PV}.tar.gz -> ${P}.tar.gz
25
	https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll -> Eluant-20160124.dll
26
	https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/OpenAL-CS.dll.config -> OpenAL-CS-20151227.dll.config
27
	https://github.com/OpenRA/OpenAL-CS/releases/download/20151227/OpenAL-CS.dll -> OpenAL-CS-20151227.dll
28
	https://github.com/OpenRA/SDL2-CS/releases/download/20161223/SDL2-CS.dll.config -> SDL2-CS-20161223.dll.config
29
	https://github.com/OpenRA/SDL2-CS/releases/download/20161223/SDL2-CS.dll -> SDL2-CS-20161223.dll
30
	https://www.nuget.org/api/v2/package/FuzzyLogicLibrary/1.2.0 -> FuzzyLogicLibrary-1.2.0.zip
31
	https://www.nuget.org/api/v2/package/MaxMind.Db/2.0.0 -> MaxMind.Db-2.0.0.zip
32
	https://www.nuget.org/api/v2/package/Open.Nat/2.1.0 -> Open.Nat-2.1.0.zip
33
	https://www.nuget.org/api/v2/package/rix0rrr.BeaconLib/1.0.1 -> rix0rrr.BeaconLib-1.0.1.zip
34
	https://www.nuget.org/api/v2/package/SharpFont/4.0.1 -> SharpFont-4.0.1.zip
35
	https://www.nuget.org/api/v2/package/SharpZipLib/0.86.0 -> SharpZipLib-0.86.0.zip"
135
	KEYWORDS="~amd64"
136
fi
137

  
138
SRC_URI+=" ${NUGET_URIS} "
36 139

  
37 140
# Engine is GPL-3, dependent DLLs are mixed.
38 141
LICENSE="GPL-3 Apache-2.0 BSD GPL-2 MIT"
39

  
40 142
SLOT="0"
41
KEYWORDS="~amd64 ~x86"
42
IUSE="+debug geoip"
43

  
44 143
REQUIRED_USE="${LUA_REQUIRED_USE}"
45 144

  
46
RESTRICT="mirror test"
47

  
48
MONO_DEP=">=dev-lang/mono-4.2"
49
BDEPEND="
50
	app-arch/unzip
51
	${MONO_DEP}
52
"
53
DEPEND="
54
	dev-dotnet/libgdiplus
55
	${MONO_DEP}
56
"
57
RDEPEND="${DEPEND}
58
	app-misc/ca-certificates
145
RDEPEND="
59 146
	${LUA_DEPS}
147
	app-misc/ca-certificates
60 148
	media-libs/freetype:2
61 149
	media-libs/libsdl2[opengl,video]
62 150
	media-libs/openal
63
	geoip? ( net-misc/geoipupdate )"
64

  
65
S="${WORKDIR}/OpenRA-${MY_PV}"
151
"
152
BDEPEND="
153
	${RDEPEND}
154
"
66 155

  
156
CHECKREQS_DISK_BUILD="2G"
67 157
PATCHES=(
68
	"${FILESDIR}"/${PN}-system-geoip.patch
158
	"${FILESDIR}/${PN}-20231010-configure-system-libraries.patch"
159
	"${FILESDIR}/${PN}-20231010-makefile.patch"
160
	"${FILESDIR}/${PN}-20231010-packaging-functions.patch"
161
	"${FILESDIR}/${PN}-20231010-handle-multilib.patch"
69 162
)
70 163

  
71
DOCS=(
72
	AUTHORS
73
	CODE_OF_CONDUCT.md
74
	CONTRIBUTING.md
75
	README.md
76
)
164
DOCS=( AUTHORS CODE_OF_CONDUCT.md CONTRIBUTING.md README.md )
77 165

  
78 166
pkg_setup() {
167
	check-reqs_pkg_setup
168
	dotnet-pkg_pkg_setup
79 169
	lua-single_pkg_setup
80
	mono-env_pkg_setup
81 170
}
82 171

  
83 172
src_unpack() {
84
	local DOWNLOADS="${S}"/thirdparty/download
85
	mkdir -p "${DOWNLOADS}" || die
86

  
87
	# Stub out unnecessary development dependencies.
88
	touch "${DOWNLOADS}"/{{nunit.framework,StyleCop{,Plus}}.dll,nunit3-console.exe} || die
89

  
90
	for a in ${A}; do
91
		case ${a} in
92
			# Unpack engine sources.
93
			${P}.tar.gz) unpack ${a} ;;
94

  
95
			# Symlink other downloads, Makefile will extract and copy.
96
			*) ln -snf "${DISTDIR}/${a}" "${DOWNLOADS}/${a%-[0-9]*}${a##*[0-9]}" || die ;;
97
		esac
98
	done
99
}
100

  
101
src_prepare() {
102
	# Stub out attempts to download anything.
103
	sed -i -r 's/^\s*(curl|wget)\b/: #\1/' thirdparty/{fetch-thirdparty-deps,noget}.sh || die
173
	dotnet-pkg_src_unpack
104 174

  
105
	# Extract what is needed from the downloads.
106
	emake cli-dependencies
107

  
108
	default
175
	if [[ -n "${EGIT_REPO_URI}" ]] ; then
176
		git-r3_src_unpack
177
	fi
109 178
}
110 179

  
111 180
src_compile() {
112
	emake $(usex debug "" DEBUG=false)
113
	emake VERSION=${MY_PV} version man-page
181
	emake VERSION="release-${PV}" version
182
	emake RUNTIME=net6
114 183
}
115 184

  
116 185
src_install() {
117
	emake $(usex debug "" DEBUG=false) \
118
		prefix="${EPREFIX}"/usr \
119
		gameinstalldir='$(prefix)'/share/${PN} \
120
		DESTDIR="${D}" \
121
		VERSION=${MY_PV} \
122
		install \
123
		install-linux-mime \
124
		install-linux-shortcuts \
125
		install-man-page
126

  
127
	einstalldocs
128
}
129

  
130
pkg_postinst() {
131
	xdg_icon_cache_update
132
	xdg_desktop_database_update
133
	xdg_mimeinfo_database_update
134

  
135
	if [[ ! -s ${EROOT}/usr/share/GeoIP/GeoLite2-Country.mmdb ]]; then
136
		echo
137
		ewarn "Multiplayer server locations will show as unknown until you install"
138

  
139
		if use geoip; then
140
			ewarn "a GeoIP database. Run emerge --config ${CATEGORY}/${PN}"
141
			ewarn "occasionally to fetch one and keep it current."
142
		else
143
			ewarn "a GeoIP database. Start by enabling the geoip USE flag."
144
		fi
145
	fi
186
	local openra_home="/usr/lib/${PN}"
146 187

  
147
	if [[ ! -d ${EROOT}/usr/share/.mono/certs ]]; then
148
		echo
149
		ewarn "The multiplayer server listing will not work at all until you install"
150
		ewarn "CA certificates using Mono's cert-sync. Run emerge --config"
151
		ewarn "${CATEGORY}/${PN} occasionally to set them up and keep them"
152
		ewarn "current."
153
	fi
154
}
155

  
156
pkg_postrm() {
157
	xdg_icon_cache_update
158
	xdg_desktop_database_update
159
	xdg_mimeinfo_database_update
160
}
161

  
162
pkg_config() {
163
	if use geoip; then
164
		ebegin "Updating GeoIP database"
165
		geoipupdate -d "${EROOT}"/usr/share/GeoIP
166
		eend $?
167
	fi
188
	# We compiled to "bin", not standard "dotnet-pkg" path.
189
	mkdir -p "${ED}/usr/share" || die
190
	cp -r bin "${ED}/usr/share/${P}" || die
191

  
192
	# This is used by "linux-shortcuts" (see below make-install).
193
	dotnet-pkg-base_launcherinto "${openra_home}"
194
	dotnet-pkg-base_dolauncher "/usr/share/${P}/OpenRA" OpenRA
195
	dotnet-pkg-base_dolauncher "/usr/share/${P}/OpenRA.Server" OpenRA.Server
196

  
197
	emake DESTDIR="${ED}" RUNTIME=net6 prefix=/usr bindir=/usr/bin \
198
		  install install-linux-shortcuts install-linux-appdata install-man
199

  
200
	local -a assets=(
201
		glsl
202
		mods
203
		AUTHORS
204
		COPYING
205
		VERSION
206
		'global mix database.dat'
207
	)
208
	local asset
209
	for asset in "${assets[@]}" ; do
210
		dosym -r "${openra_home}/${asset}" "/usr/share/${P}/${asset}"
211
	done
168 212

  
169
	ebegin "Updating Mono CA certificates"
170
	cert-sync --quiet "${EROOT}"/etc/ssl/certs/ca-certificates.crt
171
	eend $?
172

  
173
	if [[ -n ${ROOT} ]]; then
174
		echo
175
		ewarn "Mono's cert-sync cannot write to your ROOT system so you must manually"
176
		ewarn "copy the certificates from ${EPREFIX}/usr/share/.mono to ${EROOT}/usr/share/.mono."
177
	fi
213
	einstalldocs
178 214
}
Thank you!