From c31e96dcd741996e98f830e60b96de964dbe54dc Mon Sep 17 00:00:00 2001 From: Glenn Johnson Date: Mon, 19 Oct 2020 16:11:45 -0500 Subject: New package - pulseaudio (#19378) This PR adds the pulseaudio package and the speexdsp package as a dependency. In addition, this PR adds a `libs` property to the libtool package. --- .../repos/builtin/packages/libtool/package.py | 6 ++ .../repos/builtin/packages/pulseaudio/package.py | 93 ++++++++++++++++++++++ .../repos/builtin/packages/speexdsp/mkl.patch | 11 +++ .../repos/builtin/packages/speexdsp/package.py | 43 ++++++++++ 4 files changed, 153 insertions(+) create mode 100644 var/spack/repos/builtin/packages/pulseaudio/package.py create mode 100644 var/spack/repos/builtin/packages/speexdsp/mkl.patch create mode 100644 var/spack/repos/builtin/packages/speexdsp/package.py diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index 185f554b19..876817edd2 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -42,6 +42,12 @@ class Libtool(AutotoolsPackage, GNUMirrorPackage): def autoreconf(self, spec, prefix): Executable('./bootstrap')() + @property + def libs(self): + return find_libraries( + ['libltdl'], root=self.prefix, recursive=True, shared=True + ) + def _make_executable(self, name): return Executable(join_path(self.prefix.bin, name)) diff --git a/var/spack/repos/builtin/packages/pulseaudio/package.py b/var/spack/repos/builtin/packages/pulseaudio/package.py new file mode 100644 index 0000000000..16f550c140 --- /dev/null +++ b/var/spack/repos/builtin/packages/pulseaudio/package.py @@ -0,0 +1,93 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Pulseaudio(AutotoolsPackage): + """PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy + for your sound applications. + + PulseAudio is a sound system for POSIX OSes, meaning that it is a proxy for + your sound applications. It allows you to do advanced operations on your + sound data as it passes between your application and your hardware. Things + like transferring the audio to a different machine, changing the sample + format or channel count and mixing several sounds into one are easily + 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" + + version('13.0', sha256='961b23ca1acfd28f2bc87414c27bb40e12436efcf2158d29721b1e89f3f28057') + + variant('alsa', default=False, description='alsa support') + variant('fftw', default=False, description='FFTW support') + variant('gconf', default=False, description='Gconf support') + variant('openssl', default=False, + description='openSSL support (used for Airtunes/RAOP)') + variant('x11', default=False, description='x11 support') + + depends_on('alsa-lib@1.0.19:', when='+alsa') + depends_on('dbus@1.4.12:') + depends_on('fftw@3:', when='+fftw') + depends_on('gdbm') + depends_on('gettext@0.18.1:') + depends_on('glib') + depends_on('gconf', when='+gconf') + depends_on('json-c@0.11:') + depends_on('libcap') + depends_on('libiconv') + depends_on('libsndfile@1.0.18:') + depends_on('libtool@2.4:') # links to libltdl.so + depends_on('libsm', when='+x11') + depends_on('libuuid', when='+x11') + depends_on('libx11', when='+x11') + depends_on('libxcb', when='+x11') + depends_on('libxau', when='+x11') + depends_on('libxext', when='+x11') + depends_on('libxi', when='+x11') + depends_on('libxtst', when='+x11') + depends_on('openssl', when='+openssl') + depends_on('perl-xml-parser', type='build') + depends_on('speexdsp@1.2:') + + def configure_args(self): + args = [ + '--disable-systemd-daemon', + '--disable-systemd-journal', + '--disable-systemd-login', + '--disable-udev', + '--disable-waveout', + '--enable-dbus', + '--enable-glib2', + '--with-database=gdbm', + '--with-systemduserunitdir=no', + 'CPPFLAGS={0}'.format(self.spec['libtool'].headers.cpp_flags), + 'LDFLAGS={0}'.format(self.spec['libtool'].libs.search_flags), + ] + + # toggle based on variants + args += self.enable_or_disable('alsa') + args += self.enable_or_disable('gconf') + args += self.enable_or_disable('openssl') + args += self.enable_or_disable('x11') + args += self.with_or_without('fftw') + + # possible future variants + args.extend([ + '--disable-asyncns', + '--disable-avahi', + '--disable-bluez5', + '--disable-gcov', + '--disable-gsettings', + '--disable-gtk3', + '--disable-hal-compat', + '--disable-jack', + '--disable-lirc', + '--disable-orc', + '--disable-tcpwrap', + ]) + + return args diff --git a/var/spack/repos/builtin/packages/speexdsp/mkl.patch b/var/spack/repos/builtin/packages/speexdsp/mkl.patch new file mode 100644 index 0000000000..fe35a768e2 --- /dev/null +++ b/var/spack/repos/builtin/packages/speexdsp/mkl.patch @@ -0,0 +1,11 @@ +--- a/configure.ac 2019-04-25 22:57:34.000000000 -0500 ++++ b/configure.ac 2020-10-16 11:40:00.577784873 -0500 +@@ -266,7 +266,7 @@ + #include + void func() { + DFTI_DESCRIPTOR_HANDLE h; +- MKL_LONG result=DftiCreateDescriptor(&h, DFTI_SINGLE, DFTI_REAL, 0); ++ MKL_LONG result=DftiCreateDescriptor(&h, DFTI_SINGLE, DFTI_REAL, 0, 1); + }]])], + [AC_MSG_RESULT(yes)], + [AC_MSG_FAILURE([Failed to compile MKL test program. Make sure you set CFLAGS to include the include directory and set LDFLAGS to include the library directory and all necesarry libraries.])] diff --git a/var/spack/repos/builtin/packages/speexdsp/package.py b/var/spack/repos/builtin/packages/speexdsp/package.py new file mode 100644 index 0000000000..4713d4f523 --- /dev/null +++ b/var/spack/repos/builtin/packages/speexdsp/package.py @@ -0,0 +1,43 @@ +# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Speexdsp(AutotoolsPackage): + """SpeexDSP is a patent-free, Open Source/Free Software DSP library.""" + + homepage = "https://github.com/xiph/speexdsp" + url = "https://github.com/xiph/speexdsp/archive/SpeexDSP-1.2.0.tar.gz" + + version('1.2.0', sha256='d7032f607e8913c019b190c2bccc36ea73fc36718ee38b5cdfc4e4c0a04ce9a4') + + depends_on('autoconf', type='build') + depends_on('automake', type='build') + depends_on('libtool', type='build') + depends_on('m4', type='build') + + depends_on('fftw-api') + + patch('mkl.patch') + + def autoreconf(self, spec, prefix): + autoreconf('--install', '--verbose', '--force') + + def configure_args(self): + args = [] + + if 'intel-mkl' in self.spec: + # get the blas libs explicitly to avoid scalapack getting returned + args.extend([ + '--with-fft=proprietary-intel-mkl', + 'CPPFLAGS={0}'.format( + self.spec['intel-mkl'].headers.cpp_flags), + 'LDFLAGS={0}'.format(self.spec['blas'].libs.ld_flags), + ]) + elif 'fftw' in self.spec: + args.append('--with-fft=gpl-fftw3') + + return args -- cgit v1.2.3-70-g09d2