package snd-gtk-pulse everywhere, on linux uses ALSA, on GNU/kFreeBSD OSS
package snd-gtk-jack on i386 amd64 powerpc CPUs, i.e. also on kfreebsd-amd64
and kfreebsd-i386
package snd-nox everywhere, on linux uses ALSA, on GNU/kFreeBSD OSS
Agreed.
Do we really need to change the name? Could we simply leave
snd-nox-alsa unchanged and build it with different configurations on
Linux and kFreeBSD?
Well, technically it is possible, but the name of the package would be
misleading. The snd-nox-alsa have not been part of any Debian stable
release, so from my POV it is much better to rename it now to avoid
later confusion. But definitely, it is up to Maintainer, not Porter
decision ;-)
Please apply attached diff against snd_11.2-1 and after that perform
cd debian
mv snd-nox-alsa.install snd-nox.install
mv snd-nox-alsa.menu snd-nox.menu
The attached diff changes debian/control, debian/rules,
adds 05-kfreebsd.diff and 99-autoconf.diff, enlist them in series file.
It have been build-tested on kfreebsd-am64.
It would also be nice if you can ask upstream
to include 05-kfreebsd.diff changes for next release.
Many, many thanks
Petr
diff -u snd-11.2/debian/control snd-11.2/debian/control
--- snd-11.2/debian/control
+++ snd-11.2/debian/control
@@ -13,8 +13,8 @@
libsamplerate0-dev,
libxmu-dev,
libpulse-dev,
- libjack-dev [i386 amd64 powerpc],
- libasound2-dev,
+ libjack-dev [i386 amd64 powerpc kfreebsd-i386 kfreebsd-amd64 hurd-i386],
+ libasound2-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386],
libmpc-dev (>= 0.8),
bzip2,
quilt (>= 0.46-7)
@@ -48,8 +48,8 @@
This package contains the documentation for snd.
Package: snd-gtk-jack
-Architecture: i386 amd64 powerpc
-Provides: snd-gtk-alsa, snd-gtk
+Architecture: any-i386 any-amd64 any-powerpc
+Provides: snd-gtk-alsa [linux-any], snd-gtk
Depends: snd (>= ${source:Version}),
${shlibs:Depends},
${misc:Depends}
@@ -66,7 +66,7 @@
Package: snd-gtk-pulse
Architecture: any
-Provides: snd-gtk-alsa, snd-gtk
+Provides: snd-gtk-alsa [linux-any], snd-gtk
Depends: snd (>= ${source:Version}),
${shlibs:Depends},
${misc:Depends}
@@ -81,17 +81,17 @@
This package contains the files for the GTK+ user interface with
PulseAudio support.
-Package: snd-nox-alsa
+Package: snd-nox
Architecture: any
Depends: snd (>= ${source:Version}),
${shlibs:Depends},
${misc:Depends}
-Provides: snd-nox
+Provides: snd-nox-alsa [linux-any]
Conflicts: snd-dmotif, snd-dmotif-alsa, snd-smotif, snd-gtk-alsa,
snd-gtk (<< 11-3), snd-gtk-jack, snd-gtk-pulse
Replaces: snd (<< 5.10), snd-dmotif, snd-dmotif-alsa, snd-smotif,
snd-gtk-alsa, snd-gtk (<< 11-3), snd-gtk-jack, snd-gtk-pulse
-Description: Sound file editor (without X support - ALSA)
+Description: Sound file editor (without X support)
Snd is a powerful sound file editor that can be customized and extended using
the Scheme programming language.
.
diff -u snd-11.2/debian/rules snd-11.2/debian/rules
--- snd-11.2/debian/rules
+++ snd-11.2/debian/rules
@@ -1,11 +1,22 @@
#!/usr/bin/make -f
-DEBIAN_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+export DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+export DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+
COMMON_CONFIGURE_ARGS=--with-ladspa \
--enable-snd-debug \
--with-gmp \
--prefix=/usr
+ifeq ($(DEB_HOST_ARCH_OS),linux)
+EXTRA_CONFIGURE_ARGS=--with-alsa
+endif
+
+ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
+EXTRA_CONFIGURE_ARGS=--with-oss
+endif
+
%:
dh --with quilt $@
@@ -17,32 +28,36 @@
override_dh_auto_configure:
override_dh_auto_build:
override_dh_auto_install:
- # First, build with ALSA but without GUI
- ./configure $(COMMON_CONFIGURE_ARGS) \
- --with-no-gui \
- --with-alsa
+ # First, build without GUI
+ ./configure $(COMMON_CONFIGURE_ARGS) \
+ $(EXTRA_CONFIGURE_ARGS) \
+ --with-no-gui
$(MAKE)
- dh_install -psnd-nox-alsa
- dh_installman -psnd-nox-alsa snd.1
+ dh_install -psnd-nox
+ dh_installman -psnd-nox snd.1
# Clean the tree
$(MAKE) distclean
+
# then, build with PulseAudio
./configure $(COMMON_CONFIGURE_ARGS) \
- --with-gtk \
- --with-pulseaudio
+ --with-gtk \
+ --with-pulseaudio
$(MAKE)
dh_install -psnd-gtk-pulse
dh_installman -psnd-gtk-pulse snd.1
# Clean the tree
$(MAKE) distclean
+
# finally, build with JACK
-ifneq (,$(findstring :$(DEB_BUILD_ARCH):,:i386:powerpc:amd64:))
+ifneq (,$(findstring :$(DEB_HOST_ARCH_CPU):,:i386:powerpc:amd64:))
./configure $(COMMON_CONFIGURE_ARGS) \
- --with-gtk \
- --with-jack
+ --with-gtk \
+ --with-jack
$(MAKE)
dh_install -psnd-gtk-jack
dh_installman -psnd-gtk-jack snd.1
+ # Clean the tree
+ $(MAKE) distclean
endif
override_dh_install:
diff -u snd-11.2/debian/patches/series snd-11.2/debian/patches/series
--- snd-11.2/debian/patches/series
+++ snd-11.2/debian/patches/series
@@ -4,0 +5,2 @@
+05-kfreebsd.diff
+99-autoconf.diff
only in patch2:
unchanged:
--- snd-11.2.orig/debian/patches/05-kfreebsd.diff
+++ snd-11.2/debian/patches/05-kfreebsd.diff
@@ -0,0 +1,39 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1684,6 +1684,36 @@
+ ;;
+ esac
+ ;;
++ *-*-kfreebsd*)
++ LDSO_FLAGS="-shared"
++ LIBS="$LIBS -lm"
++ if test "$ac_cv_header_dlfcn_h" = yes ; then
++ LDFLAGS="$LDFLAGS -ldl"
++ fi
++ if test "$GCC" = yes ; then
++ SO_FLAGS="-fPIC $SO_FLAGS"
++ fi
++
++ AUDIO_SYSTEM=OSS
++
++ if test "$with_jack" = yes ; then
++ if test "$with_oss" != yes ; then
++ AUDIO_SYSTEM=JACK
++ fi
++ fi
++
++ case $AUDIO_SYSTEM in
++ JACK)
++ AC_DEFINE(HAVE_JACK_IN_LINUX)
++ AC_DEFINE(HAVE_OSS)
++ AUDIO_LIB="-lsamplerate"
++ ;;
++ OSS)
++ AC_DEFINE(HAVE_OSS)
++ AUDIO_SYSTEM=OSS
++ ;;
++ esac
++ ;;
+ *-*-sunos4*)
+ AC_DEFINE(MUS_SUN)
+ LIBS="$LIBS -lm"
only in patch2:
unchanged:
--- snd-11.2.orig/debian/patches/99-autoconf.diff
+++ snd-11.2/debian/patches/99-autoconf.diff
@@ -0,0 +1,45 @@
+
+ rerun autoconf after change of confugure.ac in kfreebsd.diff
+
+--- a/configure
++++ b/configure
+@@ -11017,6 +11017,39 @@
+ ;;
+ esac
+ ;;
++ *-*-kfreebsd*)
++ LDSO_FLAGS="-shared"
++ LIBS="$LIBS -lm"
++ if test "$ac_cv_header_dlfcn_h" = yes ; then
++ LDFLAGS="$LDFLAGS -ldl"
++ fi
++ if test "$GCC" = yes ; then
++ SO_FLAGS="-fPIC $SO_FLAGS"
++ fi
++
++ AUDIO_SYSTEM=OSS
++
++ if test "$with_jack" = yes ; then
++ if test "$with_oss" != yes ; then
++ AUDIO_SYSTEM=JACK
++ fi
++ fi
++
++ case $AUDIO_SYSTEM in
++ JACK)
++ $as_echo "#define HAVE_JACK_IN_LINUX 1" >>confdefs.h
++
++ $as_echo "#define HAVE_OSS 1" >>confdefs.h
++
++ AUDIO_LIB="-lsamplerate"
++ ;;
++ OSS)
++ $as_echo "#define HAVE_OSS 1" >>confdefs.h
++
++ AUDIO_SYSTEM=OSS
++ ;;
++ esac
++ ;;
+ *-*-sunos4*)
+ $as_echo "#define MUS_SUN 1" >>confdefs.h
+