Сравнение xpra-4.4.6-r3 с xpra-9999

/usr/portage/x11-wm/xpra/xpra-9999.ebuild 2025-07-29 16:22:17.984470439 +0300
3 3

  
4 4
EAPI=8
5 5

  
6
if [[ ${PV} = 9999* ]]; then
6
if [[ ${PV} = *9999* ]]; then
7 7
	EGIT_REPO_URI="https://github.com/Xpra-org/xpra.git"
8
	if [[ ${PV} = 6.9999* ]]; then
9
		EGIT_BRANCH="v6.x"
10
	fi
8 11
	inherit git-r3
9 12
else
10 13
	inherit pypi
11 14
	KEYWORDS="~amd64 ~x86"
12 15
fi
13 16

  
14
PYTHON_COMPAT=( python3_{10..11} )
17
PYTHON_COMPAT=( python3_{11..13} )
15 18
DISTUTILS_USE_PEP517=setuptools
16 19
DISTUTILS_SINGLE_IMPL=yes
17 20
DISTUTILS_EXT=1
18 21

  
19
inherit xdg distutils-r1 prefix tmpfiles udev
22
inherit cuda xdg distutils-r1 prefix tmpfiles udev
20 23

  
21 24
DESCRIPTION="X Persistent Remote Apps (xpra) and Partitioning WM (parti) based on wimpiggy"
22 25
HOMEPAGE="https://xpra.org/"
23 26
LICENSE="GPL-2 BSD"
24 27
SLOT="0"
25
IUSE="brotli +client +clipboard crypt csc cups dbus doc ffmpeg jpeg html ibus +lz4 minimal oauth opengl pinentry pulseaudio +server sound systemd test +trayicon udev vpx webcam webp xdg xinerama"
26
IUSE+=" +python_single_target_python3_11"
28
IUSE="+X avif brotli +client +clipboard crypt csc cuda cups dbus debug doc examples gstreamer +gtk3 html ibus jpeg +lz4 mdns minimal oauth opengl openh264 pinentry pulseaudio qrcode +server sound systemd test +trayicon udev vpx webcam webp x264 xdg xinerama "
29
IUSE+=" video_cards_nvidia"
30
RESTRICT="!test? ( test )"
27 31

  
28 32
REQUIRED_USE="${PYTHON_REQUIRED_USE}
29
	|| ( client server )
33
	|| ( client gtk3 server )
30 34
	cups? ( dbus )
31 35
	oauth? ( server )
32 36
	opengl? ( client )
33
	test? ( client clipboard crypt dbus html server sound xdg xinerama )
37
	clipboard? ( gtk3 )
38
	gtk3? ( client )
39
	test? ( client clipboard crypt dbus gstreamer html server sound xdg xinerama )
34 40
"
35 41

  
36 42
TEST_DEPEND="
......
44 50
	server? (
45 51
		x11-base/xorg-server[-minimal,xvfb]
46 52
		x11-drivers/xf86-input-void
53
		x11-drivers/xf86-video-dummy
47 54
	)
55
	webcam? ( media-video/v4l2loopback )
48 56
	xinerama? ( x11-libs/libfakeXinerama )
49 57
"
50 58
DEPEND="
51 59
	${PYTHON_DEPS}
