Bug#836453: xserver-xorg-dev: please move xorg-server.pc to a multiarch path

2017-10-04 Thread Julien Cristau
On 10/04/2017 01:55 PM, Julien Cristau wrote:
> On 10/02/2017 09:48 PM, Helmut Grohne wrote:
>>  5. d/rules fails to define the architecture variables (e.g.
>> DEB_HOST_ARCH_OS). Unless building with dpkg-buildpackage they are
>> undefined. So I sneak "include /usr/share/dpkg/architecture.mk" into
>> the patch.
>>
> Looks like a bug in
> https://anonscm.debian.org/git/pkg-xorg/xserver/xorg-server.git/commit/?id=29d0f5ae367f0efa80d48990843f2e30019cd233
> which we should fix.  I think I'd prefer bringing back the explicit
> variable definitions to architecture.mk, but don't feel very strongly
> either way.
> 
Fixed in
https://anonscm.debian.org/git/pkg-xorg/xserver/xorg-server.git/commit/?id=1135bbf8b3eacfd26484cf15bbdd4c91a03c394c

Cheers,
Julien



Bug#836453: xserver-xorg-dev: please move xorg-server.pc to a multiarch path

2017-10-04 Thread Julien Cristau
On 10/02/2017 09:48 PM, Helmut Grohne wrote:
> On Sun, Oct 01, 2017 at 10:47:54PM +0200, Julien Cristau wrote:
>>> How do you feel about applying this patch to help with cross-compilation
>>> and (re)bootstrapping?
>>>
>> Unconvinced.  d/rules is already too messy as it is.
> 
> Indeed. The original patch makes d/rules worse. So I am attaching a new
> patch to improve the situation:
> 
>  1. Drop --libdir (to pick up the debhelper default).
> 
OK.

>  2. Add --with-module-dir to avoid moving /usr/lib/xorg. Other packages
> place their modules here, so we cannot move it without coordination.
> Given that there can be only one /usr/bin/Xorg and that these
> modules are loaded into that Xorg, I think it should default to
> ${libexecdir}/modules. I can try changing that upstream.
> 
Sounds reasonable.  Bit of an uphill battle to get all drivers updated,
so not sure this is actually worth it.  Possibly we should add comments
to document our overridden paths in configure flags, and leave it at
that, at least for now.

>  3. Add --with-serverconfig-path to avoid moving protocol.txt. It ends
> up in xserver-common, which is Arch:all and thus cannot be
> multiarchy. Again using ${libexecdir} would make more sense.
> 
Fair.

>  4. Move the installation of pkgconfig into d/rules as .install files
> cannot contain variables. (Alternatively: use dh-exec)
> 
I'd rather not switch to dh-exec if at all possible, so ok.

>  5. d/rules fails to define the architecture variables (e.g.
> DEB_HOST_ARCH_OS). Unless building with dpkg-buildpackage they are
> undefined. So I sneak "include /usr/share/dpkg/architecture.mk" into
> the patch.
> 
Looks like a bug in
https://anonscm.debian.org/git/pkg-xorg/xserver/xorg-server.git/commit/?id=29d0f5ae367f0efa80d48990843f2e30019cd233
which we should fix.  I think I'd prefer bringing back the explicit
variable definitions to architecture.mk, but don't feel very strongly
either way.

> Ignoring the last point (which is a bug imo), this is a net increase in
> 1 line. Potentially, points 2 and 3 could be upstreamed to further
> reduce messiness.
> 
> I hope this works better for you.
> 
Thanks,
Julien



Bug#836453: xserver-xorg-dev: please move xorg-server.pc to a multiarch path

2017-10-02 Thread Helmut Grohne
On Sun, Oct 01, 2017 at 10:47:54PM +0200, Julien Cristau wrote:
> > How do you feel about applying this patch to help with cross-compilation
> > and (re)bootstrapping?
> > 
> Unconvinced.  d/rules is already too messy as it is.

Indeed. The original patch makes d/rules worse. So I am attaching a new
patch to improve the situation:

 1. Drop --libdir (to pick up the debhelper default).

 2. Add --with-module-dir to avoid moving /usr/lib/xorg. Other packages
place their modules here, so we cannot move it without coordination.
Given that there can be only one /usr/bin/Xorg and that these
modules are loaded into that Xorg, I think it should default to
${libexecdir}/modules. I can try changing that upstream.

 3. Add --with-serverconfig-path to avoid moving protocol.txt. It ends
up in xserver-common, which is Arch:all and thus cannot be
multiarchy. Again using ${libexecdir} would make more sense.

 4. Move the installation of pkgconfig into d/rules as .install files
cannot contain variables. (Alternatively: use dh-exec)

 5. d/rules fails to define the architecture variables (e.g.
DEB_HOST_ARCH_OS). Unless building with dpkg-buildpackage they are
undefined. So I sneak "include /usr/share/dpkg/architecture.mk" into
the patch.

