[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#636631: building liboss4-salsa2 and oss4-gtk on GNU/kFreeBSD



Package: oss4
Version: 4.2-build2004-1
Severity: normal
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: kfreebsd

This patch makes liboss4-salsa2 and oss4-gtk buildable on GNU/kFreeBSD.

Please could you send the debian/patches part to upstream?

Thanks!

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-0-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'debian/control'
--- debian/control	2011-08-04 14:07:36 +0000
+++ debian/control	2011-08-04 18:31:10 +0000
@@ -31,7 +31,7 @@
  the module-assistant utility.
 
 Package: oss4-gtk
-Architecture: linux-any
+Architecture: linux-any kfreebsd-any
 Depends: oss4-base, ${shlibs:Depends}, ${misc:Depends}
 Description: Open Sound System - simple GTK2-based mixer control
  Open Sound System (OSS) is an attempt in unifying

=== added file 'debian/patches/kfreebsd-gnu.patch'
--- debian/patches/kfreebsd-gnu.patch	1970-01-01 00:00:00 +0000
+++ debian/patches/kfreebsd-gnu.patch	2011-08-04 18:31:51 +0000
@@ -0,0 +1,116 @@
+--- a/include/soundcard.h
++++ b/include/soundcard.h
+@@ -50,7 +50,7 @@
+ /* In Linux we need to be prepared for cross compiling */
+ #include <linux/ioctl.h>
+ #else
+-# ifdef __FreeBSD__
++# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #    include <sys/ioccom.h>
+ # else
+ #    include <sys/ioctl.h>
+--- a/kernel/framework/audio/oss_audio_core.c
++++ b/kernel/framework/audio/oss_audio_core.c
+@@ -3646,7 +3646,7 @@
+ 	}
+       return 0;
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     case FREEBSD_GETBLKSIZE:
+ #endif
+     case SNDCTL_DSP_GETBLKSIZE:
+--- a/kernel/framework/sndstat/oss_sndstat.c
++++ b/kernel/framework/sndstat/oss_sndstat.c
+@@ -109,9 +109,9 @@
+       put_status ("\n");
+     }
+ 
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__)
+   {
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+     extern char version[];
+ #endif
+ 
+--- a/lib/libOSSlib/compile.sh
++++ b/lib/libOSSlib/compile.sh
+@@ -7,7 +7,7 @@
+ 	$MAKE libOSSlib.so
+ 	;;
+ 
+-"FreeBSD")
++"FreeBSD" | "GNU/kFreeBSD")
+ 	$MAKE libOSSlib.so
+ 	;;
+ 
+--- a/setup/srcconf.c
++++ b/setup/srcconf.c
+@@ -122,7 +122,7 @@
+ #include "srcconf_linux.inc"
+ #endif
+ 
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #include "srcconf_freebsd.inc"
+ #endif
+ 
+@@ -480,7 +480,7 @@
+ #include "gen_driver_linux.inc"
+ #endif
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+ #include "gen_driver_freebsd.inc"
+ #endif
+ 
+@@ -1456,6 +1456,8 @@
+     strcpy (un.sysname, "SCO_SV");
+   if (strcmp (un.sysname, "Haiku") == 0)
+     strcpy (un.sysname, "BeOS");
++  if (strcmp (un.sysname, "GNU/kFreeBSD") == 0)
++    strcpy (un.sysname, "FreeBSD");
+   printf ("System: %s\n", un.sysname);
+   strcpy (conf->system, un.sysname);
+   sprintf (this_os, "kernel/OS/%s", un.sysname);
+@@ -1549,7 +1551,7 @@
+   if (hostcc == NULL) hostcc = DEFAULT_CC;
+   if (targetcc == NULL) targetcc = DEFAULT_CC;
+ 
+-#if defined(linux) || defined(__FreeBSD__) || defined(__SCO_VERSION__)
++#if defined(linux) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__SCO_VERSION__)
+   mkdir ("target", 0755);
+   mkdir ("target/build", 0755);
+   system ("touch target/build/.nomake");
+--- a/setup/setupdir.sh
++++ b/setup/setupdir.sh
+@@ -31,6 +31,12 @@
+ 	OS=BeOS
+ fi
+ 
++# Use the same source directories for FreeBSD and GNU/kFreeBSD
++if test "$OS " = "GNU/kFreeBSD "
++then
++	OS=FreeBSD
++fi
++
+ # Use Linux24 as the OS name for Linux 2.4.x
+ if test "$OS " = "Linux "
+ then
+--- a/setup/FreeBSD/build.sh
++++ b/setup/FreeBSD/build.sh
+@@ -150,10 +150,10 @@
+ 	strip prototype/usr/sbin/osslic
+ 
+         BITS=3 # Default to 32 bit ELF format
+-        if test "`uname -m` " = "amd64 "
+-        then
++        case "`uname -m`" in amd64|x86_64)
+            BITS=6 # Use 64 bit ELF format
+-        fi
++	;;
++	esac
+ 
+ 	prototype/usr/sbin/osslic -q -u -$BITS./prototype/$OSSLIBDIR/build/osscore.lib
+ 	

