From 3099e85317983a103d69a5bdf5351cbdb695710b Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 9 Jan 2026 12:28:30 +0100 Subject: [PATCH 1/5] alsa-lib: add plugin build support and add new versions --- .../builtin/packages/alsa_lib/package.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/repos/spack_repo/builtin/packages/alsa_lib/package.py b/repos/spack_repo/builtin/packages/alsa_lib/package.py index ed81b579a1e..664b4af7b60 100644 --- a/repos/spack_repo/builtin/packages/alsa_lib/package.py +++ b/repos/spack_repo/builtin/packages/alsa_lib/package.py @@ -13,19 +13,27 @@ class AlsaLib(AutotoolsPackage): space library that developers compile ALSA applications against.""" homepage = "https://www.alsa-project.org" - url = "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.3.2.tar.bz2" + url = "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.15.2.tar.bz2" + git = "https://github.com/alsa-project/alsa-lib.git" license("LGPL-2.1-or-later") + version("1.2.15.2", tag="v1.2.15.2", commit="63a981865a1c7d9501ae556e28ae3bb53d015b61") + version("1.2.9", sha256="dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2") + version("1.2.8", sha256="1ab01b74e33425ca99c2e36c0844fd6888273193bd898240fe8f93accbcbf347") version("1.2.3.2", sha256="e81fc5b7afcaee8c9fd7f64a1e3043e88d62e9ad2c4cff55f578df6b0a9abe15") - version("1.2.2", sha256="d8e853d8805574777bbe40937812ad1419c9ea7210e176f0def3e6ed255ab3ec") + version("1.2.2", sha256="d8e853d8805574777bbe40937812ad1419c9ea7210e176f0def3e6ed255ab3ec") version("1.1.4.1", sha256="91bb870c14d1c7c269213285eeed874fa3d28112077db061a3af8010d0885b76") variant("python", default=False, description="enable python") + variant("plugins", default=False, description="enable plugins") patch("python.patch", when="@1.1.4:1.1.5 +python") depends_on("c", type="build") # generated + depends_on("autoconf", type="build", when="@1.2.15.2 build_system=autotools") + depends_on("automake", type="build", when="@1.2.15.2 build_system=autotools") + depends_on("libtool", type="build", when="@1.2.15.2 build_system=autotools") depends_on("python", type=("link", "run"), when="+python") @@ -33,7 +41,9 @@ class AlsaLib(AutotoolsPackage): def configure_args(self): spec = self.spec - args = [] + args = []A + if spec.satisfies("+plugins"): + args.append("--with-pcm-plugins=all --with-ctl-plugins=all --enable-pcm") if spec.satisfies("+python"): args.append(f"--with-pythonlibs={spec['python'].libs.ld_flags}") args.append(f"--with-pythonincludes={spec['python'].headers.include_flags}") From 9e3292c72ae260b4104518bc29ff166fc7849d49 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 9 Jan 2026 12:29:43 +0100 Subject: [PATCH 2/5] pulseaudio: add new version and support new meson build system --- .../builtin/packages/pulseaudio/package.py | 53 +++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/repos/spack_repo/builtin/packages/pulseaudio/package.py b/repos/spack_repo/builtin/packages/pulseaudio/package.py index 4ad39159199..c59523def21 100644 --- a/repos/spack_repo/builtin/packages/pulseaudio/package.py +++ b/repos/spack_repo/builtin/packages/pulseaudio/package.py @@ -2,12 +2,14 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack_repo.builtin.build_systems import autotools, meson from spack_repo.builtin.build_systems.autotools import AutotoolsPackage +from spack_repo.builtin.build_systems.meson import MesonPackage from spack.package import * +import os - -class Pulseaudio(AutotoolsPackage): +class Pulseaudio(AutotoolsPackage, MesonPackage): """PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy for your sound applications. @@ -19,10 +21,17 @@ class Pulseaudio(AutotoolsPackage): achieved using a sound server.""" homepage = "https://www.freedesktop.org/wiki/Software/PulseAudio/" - url = "https://freedesktop.org/software/pulseaudio/releases/pulseaudio-13.0.tar.xz" + url = "https://freedesktop.org/software/pulseaudio/releases/pulseaudio-17.0.tar.xz" license("LGPL-2.1-or-later") + build_system( + conditional("autotools", when="@:16"), + conditional("meson", when="@17:"), + default="meson", + ) + + version("17.0", sha256="053794d6671a3e397d849e478a80b82a63cb9d8ca296bd35b73317bb5ceb87b5") version("13.0", sha256="961b23ca1acfd28f2bc87414c27bb40e12436efcf2158d29721b1e89f3f28057") variant("alsa", default=False, description="alsa support") @@ -32,6 +41,13 @@ class Pulseaudio(AutotoolsPackage): depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated + with when("build_system=autotools"): + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + with when("build_system=meson"): + depends_on("meson", type="build") + depends_on("gettext", type="build") depends_on("alsa-lib@1.0.19:", when="+alsa") depends_on("dbus@1.4.12:") @@ -58,6 +74,9 @@ class Pulseaudio(AutotoolsPackage): depends_on("speexdsp@1.2:") depends_on("m4", type="build") +# if spec.satisfies("%gcc@8:"): + os.environ["LDFLAGS"] = "-Wl,--copy-dt-needed-entries" + def configure_args(self): args = [ "--disable-systemd-daemon", @@ -71,8 +90,8 @@ def configure_args(self): "--with-systemduserunitdir=no", "CPPFLAGS={0}".format(self.spec["libtool"].headers.cpp_flags), "LDFLAGS={0}".format(self.spec["libtool"].libs.search_flags), + "--libdir={0}".format(self.prefix.lib64), ] - # toggle based on variants args += self.enable_or_disable("alsa") args += self.enable_or_disable("openssl") @@ -97,3 +116,29 @@ def configure_args(self): ) return args + +class MesonBuilder(meson.MesonBuilder): + + def meson_args(self): + return [ + "-Ddatabase=gdbm", + "-Ddoxygen=false", + "-Dbluez5=disabled", + "-Dx11=disabled", + "-Dtests=false", + "-Ddefault_library=shared", + "-Dprefix={0}".format(self.prefix), + "-Dlibdir={0}/lib64".format(self.prefix), + "-Dbashcompletiondir={0}/share/bash-completion/completions".format(self.prefix), + "-Dsystemduserunitdir={0}/lib/systemd/user".format(self.prefix) +] + + def setup_build_environment(self, env): + env.append_flags("CPPFLAGS", "-I{0}".format(self.spec["libiconv"].prefix.include)) + env.append_flags("LDFLAGS", "-L{0} -liconv".format(self.spec["libiconv"].prefix.lib)) + + def setup_run_environment(self, env): + env.prepend_path('ALSA_PLUGIN_DIR', self.prefix.lib.alsa-lib) + env.prepend_path('LD_LIBRARY_PATH', self.spec['pulseaudio'].prefix.lib64) + + From e122791adb5f516f59c1b492c300e9206863b89d Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 9 Jan 2026 12:30:25 +0100 Subject: [PATCH 3/5] alsa-plugins: new package for alsa plugins using pulseaudio/alsa-lib --- .../builtin/packages/alsa_plugins/package.py | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 repos/spack_repo/builtin/packages/alsa_plugins/package.py diff --git a/repos/spack_repo/builtin/packages/alsa_plugins/package.py b/repos/spack_repo/builtin/packages/alsa_plugins/package.py new file mode 100644 index 00000000000..f148639cac0 --- /dev/null +++ b/repos/spack_repo/builtin/packages/alsa_plugins/package.py @@ -0,0 +1,79 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install alsa-plugins +# +# You can edit this file again by typing: +# +# spack edit alsa-plugins +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.autotools import AutotoolsPackage + +from spack.package import * +import os + +class AlsaPlugins(AutotoolsPackage): + """The ALSA Plugins package contains plugins for various audio libraries and sound servers.""" + + # FIXME: Add a proper url for your package's homepage here. + homepage = "https://github.com/alsa-project/alsa-plugins" + url = "https://github.com/alsa-project/alsa-plugins" + git = "https://github.com/alsa-project/alsa-plugins" + + # FIXME: Add a list of GitHub accounts to + # notify when the package is updated. + # maintainers("github_user1", "github_user2") + + # FIXME: Add the SPDX identifier of the project's license below. + # See https://spdx.org/licenses/ for a list. Upon manually verifying + # the license, set checked_by to your Github username. + license("UNKNOWN", checked_by="github_user1") + + version("1.2.12", tag="v1.2.12", commit="52574cb5ccbb8b546df2759e4b341a20332269b6") + + depends_on("c", type="build") + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("libtool", type="build") + + depends_on("alsa-lib") + depends_on("pulseaudio +alsa", when="+pulseaudio") + + variant('pulseaudio', default=True, description="Enable pulseaudio support") + + conflicts("platform=darwin", msg="ALSA (+plugins) only works for Linux") + + def configure_args(self): + args = [] + if '+pulseaudio' in self.spec: + args.append("--enable-pulseaudio") + return args + + def setup_build_environment(self, env): + alsa_prefix = self.spec["alsa-lib"].prefix + env.prepend_path("PKG_CONFIG_PATH", self.spec["alsa-lib"].prefix.lib64.pkgconfig) + + def setup_run_environment(self, env): + # 1. ALSA plugin directory + alsa_plugin_dir = os.path.join(self.prefix.lib, "alsa-lib") + if os.path.exists(alsa_plugin_dir): + env.prepend_path("ALSA_PLUGIN_DIR", alsa_plugin_dir) + + # 2. PulseAudio libraries (needed for dlopen dependencies) + if "pulseaudio" in self.spec: + pulseaudio_libdir = os.path.join(self.spec["pulseaudio"].prefix.lib64, "pulseaudio") + if os.path.exists(pulseaudio_libdir): + env.prepend_path("LD_LIBRARY_PATH", pulseaudio_libdir) + From 9d09740bf2221a6d9c53527e7394faa759ee2486 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 9 Jan 2026 18:21:34 +0100 Subject: [PATCH 4/5] alsa/pulseaudio: Fix formatting/style errrors from CI fix boilerplate violations, license, maintainer, etc --- .../builtin/packages/alsa_lib/package.py | 10 ++--- .../builtin/packages/alsa_plugins/package.py | 40 +++++-------------- .../builtin/packages/pulseaudio/package.py | 23 +++++------ 3 files changed, 24 insertions(+), 49 deletions(-) diff --git a/repos/spack_repo/builtin/packages/alsa_lib/package.py b/repos/spack_repo/builtin/packages/alsa_lib/package.py index 664b4af7b60..5b2e2fbcaed 100644 --- a/repos/spack_repo/builtin/packages/alsa_lib/package.py +++ b/repos/spack_repo/builtin/packages/alsa_lib/package.py @@ -19,10 +19,10 @@ class AlsaLib(AutotoolsPackage): license("LGPL-2.1-or-later") version("1.2.15.2", tag="v1.2.15.2", commit="63a981865a1c7d9501ae556e28ae3bb53d015b61") - version("1.2.9", sha256="dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2") - version("1.2.8", sha256="1ab01b74e33425ca99c2e36c0844fd6888273193bd898240fe8f93accbcbf347") + version("1.2.9", sha256="dc9c643fdc4ccfd0572cc685858dd41e08afb583f30460b317e4188275f615b2") + version("1.2.8", sha256="1ab01b74e33425ca99c2e36c0844fd6888273193bd898240fe8f93accbcbf347") version("1.2.3.2", sha256="e81fc5b7afcaee8c9fd7f64a1e3043e88d62e9ad2c4cff55f578df6b0a9abe15") - version("1.2.2", sha256="d8e853d8805574777bbe40937812ad1419c9ea7210e176f0def3e6ed255ab3ec") + version("1.2.2", sha256="d8e853d8805574777bbe40937812ad1419c9ea7210e176f0def3e6ed255ab3ec") version("1.1.4.1", sha256="91bb870c14d1c7c269213285eeed874fa3d28112077db061a3af8010d0885b76") variant("python", default=False, description="enable python") @@ -33,7 +33,7 @@ class AlsaLib(AutotoolsPackage): depends_on("c", type="build") # generated depends_on("autoconf", type="build", when="@1.2.15.2 build_system=autotools") depends_on("automake", type="build", when="@1.2.15.2 build_system=autotools") - depends_on("libtool", type="build", when="@1.2.15.2 build_system=autotools") + depends_on("libtool", type="build", when="@1.2.15.2 build_system=autotools") depends_on("python", type=("link", "run"), when="+python") @@ -41,7 +41,7 @@ class AlsaLib(AutotoolsPackage): def configure_args(self): spec = self.spec - args = []A + args = [] if spec.satisfies("+plugins"): args.append("--with-pcm-plugins=all --with-ctl-plugins=all --enable-pcm") if spec.satisfies("+python"): diff --git a/repos/spack_repo/builtin/packages/alsa_plugins/package.py b/repos/spack_repo/builtin/packages/alsa_plugins/package.py index f148639cac0..11f292a107d 100644 --- a/repos/spack_repo/builtin/packages/alsa_plugins/package.py +++ b/repos/spack_repo/builtin/packages/alsa_plugins/package.py @@ -2,67 +2,46 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install alsa-plugins -# -# You can edit this file again by typing: -# -# spack edit alsa-plugins -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +import os from spack_repo.builtin.build_systems.autotools import AutotoolsPackage from spack.package import * -import os + class AlsaPlugins(AutotoolsPackage): """The ALSA Plugins package contains plugins for various audio libraries and sound servers.""" - # FIXME: Add a proper url for your package's homepage here. homepage = "https://github.com/alsa-project/alsa-plugins" url = "https://github.com/alsa-project/alsa-plugins" git = "https://github.com/alsa-project/alsa-plugins" - # FIXME: Add a list of GitHub accounts to # notify when the package is updated. - # maintainers("github_user1", "github_user2") + maintainers("biddisco") - # FIXME: Add the SPDX identifier of the project's license below. - # See https://spdx.org/licenses/ for a list. Upon manually verifying - # the license, set checked_by to your Github username. - license("UNKNOWN", checked_by="github_user1") + license("LGPL-2.1-or-later", checked_by="biddisco") version("1.2.12", tag="v1.2.12", commit="52574cb5ccbb8b546df2759e4b341a20332269b6") - depends_on("c", type="build") + depends_on("c", type="build") depends_on("autoconf", type="build") depends_on("automake", type="build") - depends_on("libtool", type="build") + depends_on("libtool", type="build") depends_on("alsa-lib") depends_on("pulseaudio +alsa", when="+pulseaudio") - variant('pulseaudio', default=True, description="Enable pulseaudio support") + variant("pulseaudio", default=True, description="Enable pulseaudio support") conflicts("platform=darwin", msg="ALSA (+plugins) only works for Linux") - + def configure_args(self): args = [] - if '+pulseaudio' in self.spec: + if "+pulseaudio" in self.spec: args.append("--enable-pulseaudio") return args def setup_build_environment(self, env): - alsa_prefix = self.spec["alsa-lib"].prefix env.prepend_path("PKG_CONFIG_PATH", self.spec["alsa-lib"].prefix.lib64.pkgconfig) def setup_run_environment(self, env): @@ -76,4 +55,3 @@ def setup_run_environment(self, env): pulseaudio_libdir = os.path.join(self.spec["pulseaudio"].prefix.lib64, "pulseaudio") if os.path.exists(pulseaudio_libdir): env.prepend_path("LD_LIBRARY_PATH", pulseaudio_libdir) - diff --git a/repos/spack_repo/builtin/packages/pulseaudio/package.py b/repos/spack_repo/builtin/packages/pulseaudio/package.py index c59523def21..bfa39b8e999 100644 --- a/repos/spack_repo/builtin/packages/pulseaudio/package.py +++ b/repos/spack_repo/builtin/packages/pulseaudio/package.py @@ -2,12 +2,13 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack_repo.builtin.build_systems import autotools, meson +import os + from spack_repo.builtin.build_systems.autotools import AutotoolsPackage from spack_repo.builtin.build_systems.meson import MesonPackage from spack.package import * -import os + class Pulseaudio(AutotoolsPackage, MesonPackage): """PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy @@ -26,9 +27,7 @@ class Pulseaudio(AutotoolsPackage, MesonPackage): license("LGPL-2.1-or-later") build_system( - conditional("autotools", when="@:16"), - conditional("meson", when="@17:"), - default="meson", + conditional("autotools", when="@:16"), conditional("meson", when="@17:"), default="meson" ) version("17.0", sha256="053794d6671a3e397d849e478a80b82a63cb9d8ca296bd35b73317bb5ceb87b5") @@ -74,7 +73,7 @@ class Pulseaudio(AutotoolsPackage, MesonPackage): depends_on("speexdsp@1.2:") depends_on("m4", type="build") -# if spec.satisfies("%gcc@8:"): + # if spec.satisfies("%gcc@8:"): os.environ["LDFLAGS"] = "-Wl,--copy-dt-needed-entries" def configure_args(self): @@ -117,8 +116,8 @@ def configure_args(self): return args -class MesonBuilder(meson.MesonBuilder): +class MesonBuilder(meson.MesonBuilder): def meson_args(self): return [ "-Ddatabase=gdbm", @@ -130,15 +129,13 @@ def meson_args(self): "-Dprefix={0}".format(self.prefix), "-Dlibdir={0}/lib64".format(self.prefix), "-Dbashcompletiondir={0}/share/bash-completion/completions".format(self.prefix), - "-Dsystemduserunitdir={0}/lib/systemd/user".format(self.prefix) -] + "-Dsystemduserunitdir={0}/lib/systemd/user".format(self.prefix), + ] def setup_build_environment(self, env): env.append_flags("CPPFLAGS", "-I{0}".format(self.spec["libiconv"].prefix.include)) env.append_flags("LDFLAGS", "-L{0} -liconv".format(self.spec["libiconv"].prefix.lib)) def setup_run_environment(self, env): - env.prepend_path('ALSA_PLUGIN_DIR', self.prefix.lib.alsa-lib) - env.prepend_path('LD_LIBRARY_PATH', self.spec['pulseaudio'].prefix.lib64) - - + env.prepend_path("ALSA_PLUGIN_DIR", self.prefix.lib.alsa - lib) + env.prepend_path("LD_LIBRARY_PATH", self.spec["pulseaudio"].prefix.lib64) From f81995af7d1eec248f365ad8b64a1d44a7b6a687 Mon Sep 17 00:00:00 2001 From: John Biddiscombe Date: Fri, 9 Jan 2026 19:24:49 +0100 Subject: [PATCH 5/5] Fix meson build setup to use new style spack api/commands --- .../builtin/packages/pulseaudio/package.py | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/repos/spack_repo/builtin/packages/pulseaudio/package.py b/repos/spack_repo/builtin/packages/pulseaudio/package.py index bfa39b8e999..294d3632eea 100644 --- a/repos/spack_repo/builtin/packages/pulseaudio/package.py +++ b/repos/spack_repo/builtin/packages/pulseaudio/package.py @@ -116,8 +116,6 @@ def configure_args(self): return args - -class MesonBuilder(meson.MesonBuilder): def meson_args(self): return [ "-Ddatabase=gdbm", @@ -133,9 +131,20 @@ def meson_args(self): ] def setup_build_environment(self, env): - env.append_flags("CPPFLAGS", "-I{0}".format(self.spec["libiconv"].prefix.include)) - env.append_flags("LDFLAGS", "-L{0} -liconv".format(self.spec["libiconv"].prefix.lib)) + if self.spec.satisfies("build_system=meson"): + env.append_flags("CPPFLAGS", "-I{0}".format(self.spec["libiconv"].prefix.include)) + env.append_flags("LDFLAGS", "-L{0} -liconv".format(self.spec["libiconv"].prefix.lib)) def setup_run_environment(self, env): - env.prepend_path("ALSA_PLUGIN_DIR", self.prefix.lib.alsa - lib) - env.prepend_path("LD_LIBRARY_PATH", self.spec["pulseaudio"].prefix.lib64) + # Always add ALSA plugin directory + env.prepend_path("ALSA_PLUGIN_DIR", join_path(self.prefix.lib, "alsa-lib")) + + # If pulseaudio is in the spec, make sure its libraries are on the runtime linker path + if self.spec.satisfies("^pulseaudio"): + # 1️⃣ Standard lib64 dir + env.prepend_path("LD_LIBRARY_PATH", self.spec["pulseaudio"].prefix.lib64) + + # 2️⃣ Also check for a pulseaudio subdirectory (some builds install here) + pulseaudio_libdir = join_path(self.spec["pulseaudio"].prefix.lib64, "pulseaudio") + if os.path.exists(pulseaudio_libdir): + env.prepend_path("LD_LIBRARY_PATH", pulseaudio_libdir)