[Pkg-utopia-maintainers] Bug#1021370: pipewire: build with bluez5-codec-aac=enabled

Max Nikulin manikulin at gmail.com
Fri Jan 12 16:08:15 GMT 2024


On Fri, 07 Oct 2022 00:11:56 +0200 KeyofBlueS wrote:
> 
> please build pipewire with aac codec support enabled.

An alternative may be building a separate package for the contrib 
repository section that contains just the aac codec plugin.

I have no experience with meson, so I have no idea if it is possible to 
force it to ignore everything besides the specific plugin. As a proof of 
concept I have tried the following Makefile. Perhaps more flags should 
be added.

# - atomic_dep?
top_srcdir ?= .
top_builddir ?= $(top_srcdir)
builddir ?= $(top_srcdir)

spaversion = $(shell sed -n -e "s/^spaversion *= *'\(.*\)'$$/\1/p" 
$(top_srcdir)/meson.build)
pkgname = libspa-$(spaversion)
plugindir = $(shell pkg-config --variable=plugindir $(pkgname))
installdir = $(plugindir)/bluez5
# toplevel default_options
plugin_CFLAGS += --std=gnu11 -fPIE
# toplevel cc_flags
plugin_CFLAGS += -D_GNU_SOURCE -DFASTPATH
# toplevel common_flags
plugin_CFLAGS += -fvisibility=hidden -fno-strict-aliasing
# AVX and SSE flags perhaps may be ignored since
# computations should be done inside the linked library
# bluez5 codec_args
plugin_CFLAGS += -DCODEC_PLUGIN
# spa pkgconfig
plugin_CFLAGS += $(shell pkg-config --cflags $(pkgname))
# required for shared library
plugin_CFLAGS += -fPIC
plugin_CFLAGS += $(shell pkg-config --cflags fdk-aac)
ALL_CFLAGS = $(plugin_CFLAGS) $(CFLAGS)
ALL_LDLIBS = $(LDLIBS) $(shell pkg-config --libs fdk-aac)

bluez5_dir = $(top_srcdir)/spa/plugins/bluez5
aac_codec = $(builddir)/libspa-codec-bluez5-aac.so
plugin_LIBRARIES += $(aac_codec)
plugin_OBJECTS += $(builddir)/a2dp-codec-aac.o $(builddir)/media-codecs.o

all: $(plugin_LIBRARIES)
clean:
	$(RM) $(plugin_LIBRARIES) $(plugin_OBJECTS)

# Not $(LD) due to $(LDFLAGS)
# ld: unrecognized option '-Wl,-z,relro'
$(aac_codec): $(plugin_OBJECTS)
	$(CC) -o $@ -shared $(LDFLAGS) $^ $(ALL_LDLIBS)

$(builddir)/%.o: $(bluez5_dir)/%.c
	$(CC) -o $@ $(CPPFLAGS) $(ALL_CFLAGS) -c $<

install: $(plugin_LIBRARIES)
	install -D --target-directory $(DESTDIR)$(installdir) $(plugin_LIBRARIES)

.PHONY: all clean install

--- 8< --- debian/rules --- 8< ---
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs

%:
	dh $@

# Custom Makefile instead of configure script
override_dh_auto_configure:
override_dh_makeshlibs:



More information about the Pkg-utopia-maintainers mailing list