Source: mplayer Version: 2:1.5+svn38408-1 Tags: patch User: [email protected] Usertags: ftcbfs
mplayer fails to cross build from source for quite a number of reasons. It has a quite unique configure script that doesn't work with standard cross compilation flags. I figured that you need --target, --enable-cross-compile, --cc, and --host-cc (with a meaning that differs from dpkg's meaning of "host"). Beyond that, it hard codes the build architecture pkg-config in really a lot of places. Instead of adding a gigantic patch for this, I opt for adding a wrapper script. It also requires libavutil-dev for the build architecture. I'm attaching a patch for your convenience. Note that you must chmod +x debian/devbin/pkg-config after applying it for it to work. Helmut
diff --minimal -Nru mplayer-1.5+svn38408/debian/changelog mplayer-1.5+svn38408/debian/changelog --- mplayer-1.5+svn38408/debian/changelog 2023-01-26 20:14:25.000000000 +0100 +++ mplayer-1.5+svn38408/debian/changelog 2023-02-28 21:19:56.000000000 +0100 @@ -1,3 +1,13 @@ +mplayer (2:1.5+svn38408-1.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Fix FTCBFS: (Closes: #-1) + + Pass cross compilation flags to configure. + + Inject a pkg-config for host into $PATH. + + Missing Build-Depends: libavutil-dev:native. + + -- Helmut Grohne <[email protected]> Tue, 28 Feb 2023 21:19:56 +0100 + mplayer (2:1.5+svn38408-1) unstable; urgency=medium [ Debian Janitor ] diff --minimal -Nru mplayer-1.5+svn38408/debian/control mplayer-1.5+svn38408/debian/control --- mplayer-1.5+svn38408/debian/control 2023-01-26 20:14:25.000000000 +0100 +++ mplayer-1.5+svn38408/debian/control 2023-02-28 21:19:56.000000000 +0100 @@ -22,6 +22,7 @@ libavcodec-dev, libavformat-dev, libavutil-dev, + libavutil-dev:native, libbluray-dev, libbs2b-dev, libcaca-dev, diff --minimal -Nru mplayer-1.5+svn38408/debian/devbin/pkg-config mplayer-1.5+svn38408/debian/devbin/pkg-config --- mplayer-1.5+svn38408/debian/devbin/pkg-config 1970-01-01 01:00:00.000000000 +0100 +++ mplayer-1.5+svn38408/debian/devbin/pkg-config 2023-02-28 21:19:56.000000000 +0100 @@ -0,0 +1,2 @@ +#!/bin/sh +exec "${DEB_HOST_GNU_TYPE}-pkg-config" "$@" diff --minimal -Nru mplayer-1.5+svn38408/debian/rules mplayer-1.5+svn38408/debian/rules --- mplayer-1.5+svn38408/debian/rules 2023-01-26 20:14:25.000000000 +0100 +++ mplayer-1.5+svn38408/debian/rules 2023-02-28 21:19:56.000000000 +0100 @@ -8,6 +8,7 @@ .NOTPARALLEL: include /usr/share/dpkg/architecture.mk +include /usr/share/dpkg/buildtools.mk CFLAGS +=$(CPPFLAGS) @@ -74,6 +75,17 @@ sound_backend := alsa,oss endif +ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH)) +ifeq ($(archconf),) + archconf += --target=$(DEB_HOST_GNU_CPU)-$(DEB_HOST_ARCH_OS) +endif + archconf += \ + --enable-cross-compile \ + --cc=$(CC) \ + --host-cc=$(CC_FOR_BUILD) + export PATH:=$(CURDIR)/debian/devbin:$(PATH) +endif + %: dh $@

