Package: libmusicbrainz-2.1
Version: 2.1.5-2
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd

Hi,

currently[1] libmusicbrainz-2.1 does not copile on GNU/Hurd.
The reason is that it does not provide an osdep for Hurd.
The attached patch makes the 'gnu' system recognized, and adds a dummy osdep
implementation (Hurd has no audio CD support, yet).

[1] 
http://buildd.debian-ports.org/fetch.php?&pkg=libmusicbrainz-2.1&ver=2.1.5-2&arch=hurd-i386&stamp=1207777225&file=log&as=raw

Thanks,
-- 
Pino
#! /bin/sh /usr/share/dpatch/dpatch-run
## 60-hurd-support.dpatch by Pino Toscano <[email protected]>
##
## DP: Add (dummy) support for GNU/Hurd.

@DPATCH@
--- a/configure
+++ b/configure
@@ -2512,6 +2512,7 @@
   *-os2_emx*) os=os2 ;;
   *-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
   *-qnx*)     os=qnx; LIBS='-lsocket' ;;
+  *-gnu*)     os=gnu ;;
   *)          { echo "$as_me:$LINENO: result: WARNING: unknown system" >&5
 echo "${ECHO_T}WARNING: unknown system" >&6; } ;;
 esac
--- a/configure.in
+++ b/configure.in
@@ -21,6 +21,7 @@
   *-os2_emx*) os=os2 ;;
   *-solaris*) os=solaris; LIBS='-lsocket -lnsl' ;;
   *-qnx*)     os=qnx; LIBS='-lsocket' ;;
+  *-gnu*)     os=gnu ;;
   *)          AC_MSG_RESULT([WARNING: unknown system]) ;;
 esac
 AM_CONDITIONAL(DARWIN, test x$os = xdarwin)
--- a/osdep/Makefile.am
+++ b/osdep/Makefile.am
@@ -11,6 +11,7 @@
   mb_cygwin.cpp mb_cygwin.h \
   mb_darwin.cpp mb_darwin.h \
   mb_freebsd.cpp mb_freebsd.h \
+  mb_gnu.cpp mb_gnu.h \
   mb_irix.cpp mb_irix.h \
   mb_linux.cpp mb_linux.h \
   mb_netbsd.cpp mb_netbsd.h \
--- a/osdep/Makefile.in
+++ b/osdep/Makefile.in
@@ -178,6 +178,7 @@
   mb_cygwin.cpp mb_cygwin.h \
   mb_darwin.cpp mb_darwin.h \
   mb_freebsd.cpp mb_freebsd.h \
+  mb_gnu.cpp mb_gnu.h \
   mb_irix.cpp mb_irix.h \
   mb_linux.cpp mb_linux.h \
   mb_netbsd.cpp mb_netbsd.h \
--- /dev/null
+++ b/osdep/mb_gnu.cpp
@@ -0,0 +1,65 @@
+/* --------------------------------------------------------------------------
+
+   MusicBrainz -- The Internet music metadatabase
+
+   Copyright (C) 2009 Pino Toscano <[email protected]>
+   
+   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
+
+----------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <assert.h>
+
+#include "mb.h"
+#include "diskid.h"
+#include "config.h"
+
+
+int ReadTOCHeader(int fd, 
+                  int& first, 
+                  int& last)
+{
+   return 1;
+}
+
+
+int ReadTOCEntry(int fd, 
+                 int track, 
+                 int& lba)
+{
+   return 1;
+}
+
+
+bool DiskId::ReadTOC(MUSICBRAINZ_DEVICE device, 
+                     MUSICBRAINZ_CDINFO& cdinfo)
+{
+   {
+       char *err = static_cast<char *>(malloc(strlen(device) + 15));
+       sprintf(err,"Cannot open '%s'", device);
+       ReportError(err);
+       free(err);
+       return false;
+   }
+}
--- /dev/null
+++ b/osdep/mb_gnu.h
@@ -0,0 +1,50 @@
+/* --------------------------------------------------------------------------
+
+   MusicBrainz -- The Internet music metadatabase
+
+   Copyright (C) 2009 Pino Toscano <[email protected]>
+   
+   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
+
+----------------------------------------------------------------------------*/
+
+#if !defined(_CDI_GNU_H_)
+#define _CDI_GNU_H_
+
+
+#define OS "GNU"
+
+// 
+//  GNU CD-audio declarations
+//
+
+
+typedef char* MUSICBRAINZ_DEVICE;
+
+
+
+// 
+//  GNU specific prototypes
+// 
+
+int ReadTOCHeader(int fd, 
+                  int& first, 
+                  int& last);
+
+int ReadTOCEntry(int fd, 
+                 int track, 
+                 int& lba);
+
+#endif

Reply via email to