=== modified file 'debian/patches/series'
--- debian/patches/series	2011-08-04 14:07:36 +0000
+++ debian/patches/series	2011-08-04 14:16:29 +0000
@@ -11,3 +11,4 @@
 liboss4-salsa.patch
 snd_asoundlib_version.patch
 #generic_srccconf.patch
+kfreebsd-gnu.patch

=== modified file 'debian/rules'
--- debian/rules	2011-08-04 14:07:36 +0000
+++ debian/rules	2011-08-04 18:29:42 +0000
@@ -4,6 +4,8 @@
 DEB_DH_INSTALL_ARGS := -X.svn
 UPSTREAM_VERSION := $(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2)
 
+DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
+
 include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 
@@ -13,15 +15,18 @@
 	mkdir -p $(CURDIR)/build-tree/oss-build
 	cd $(CURDIR)/build-tree/oss-build && $(CURDIR)/configure --enable-libsalsa=NO
 
+	touch $@
+
+stamp-build-oss4:
 	# we do NOT want to build the kernel modules now
-	sed -i -e 's/SUBDIRS=lib cmd kernel\(.*\)/SUBDIRS=lib cmd\1/' $(CURDIR)/build-tree/oss-build/Makefile
+	sed -i -e 's/SUBDIRS=lib cmd kernel\(.*\)/SUBDIRS=lib cmd\1/' \
+		-e 's/SUBDIRS=lib cmd os_cmd kernel[^\s]*/SUBDIRS=lib cmd os_cmd/' \
+		$(CURDIR)/build-tree/oss-build/Makefile
 	echo > $(CURDIR)/build-tree/oss-build/.makefile
 
-	touch $@
-
-stamp-build-oss4:
 	cd $(CURDIR)/build-tree/oss-build && make build
 
+ifeq ($(DEB_HOST_ARCH_OS), linux)
 	# TODO: rewrite upstream's 'build.sh' from scratch
 	cat `find $(CURDIR)/build-tree/oss-build/kernel/drv -name .devices`| grep -v '^#' \
 	| sort | grep -v '^osscore' | grep -v '^oss_audiocs' | grep -v '^oss_sadasupport' \
@@ -31,6 +36,7 @@
 	    ( sed "s:CONFIGFILEPATH:/etc/oss4/conf:g" < $(CURDIR)/build-tree/oss-build/noregparm/kernel/drv/$$n/$$n.man > /tmp/ossman.txt && \
 	    /usr/bin/txt2man -t "$$n" -v "OSS Devices" -s 7 /tmp/ossman.txt | gzip -9 > $(CURDIR)/build-tree/oss-build/prototype/usr/share/man/man7/$$n.7.gz ) \
 	done
+endif
 
 	touch $@
 
@@ -76,6 +82,7 @@
 clean::
 	rm -rf stamp-build-oss4 stamp-prepare-oss4 stamp-source-oss4 \
 	stamp-build-libsalsa \
+	build-tree \
 	debian/oss4-dkms.install debian/dkms/dkms.conf \
 	oss-v$(UPSTREAM_VERSION)-src-gpl.tar.bz2.cdbs-config_list \
 	debian/oss.conf


Reply to: