xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 7 years ago

Closed 7 years ago

Last modified 6 weeks ago

#649 closed enhancement (fixed)

new Xorg-related build option(s)

Reported by: onlyjob Owned by: onlyjob
Priority: major Milestone:
Component: packaging Version: 0.14.x
Keywords: Cc:


As of 0.14.* building Xpra in clean chroot environment became much harder due to build-time Xorg detection: build script (setup.py) tries to determine Xorg path and version and suid status in order to generate "xpra.conf". Unfortunately this requires "xserver-xorg-core" package to be present on build-time.
On Debian I do not want to introduce this dependency which seems to be more like run-time than build time dep. As workaround I had to use patch brutally hardcoding Xorg information to "setup.py" but IMHO it would be much more elegant to pass build options instead.
Please note that passing only "--with-Xdummy" is insufficient as there is no way to override Xorg detection using build options.
Please consider adding setup.py build options to allow building without Xorg. Thanks.

Change History (9)

comment:1 Changed 7 years ago by Antoine Martin

Owner: changed from Antoine Martin to onlyjob

Correct. It's there because I don't really have the time to go through every distro and figure out what options the packages should be built with for every one of them.. (not helped by the fact that the Debian "rules" file is shared between all of them - and that how to override any setup.py arguments is not immediately obvious to me)

r7377 should do what you want though, can you confirm? And help with the rules file?

comment:2 Changed 7 years ago by onlyjob

Replying to totaam:

r7377 should do what you want though, can you confirm?

It does indeed. Thank you.

And help with the rules file?

No problem. "rules" is Makefile so it's not too hard to customise.
Usually it is enough to add override_dh_auto_configure section as follows:

	dh_auto_configure -- --with-option1 --with-option2

dh_auto_configure passes build options to detected build system.
Xpra is not using configure flow so I pass build options to "build" and "install" target as follows:

BUILDOPTS= --with-verbose --with-Xdummy --without-Xdummy_wrapper

	dh_auto_build -- $(BUILDOPTS)

	dh_auto_install --destdir=$(CURDIR)/debian/xpra -- $(BUILDOPTS)

dh_auto_build will run setup.py as follows:

setup.py build --force --with-verbose --with-Xdummy --without-Xdummy_wrapper

You can add BUILDOPTS depending on conditions like this:

ifeq ($(DEB_BUILD_ARCH_OS),hurd)
BUILDOPTS+= --disable-alsa

See dpkg-architecture(1) for list of variables.

The following sample set variable DH_AS_NEEDED to "--as-needed" if dh-autoreconf version 6 or higher is installed:

# use --as-needed only if supported by dh-autoreconf (to simplify backporting)
DH_AS_NEEDED=$(shell dpkg --compare-versions $$(dpkg --status dh-autoreconf | grep Version | cut -d' ' -f2) ge 6 && echo --as-needed)
	dh_autoreconf $(DH_AS_NEEDED)

Let me know if you need more ideas.
Also debian-mentors mail list is full of helpful hints and people ready to share their experience.

comment:3 Changed 7 years ago by Antoine Martin

Backport to v0.14.x in r7392.

One last question: any idea how I could do this:

if release is squeeze or distro is ubuntu:
BUILDOPTS+= --without-Xdummy

One more: should I be using --destdir=$(CURDIR)/debian/xpra or --destdir=$(CURDIR)/debian/tmp? (and where would I find out all these things by myself: the override stuff was easy to understand, but googling for hours gave me zero hits)

Last edited 7 years ago by Antoine Martin (previous) (diff)

comment:4 Changed 7 years ago by onlyjob

I would add lsb-release to Build-Depends and then do the following (untested):

ifeq ($(shell lsb_release --short --codename),squeeze)
BUILDOPTS+= --without-Xdummy

ifeq ($(shell lsb_release --short --id),Ubuntu)
BUILDOPTS+= --without-Xdummy

## show build options:

Information about overrides should be somewhere in general packaging docs:

--destdir=$(CURDIR)/debian/xpra instruct installer to put everything directly to directory where package "xpra" is staged. This may be convenient when only one binary package (i.e. .DEB) is built.

--destdir=$(CURDIR)/debian/tmp is to instruct installer to put everything to temporary directory. There shall be "debian/package.install" files to pick-up stuff from "debian/tmp" to destination packages. This is convenient when one source package produces more than one binary package.

dh_auto_install(1) says:

Unless --destdir option is specified, the files are installed into
debian/package/ if there is only one binary package. In the multiple
binary package case, the files are instead installed into debian/tmp/,
and should be moved from there to the appropriate package build
directory using dh_install(1).

I sometimes pass optional "--destdir" explicitly to avoid relying on defaults.

comment:5 Changed 7 years ago by onlyjob

Some override examples in dh(1).

comment:6 Changed 7 years ago by onlyjob

I just found that backport in 0.14.2 is incomplete -- it is missing the following hunk:

--- a/setup.py
+++ b/setup.py
@@ -190,9 +190,10 @@
             "server", "client", "x11", "gtk_x11",
             "gtk2", "gtk3", "qt4", "html5",
             "sound", "cyxor", "cymaths", "opengl", "argb",
-            "warn", "strict", "shadow", "debug", "PIC", "Xdummy", "verbose", "bundle_tests")
+            "warn", "strict", "shadow", "debug", "PIC",
+            "Xdummy", "Xdummy_wrapper", "verbose", "bundle_tests")
 HELP = "-h" in sys.argv or "--help" in sys.argv
 if HELP:
     print("Xpra specific build and install switches:")

comment:7 Changed 7 years ago by Antoine Martin

Did I somehow miss the rejects? Damn.
Done in r7411, sorry.

comment:8 Changed 7 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

Closing - feel free to re-open if I've missed anything.

comment:9 Changed 6 weeks ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/649

Note: See TracTickets for help on using tickets.