Ignoring the last point (which is a bug imo), this is a net increase in
1 line. Potentially, points 2 and 3 could be upstreamed to further
reduce messiness.

I hope this works better for you.

Helmut
diff -u xorg-server-1.19.3/debian/changelog xorg-server-1.19.3/debian/changelog
--- xorg-server-1.19.3/debian/changelog
+++ xorg-server-1.19.3/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.19.3-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Move xorg-server.pc to a multiarch location. closes: #836453
+
+ -- Helmut Grohne   Mon, 02 Oct 2017 06:50:45 +0200
+
 xorg-server (2:1.19.3-2) unstable; urgency=high
 
   * CVE-2017-10972: information leak out of the X server due to an
diff -u xorg-server-1.19.3/debian/rules xorg-server-1.19.3/debian/rules
--- xorg-server-1.19.3/debian/rules
+++ xorg-server-1.19.3/debian/rules
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+include /usr/share/dpkg/architecture.mk
+
 ifeq ($(DEB_HOST_ARCH_OS), linux)
selinux= --enable-xselinux
wayland= --enable-xwayland
@@ -77,8 +79,11 @@
 --disable-strict-compilation \
 --disable-debug \
 $(config_tests) \
+--libexecdir=\$${prefix}/lib/xorg \
 --with-int10=x86emu \
+--with-module-dir=\$${libexecdir}/modules \
 --with-os-vendor="$(VENDOR)" \
+--with-serverconfig-path=\$${libexecdir} \
 --with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) 
($(SUPPORT))" \
 --with-xkb-path=/usr/share/X11/xkb \
 --with-xkb-output=/var/lib/xkb \
@@ -180,14 +185,10 @@
 
 override_dh_auto_configure:
