Package: libopusfile0
Version: 0.9+20170913-1
Severity: normal
Tags: patch
Control: block -1 by 899138
Control: block 923031 by -1

libopusfile0 and libopusfile-dev are not Multi-Arch co-installable,
which makes it awkward to use them for cross-compilation, or depend on
libopusfile0 in i386 software that is to be installed on amd64 machines
(for example, it would be problematic if Wine wanted to use opusfile).

The attached patches are a minimal change to address this, building on
what Helmut Grohne provided in #899138. Please consider applying them.

The same changes are in active use in the Steam Runtime[1], a library
runtime environment for Steam games, for which multiarch co-installability
is particularly important because many older games are i386-only. The
version of opusfile in the Steam Runtime has also been updated to 0.11,
which did not require any particular packaging changes.

Thanks,
    smcv

[1] http://repo.steamstatic.com/steamrt/pool/main/o/opusfile/
>From 204f60efa9e6b16ecef2f892b6aba23d1bdf858d Mon Sep 17 00:00:00 2001
From: Helmut Grohne <hel...@subdivi.de>
Date: Sat, 19 May 2018 20:16:21 +0200
Subject: [PATCH 1/2] Install library and pkg-config metadata to multiarch
 locations

Closes: #899138
---
 debian/libopusfile-dev.install | 6 +++---
 debian/libopusfile0.install    | 2 +-
 debian/rules                   | 5 ++---
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/debian/libopusfile-dev.install b/debian/libopusfile-dev.install
index bbc9008..abebe49 100644
--- a/debian/libopusfile-dev.install
+++ b/debian/libopusfile-dev.install
@@ -1,4 +1,4 @@
 usr/include/*
-usr/lib/lib*.a
-usr/lib/lib*.so
-usr/lib/pkgconfig/*.pc
+usr/lib/*/lib*.a
+usr/lib/*/lib*.so
+usr/lib/*/pkgconfig/*.pc
diff --git a/debian/libopusfile0.install b/debian/libopusfile0.install
index d0dbfd1..3ddde58 100644
--- a/debian/libopusfile0.install
+++ b/debian/libopusfile0.install
@@ -1 +1 @@
-usr/lib/lib*.so.*
+usr/lib/*/lib*.so.*
diff --git a/debian/rules b/debian/rules
index 515ea57..fa29142 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,9 +11,7 @@ PARALLEL = $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 NJOBS    = -j$(or $(PARALLEL),$(NUM_CPUS),1)
 
 
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+include /usr/share/dpkg/architecture.mk
 
 
 # -fstack-protector-all is added by the default autoconf tests.
@@ -70,6 +68,7 @@ $(objdir)/config.status: configure
 				     --host=$(DEB_HOST_GNU_TYPE)	\
 				     --build=$(DEB_BUILD_GNU_TYPE)	\
 				     --prefix=/usr			\
+				     --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)' \
 				     $(EXTRA_CONFIG_FLAGS)		\
 				     CPPFLAGS="$(CPPFLAGS)"		\
 				     CFLAGS="$(CFLAGS)"			\
-- 
2.23.0

>From 1b8253749254ef4cea8eec658c121cc4dc8c0d89 Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Wed, 19 Dec 2018 19:42:35 +0000
Subject: [PATCH 2/2] Mark libopusfile0, libopusfile-dev as Multi-Arch: same

This builds on Helmut Grohne's work in #899138 to allow (for example)
libopusfile-dev:amd64 and libopusfile-dev:s390x to be co-installed,
making it possible to do cross-builds without either using a chroot
or removing the host architecture's libopusfile.

Signed-off-by: Simon McVittie <s...@debian.org>
---
 debian/control | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian/control b/debian/control
index f4e30af..6045af8 100644
--- a/debian/control
+++ b/debian/control
@@ -13,6 +13,7 @@ Vcs-Browser: https://salsa.debian.org/ron/opusfile
 Package: libopusfile0
 Section: libs
 Architecture: any
+Multi-Arch: same
 Depends: ${shlibs:Depends}
 Description: High-level API for basic manipulation of Ogg Opus audio streams
  libopusfile provides several sets of built-in routines for file and stream
@@ -29,6 +30,7 @@ Description: High-level API for basic manipulation of Ogg Opus audio streams
 Package: libopusfile-dev
 Section: libdevel
 Architecture: any
+Multi-Arch: same
 Depends: libopusfile0 (= ${binary:Version}), libopus-dev (>= 1.0.1), libogg-dev (>= 1.3.0)
 Recommends: libssl-dev
 Description: High-level API for basic manipulation of Ogg Opus audio streams
-- 
2.23.0

Reply via email to