52 60
	$(python_gen_cond_dep '
53
		dev-python/pygobject:3[${PYTHON_USEDEP},cairo]
61
		dev-python/pygobject:3[${PYTHON_USEDEP}]
54 62
		opengl? ( dev-python/pyopengl[${PYTHON_USEDEP}] )
55 63
		sound? ( dev-python/gst-python:1.0[${PYTHON_USEDEP}] )
64
		gtk3? (
65
			dev-python/pygobject:3[cairo]
66
		)
56 67
	')
57
	x11-libs/gtk+:3[introspection]
58
	x11-libs/libX11
59
	x11-libs/libXcomposite
60
	x11-libs/libXdamage
61
	x11-libs/libXfixes
62
	x11-libs/libXrandr
63
	x11-libs/libXres
64
	x11-libs/libXtst
65
	x11-libs/libxkbfile
68
	dev-libs/xxhash
69
	avif? ( media-libs/libavif )
66 70
	brotli? ( app-arch/brotli )
67
	csc? ( >=media-video/ffmpeg-1.2.2:0= )
68
	ffmpeg? ( >=media-video/ffmpeg-3.2.2:0=[x264] )
71
	client? (
72
			x11-libs/gtk+:3[X?,introspection]
73
		)
69 74
	jpeg? ( media-libs/libjpeg-turbo )
75
	mdns? ( dev-libs/mdns )
76
	!minimal? ( sys-libs/pam )
77
	openh264? ( media-libs/openh264:= )
70 78
	pulseaudio? (
71
		media-libs/libpulse
72 79
		media-plugins/gst-plugins-pulse:1.0
80
		media-plugins/gst-plugins-opus
73 81
	)
82
	qrcode? ( media-gfx/qrencode )
74 83
	sound? (
75 84
		media-libs/gstreamer:1.0
76 85
		media-libs/gst-plugins-base:1.0
77 86
	)
78
	vpx? ( media-libs/libvpx media-video/ffmpeg )
87
	vpx? ( media-libs/libvpx )
79 88
	webp? ( media-libs/libwebp )
89
	X? (
90
		x11-apps/xrandr
91
		x11-libs/libXcomposite
92
		x11-libs/libXdamage
93
		x11-libs/libXfixes
94
		x11-libs/libXrandr
95
		x11-libs/libXres
96
		x11-libs/libXtst
97
		x11-libs/libxkbfile
98
	)
99
	x264? ( media-libs/x264 )
80 100
"
101
# nvenc? ( amd64? ( media-libs/nv-codec-headers ) )
81 102
RDEPEND="
82 103
	${DEPEND}
83 104
	${TEST_DEPEND}
......
103 124
	udev? ( virtual/udev )
104 125
"
105 126
DEPEND+="
106
	test? ( ${TEST_DEPEND} )
127
	test? (
128
		${TEST_DEPEND}
129
		$(python_gen_cond_dep '
130
			dev-python/paramiko[${PYTHON_USEDEP}]
131
		')
132
	)
107 133
"
108 134
BDEPEND="
109 135
	$(python_gen_cond_dep '
110
		>=dev-python/cython-0.16[${PYTHON_USEDEP}]
136
		dev-python/cython[${PYTHON_USEDEP}]
137
		dev-python/pip[${PYTHON_USEDEP}]
111 138
	')
112 139
	virtual/pkgconfig
113 140
	doc? ( virtual/pandoc )
114 141
"
115 142

  
116
# Broken by PEP517 migration, and some tests failed for a while before that for
117
# unknown reasons.
118
RESTRICT="test"
119

  
120 143
PATCHES=(
121
	"${FILESDIR}"/${PN}-4.4-xdummy.patch
144
	"${FILESDIR}/${PN}-9999-pep517.patch"
122 145
)
123 146

  
124
python_prepare_all() {
125
	if use minimal; then
126
		sed -r -e '/pam_ENABLED/s/DEFAULT/False/' \
127
			-e 's/^(xdg_open)_ENABLED = .*/\1_ENABLED = False/' \
128
			-i setup.py || die
129
		PATCHES+=( "${FILESDIR}"/${PN}-4.4.6_minimal-features.patch )
130
	fi
147
src_prepare() {
148
	default
131 149

  
150
	sed \
151
		-e 's#UNITTESTS_DIR=`dirname $(readlink -f $0)`#: "${UNITTESTS_DIR:=`dirname $(readlink -f $0)`}"#' \
152
		-e 's#INSTALL_ROOT="$SRC_DIR/dist/python${PYTHON_VERSION}"#: "${INSTALL_ROOT:=$SRC_DIR/dist/python${PYTHON_VERSION}}"#' \
153
		-e '/setup.py install/d' \
154
		-i "${S}/tests/unittests/run" || die
155
}
156

  
157
python_prepare_all() {
132 158
	distutils-r1_python_prepare_all
133 159

  
134 160
	hprefixify xpra/scripts/config.py
135 161

  
136 162
	sed -r -e "/\bdoc_dir =/s:/${PN}/\":/${PF}/html\":" \
137 163
		-i setup.py || die
164

  
165
	if use minimal; then
166
		sed -r -e '/pam_ENABLED/s/DEFAULT/False/' \
167
			-e 's/^(xdg_open)_ENABLED = .*/\1_ENABLED = False/' \
168
			-i setup.py || die
169
	fi
138 170
}
139 171

  
140 172
python_configure_all() {
......
142 174
		-i setup.py || die
143 175

  
144 176
	DISTUTILS_ARGS=(
145
		--without-PIC
146
		--without-Xdummy
147
		$(use_with client)
148
		$(use_with clipboard)
149
		$(use_with csc csc_swscale)
177
		--with-PIC
178
		"$(use_with avif)"
179
		"$(use_with brotli)"
180
		"$(use_with sound audio)"
181
		"$(use_with client)"
182
		"$(use_with clipboard)"
183
		"$(use_with csc csc_cython)"
150 184
		--without-csc_libyuv
151
		--without-cuda_rebuild
152
		--without-cuda_kernels
153
		$(use_with cups printing)
154
		--without-debug
155
		$(use_with dbus)
156
		$(use_with doc docs)
157
		$(use_with ffmpeg dec_avcodec2)
158
		$(use_with ffmpeg enc_ffmpeg)
159
		$(use_with ffmpeg enc_x264)
160
		--without-enc_x265
161
		--with-gtk3
162
		$(use_with jpeg jpeg_encoder)
163
		$(use_with jpeg jpeg_decoder)
164
		--without-mdns
165
		--without-sd_listen
166
		--without-service
167
		$(use_with opengl)
168
		$(use_with server shadow)
169
		$(use_with server)
170
		$(use_with sound)
171
		--without-strict
172
		$(use_with vpx)
173
		--with-warn
174
		$(use_with webcam)
175
		$(use_with webp)
176
		--with-x11
185
		# "$(use_with csc csc_libyuv)" # https://chromium.googlesource.com/libyuv/libyuv
186
		"$(use_with cuda cuda_rebuild)"
187
		"$(use_with cuda cuda_kernels)"
188
		"$(use_with dbus)"
189
		"$(use_with debug)"
190
		"$(use_with doc docs)"
191
		--without-evdi
192
		# "$(use_with evdi)" x11-drivers/evdi::guru
193
		"$(use_with examples example)"
194
		"$(use_with gstreamer)"
195
		"$(use_with gstreamer gstreamer_audio)"
196
		"$(use_with gstreamer gstreamer_video)"
197
		"$(use_with gtk3)"
198
		"$(use_with html http)"
199
		"$(use_with mdns)"
200
		"$(use_with video_cards_nvidia nvidia)"
201
		--without-nvdec
202
		--without-nvenc
203
		--without-nvfbc
204
		# "$(use_with nvenc nvdec)" # NVIDIA Video Codec SDK
205
		# "$(use_with nvenc nvenc)" # NVIDIA Video Codec SDK
206
		# "$(use_with nvenc nvfbc)" # NVIDIA Capture SDK
207
		"$(use_with opengl)"
208
		"$(use_with openh264)"
209
		"$(use_with cups printing)"
210
		--without-pandoc_lua
211
		"$(use_with qrcode qrencode)"
212
		--without-quic
213
		# "$(use_with quic)" # https://github.com/aiortc/aioquic
214
		"$(use_with systemd sd_listen)"
215
		"$(use_with server)"
216
		"$(use_with systemd service)"
217
		"$(use_with server shadow)"
218
		"$(use_with vpx)"
219
		"$(use_with webcam)"
220
		"$(use_with webp)"
221
		"$(use_with X x11)"
222
		"$(use_with X Xdummy)"
223

  
224
		"$(use_with test tests)"
225
		--with-strict
226
		# --with-verbose
227
		# --with-warn
228
		# --with-cythonize_more
229

  
230
		--pkg-config-path="${S}/fs/lib/pkgconfig"
177 231
	)
178 232

  
179
	export XPRA_SOCKET_DIRS="${EPREFIX}/run/xpra"
233
	if use server; then
234
		DISTUTILS_ARGS+=(
235
			"$(use_with jpeg jpeg_encoder)"
236
			"$(use_with vpx vpx_encoder)"
237
			"$(use_with openh264 openh264_encoder)"
238
			"$(use_with cuda nvjpeg_encoder)"
239
			"$(use_with avif avif_encoder)"
240
			"$(use_with webp webp_encoder)"
241
			--without-spng_encoder
242
			# "$(use_with spng spng_encoder)" # https://github.com/randy408/libspng
243
		)
244
	else
245
		DISTUTILS_ARGS+=(
246
			--without-jpeg_encoder
247
			--without-vpx_encoder
248
			--without-openh264_encoder
249
			--without-nvjpeg_encoder
250
			--without-avif_encoder
251
			--without-webp_encoder
252
			--without-spng_encoder
253
		)
254
	fi
255

  
256
	if use client || use gtk3; then
257
		DISTUTILS_ARGS+=(
258
			"$(use_with vpx vpx_decoder)"
259
			"$(use_with openh264 openh264_decoder)"
260
			"$(use_with cuda nvjpeg_decoder)"
261
			"$(use_with jpeg jpeg_decoder)"
262
			"$(use_with avif avif_decoder)"
263
			"$(use_with webp webp_decoder)"
264
			--without-spng_decoder
265
			# "$(use_with spng spng_decoder)" # https://github.com/randy408/libspng
266
		)
267
	else
268
		DISTUTILS_ARGS+=(
269
			--without-jpeg_decoder
270
			--without-vpx_decoder
271
			--without-openh264_decoder
272
			--without-nvjpeg_decoder
273
			--without-avif_decoder
274
			--without-webp_decoder
275
			--without-spng_decoder
276
		)
277
	fi
278

  
279
	DISTUTILS_ARGS+=(
280
		# Arguments from user
281
		"${MYDISTUTILS_ARGS[@]}"
282
	)
283

  
284
	export XPRA_SOCKET_DIRS="${EPREFIX}/var/run/xpra"
285
}
286

  
287
python_compile() {
288
	if use cuda; then
289
		export NVCC_PREPEND_FLAGS="-ccbin $(cuda_gccdir)/g++"
290
	fi
291

  
292
	PYTHONPATH="${S}" distutils-r1_python_compile
180 293
}
181 294

  
182 295
python_test() {
183
	export XAUTHORITY=${HOME}/.Xauthority
184
	touch "${XAUTHORITY}" || die
296
	einfo "${BUILD_DIR}/install/$(python_get_sitedir)"
297

  
298
	use cuda && cuda_add_sandbox -w
299
	addwrite /dev/dri/renderD128
300

  
301
	addpredict /dev/dri/card0
302
	addpredict /dev/fuse
303
	addpredict /dev/tty0
304
	addpredict /dev/vga_arbiter
305
	addpredict /proc/mtrr
306
	addpredict /var/run/utmp
307

  
308
	addpredict "$(python_get_sitedir)"
309

  
310
	if [[ -d "/sys/devices/virtual/video4linux" ]]; then
311
		local devices
312
		readarray -t devices <<<"$(find /sys/devices/virtual/video4linux -mindepth 1 -maxdepth 1 -type d -name 'video*' )"
313
		for device in "${devices[@]}"; do
314
			addwrite "/dev/$(basename "${device}" || die )"
315
		done
316
	fi
185 317

  
186
	distutils_install_for_testing
187 318
	xdg_environment_reset
188 319

  
189
	env -u WAYLAND_DISPLAY -u XDG_SESSION_TYPE \
190
	PYTHONPATH="${S}/tests/unittests:${BUILD_DIR}/test/lib" \
191
	XPRA_SYSTEMD_RUN=$(usex systemd) XPRA_TEST_COVERAGE=0 \
192
		"${PYTHON}" "${S}"/tests/unittests/unit/run.py || die
320
	export XAUTHORITY=${T}/.Xauthority
321
	touch "${XAUTHORITY}" || die
322

  
323
	local -x XPRA_TEST_COVERAGE=0 INSTALL_ROOT="${BUILD_DIR}/install" UNITTESTS_DIR="${S}/tests/unittests"
324

  
325
	tests/unittests/run \
326
		--skip-fail unit.client.mixins.audioclient_test \
327
		--skip-fail unit.client.x11_client_test \
328
		--skip-fail unit.net.net_util_test \
329
		--skip-fail unit.notifications.common_test \
330
		--skip-fail unit.server.mixins.shadow_option_test \
331
		--skip-fail unit.server.mixins.start_option_test \
332
		--skip-fail unit.server.mixins.startdesktop_option_test \
333
		--skip-fail unit.server.server_auth_test \
334
		--skip-fail unit.server.shadow_server_test \
335
		--skip-fail unit.x11.x11_server_test \
336
		--skip-slow unit.client.mixins.webcam_test \
337
		--skip-slow unit.server.server_sockets_test \
338
		--skip-slow unit.server.source.source_mixins_test \
339
	|| die -n
193 340
}
194 341

  
195
python_install_all() {
196
	distutils-r1_python_prepare_all
342
python_install() {
343
	# remove test file
344
	rm -vrf "${BUILD_DIR}/install/usr/share/xpra/www"
345

  
346
	distutils-r1_python_install
347
}
197 348

  
198
	# Switching to PEP517 gives /usr/etc. Previously, setup.py hardcodes
199
	# if root_prefix.endswith("/usr"):
200
	#     root_prefix = root_prefix[:-4]
201
	# But now setuptools uses data/* to represent out-of-sitedir files.
202
	# The upstream hack no longer works. We are on our own.
349
python_install_all() {
350
	distutils-r1_python_install_all
203 351

  
204 352
	mv -v "${ED}"/usr/etc "${ED}"/ || die
205 353

  
354
	sed -e "s#/.*data/etc#/etc#g" \
355
		-i "${ED}/etc/xpra/conf.d/"* || die
356

  
206 357
	# Move udev dir to the right place if necessary.
207 358
	if use udev; then
208
		local dir=$(get_udevdir)
359
		local dir
360
		dir=$(get_udevdir)
209 361
		if [[ ! ${ED}/usr/lib/udev -ef ${ED}${dir} ]]; then
210 362
			dodir "${dir%/*}"
211 363
			mv -vnT "${ED}"/usr/lib/udev "${ED}${dir}" || die
Спасибо!