dh_auto_configure --builddirectory=debian/build/main -- \
-   --libdir=\$${prefix}/lib \
-   --libexecdir=\$${libdir}/xorg \
$(confflags) \
$(confflags_main) \
$(vars)
dh_auto_configure --builddirectory=debian/build/udeb -- \
-   --libdir=\$${prefix}/lib \
-   --libexecdir=\$${libdir}/xorg \
$(confflags) \
$(confflags_udeb) \
$(vars)
@@ -226,7 +227,7 @@
rm -rf debian/tmp/udeb/usr/include
rm -rf debian/tmp/udeb/usr/share/aclocal
rm -rf debian/tmp/udeb/usr/share/man
-   rm -rf debian/tmp/udeb/usr/lib/pkgconfig
+   rm -rf debian/tmp/udeb/usr/lib/*/pkgconfig
 
install -m 755 debian/local/xvfb-run debian/tmp/main/usr/bin
install debian/local/xvfb-run.1 debian/tmp/main/usr/share/man/man1
@@ -266,13 +267,14 @@
chmod ug+s $(CURDIR)/debian/xserver-xorg-legacy/usr/lib/xorg/Xorg.wrap
 
 override_dh_install:
+   dh_install -pxserver-xorg-dev 
main/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig usr/lib/$(DEB_HOST_MULTIARCH)
dh_install --fail-missing
install -d $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg
# Extract only the major ABI version:
-   abi_videodrv=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig 
pkg-config --variable=abi_videodrv xorg-server|cut -d . -f 1`; \
+   
abi_videodrv=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
 pkg-config --variable=abi_videodrv xorg-server|cut -d . -f 1`; \
echo videoabi=xorg-video-abi-$$abi_videodrv > 
debian/xserver-xorg-core.substvars && \
echo "xorg-video-abi-$$abi_videodrv, xserver-xorg-core (>= 
$(serverminver))" > debian/xserver-xorg-dev/usr/share/xserver-xorg/videodrvdep
-   abi_xinput=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig 
pkg-config --variable=abi_xinput xorg-server|cut -d . -f 1`; \
+   
abi_xinput=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
 pkg-c

Bug#836453: xserver-xorg-dev: please move xorg-server.pc to a multiarch path

2017-10-01 Thread Julien Cristau
On Fri, Sep 29, 2017 at 00:55:46 +0200, Manuel A. Fernandez Montecelo wrote:

> (Copying explicitly pochu since he's the most active uploader in the
> last year)
> 
> Hi,
> 
> 2016-09-03 13:10 Helmut Grohne:
> > [...]
> > Hi,
> > 
> > xserver-xorg-dev makes the aforementioned affected packages fail to
> > cross build from source, because pkg-config does not consider[1]
> > /usr/lib/pkgconfig/ during cross compilation. In contrast, it always
> > considers /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig, so moving
> > xorg-server.pc there will make both native and cross builds happy.
> > 
> > The requested change is implemented in the attached patch for your
> > convenience.
> 
> How do you feel about applying this patch to help with cross-compilation
> and (re)bootstrapping?
> 
Unconvinced.  d/rules is already too messy as it is.

> If it helps, I can prepare a NMU for it.
> 
I don't think that would be appropriate.

Cheers,
Julien



Bug#836453: xserver-xorg-dev: please move xorg-server.pc to a multiarch path

2017-09-28 Thread Manuel A. Fernandez Montecelo

(Copying explicitly pochu since he's the most active uploader in the
last year)

Hi,

2016-09-03 13:10 Helmut Grohne:

[...]
Hi,

xserver-xorg-dev makes the aforementioned affected packages fail to
cross build from source, because pkg-config does not consider[1]
/usr/lib/pkgconfig/ during cross compilation. In contrast, it always
considers /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig, so moving
xorg-server.pc there will make both native and cross builds happy.

The requested change is implemented in the attached patch for your
convenience.


How do you feel about applying this patch to help with cross-compilation
and (re)bootstrapping?

If it helps, I can prepare a NMU for it.


Cheers.
--
Manuel A. Fernandez Montecelo 



Bug#836453: xserver-xorg-dev: please move xorg-server.pc to a multiarch path

2016-09-03 Thread Helmut Grohne
Package: xserver-xorg-dev
Version: 2:1.18.4-1
Tags: patch
User: helm...@debian.org
Usertags: rebootstrap
Control: affects -1 + src:xf86-input-wacom src:xserver-xorg-input-evdev 
src:xserver-xorg-input-libinput src:xserver-xorg-input-mouse 
src:xserver-xorg-input-synaptics src:xserver-xorg-video-amdgpu 
src:xserver-xorg-video-ati src:xserver-xorg-video-cirrus 
src:xserver-xorg-video-fbdev src:xserver-xorg-video-mach64 
src:xserver-xorg-video-mga src:xserver-xorg-video-neomagic 
src:xserver-xorg-video-nouveau src:xserver-xorg-video-r128 
src:xserver-xorg-video-savage src:xserver-xorg-video-siliconmotion 
src:xserver-xorg-video-sisusb src:xserver-xorg-video-tdfx 
src:xserver-xorg-video-trident

Hi,

xserver-xorg-dev makes the aforementioned affected packages fail to
cross build from source, because pkg-config does not consider[1]
/usr/lib/pkgconfig/ during cross compilation. In contrast, it always
considers /usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig, so moving
xorg-server.pc there will make both native and cross builds happy.

The requested change is implemented in the attached patch for your
convenience.

Helmut

[1] This choice was discusses with pkg-config maintainer Tollef Fog Heen
and the conclusion was that packages should move their .pc files.
diff -u xorg-server-1.18.4/debian/changelog xorg-server-1.18.4/debian/changelog
--- xorg-server-1.18.4/debian/changelog
+++ xorg-server-1.18.4/debian/changelog
@@ -1,3 +1,10 @@
+xorg-server (2:1.18.4-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Install xserver-xorg.pc into a multiarch path. (Closes: #-1)
+
+ -- Helmut Grohne   Sat, 03 Sep 2016 09:02:57 +0200
+
 xorg-server (2:1.18.4-1) unstable; urgency=medium
 
   * New upstream stable release.
diff -u xorg-server-1.18.4/debian/rules xorg-server-1.18.4/debian/rules
--- xorg-server-1.18.4/debian/rules
+++ xorg-server-1.18.4/debian/rules
@@ -21,10 +21,7 @@
MAKEFLAGS += -j$(NUMJOBS)
 endif
 
-DEB_HOST_ARCH  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
-DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_ARCH_OS   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+include /usr/share/dpkg/architecture.mk
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build=$(DEB_HOST_GNU_TYPE)
 else
@@ -396,6 +393,8 @@
install -m 644 debian/local/64-xorg-xkb.rules 
debian/xserver-xorg-core-udeb/lib/udev/rules.d
 endif
 endif
+   $(INSTALL) -m 755 -d 
debian/xserver-xorg-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
+   $(INSTALL) -m 644 debian/tmp/main/usr/lib/pkgconfig/xorg-server.pc 
debian/xserver-xorg-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/
dh_installdebconf -s
dh_installman -s
dh_link -s
diff -u xorg-server-1.18.4/debian/xserver-xorg-dev.install 
xorg-server-1.18.4/debian/xserver-xorg-dev.install
--- xorg-server-1.18.4/debian/xserver-xorg-dev.install
+++ xorg-server-1.18.4/debian/xserver-xorg-dev.install
@@ -1,5 +1,4 @@
 main/usr/include/xorg  usr/include
-main/usr/lib/pkgconfig/xorg-server.pc  usr/lib/pkgconfig
 main/usr/share/aclocal usr/share
 
 ../../debian/local/dh_xsf_substvars usr/bin