Package: libdiscid
Version: 0.1.0-1
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

currently[1] libdiscid does not compile on GNU/Hurd.
The problem is the unrecognized OS and a missing OS disc implementation.
The attached patch (which needs autoreconf'iguration, though) makes the 'gnu'
system recognized, and provides a "dummy" implementation for Hurd (as it has
no audio CD aupport, yet).

Can you apply it and report it upstream, please?

[1] 
http://buildd.debian-ports.org/fetch.php?&pkg=libdiscid&ver=0.1.0-1&arch=hurd-i386&stamp=1166512165&file=log&as=raw

Thanks,
-- 
Pino
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,7 @@
   #*-os2_emx*) os=os2 ;;
   #*-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
   #*-qnx*)     os=qnx; LIBS='-lsocket' ;;
+  *-gnu*)     os=gnu ;;
   *)          AC_MSG_ERROR([unsupported operating system]) ;;
 esac
 dnl AM_CONDITIONAL(DARWIN, test x$os = xdarwin)
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,7 @@
 lib_LTLIBRARIES = libdiscid.la
 
 libdiscid_la_SOURCES = base64.c sha1.c disc.c
-EXTRA_libdiscid_la_SOURCES = disc_linux.c disc_win32.c disc_darwin.c
+EXTRA_libdiscid_la_SOURCES = disc_linux.c disc_win32.c disc_darwin.c disc_gnu.c
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
 libdiscid_la_LIBADD = @DISC_OS_OBJ@
--- /dev/null
+++ b/src/disc_gnu.c
@@ -0,0 +1,50 @@
+/* --------------------------------------------------------------------------
+
+   MusicBrainz -- The Internet music metadatabase
+
+   Copyright (C) 2009 Pino Toscano <p...@kde.org>
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+   
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+   
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+
+--------------------------------------------------------------------------- */
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <assert.h>
+#include <stdio.h>
+
+#include "discid/discid_private.h"
+
+#define MB_DEFAULT_DEVICE	"/dev/cdrom"
+
+char *mb_disc_get_default_device_unportable(void) {
+	return MB_DEFAULT_DEVICE;
+}
+
+int mb_disc_read_unportable(mb_disc_private *disc, const char *device) {
+
+	{
+		snprintf(disc->error_msg, MB_ERROR_MSG_LENGTH,
+			"cannot open device `%s'", device);
+		return 0;
+	}
+}
+
+/* EOF */

Reply via email to