]> Pileus Git - ~andy/sunrise/commitdiff
media-libs/hdj_mod: New Ebuild for bug 272100 Thanks Tommy[D] and Floppym.
authorAlex Barker (KWhat) <alex@1stleg.com>
Wed, 21 Dec 2011 23:42:47 +0000 (23:42 +0000)
committerAlex Barker (KWhat) <alex@1stleg.com>
Wed, 21 Dec 2011 23:42:47 +0000 (23:42 +0000)
svn path=/sunrise/; revision=12597

media-libs/hdj_mod/ChangeLog [new file with mode: 0644]
media-libs/hdj_mod/Manifest [new file with mode: 0644]
media-libs/hdj_mod/files/dj_console_mp3_e2.patch [new file with mode: 0644]
media-libs/hdj_mod/files/kernel_2.6.31_fix.patch [new file with mode: 0644]
media-libs/hdj_mod/files/kernel_2.6.37_fix.patch [new file with mode: 0644]
media-libs/hdj_mod/hdj_mod-1.28.ebuild [new file with mode: 0644]
media-libs/hdj_mod/metadata.xml [new file with mode: 0644]

diff --git a/media-libs/hdj_mod/ChangeLog b/media-libs/hdj_mod/ChangeLog
new file mode 100644 (file)
index 0000000..680ea25
--- /dev/null
@@ -0,0 +1,10 @@
+# ChangeLog for media-libs/hdj_mod
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+  21 Dec 2011; Alex Barker (KWhat) <alex@1stleg.com>
+  +files/dj_console_mp3_e2.patch, +hdj_mod-1.28.ebuild,
+  +files/kernel_2.6.31_fix.patch, +files/kernel_2.6.37_fix.patch,
+  +metadata.xml:
+  New Ebuild for bug 272100 Thanks Tommy[D] and Floppym.
+
diff --git a/media-libs/hdj_mod/Manifest b/media-libs/hdj_mod/Manifest
new file mode 100644 (file)
index 0000000..e5549a0
--- /dev/null
@@ -0,0 +1,8 @@
+AUX dj_console_mp3_e2.patch 1368 RMD160 a34cf5377c11d5287faf2893d184cb9dedc720bf SHA1 51c625212fc03d1de05549807cd527e24a0379b9 SHA256 104d04b930d5072eac3c05771a1eb7599b3b58447259be3402c85a3e98b6e028
+AUX kernel_2.6.31_fix.patch 860 RMD160 83bdf46bb758abb8e5c143d99d22e574cd09453c SHA1 ff9ea8a58c416af2f0a350e21edc5e18805ad62c SHA256 cc08c589348aae34d6a9b1e52ce4e608d9aa1310da9d1a7f4762b1e7e12fe378
+AUX kernel_2.6.37_fix.patch 4731 RMD160 aa9baf58e44e58a2bdb9c0e6648f490d097499a2 SHA1 e19646e4a0fc667dcd356237daf982833b1c2d21 SHA256 33399dd6d8e50dd8db79d8da85d7f3e4de6add701bca84131525880f8665437b
+DIST hdj_mod-1.28.tgz 10060469 RMD160 3aa535592cbe3ae3b031b2c29bf19ffdcd758826 SHA1 523c5763637db5742f79b2c95c4f15a906965e1d SHA256 c3957491c367f642484e7a7f5a15acb8cb50f7c407cb225eabc7fb5d6a07ed28
+DIST hdj_mod-kernel_2.6.35_fix.patch 22170 RMD160 9bd8514fa25ea37d3b3cd673408f397e1b03e1e3 SHA1 6fe59acd69a8094899c8f1512023d59f5db2c1af SHA256 5a244f0b181f906951a6ad5ca8ab5033ff3b3079d0598fd61fd035aad06a78f5
+EBUILD hdj_mod-1.28.ebuild 1105 RMD160 57cdeef15dca9f6b6b0e65d3f3ace5a13346bd13 SHA1 431169b457bcd2dac2f04c12e0bde4cef299cdfc SHA256 c13732ad2cad995b610856dd2376e178c45c0132c795d20324667abe2f27599b
+MISC ChangeLog 369 RMD160 430dbdc738607675f971d5d1bcf2f1aa9febdbbd SHA1 73a7d56f9969bd5bd259fd2d559e94d78d7179d7 SHA256 2a5f8d359ee6d93fa1c6e6617b530e27005eb68bdcabd36a31fcf29525f4d308
+MISC metadata.xml 222 RMD160 f19bb5918cafb20c787f3d85a2bfda9da3c7f347 SHA1 a88ad2dab1dec463642a229991eb137a30749d5e SHA256 54b7fca9cfec004e067f757b291a2a0489c61d25199503a22983a4fd697158db
diff --git a/media-libs/hdj_mod/files/dj_console_mp3_e2.patch b/media-libs/hdj_mod/files/dj_console_mp3_e2.patch
new file mode 100644 (file)
index 0000000..dde59e1
--- /dev/null
@@ -0,0 +1,29 @@
+--- device.c.orig      2010-12-12 16:34:17.866666668 +0100
++++ device.c   2011-01-09 12:17:06.000000000 +0100
+@@ -1828,6 +1828,8 @@ static int usbid_to_product_code(u32 usb
+               return DJCONTROLLER_PRODUCT_CODE;\r
+       } else if (usbid == USB_ID(USB_HDJ_VENDOR_ID,   DJ_CONTROL_MP3W_PID)) {\r
+               return DJCONTROLLER_PRODUCT_CODE;\r
++      } else if (usbid == USB_ID(USB_HDJ_VENDOR_ID,   DJ_CONTROL_MP3E2_PID)) {\r
++              return DJCONTROLSTEEL_PRODUCT_CODE;\r
+       } else {\r
+               return DJCONSOLE_PRODUCT_UNKNOWN;\r
+       }\r
+@@ -1860,6 +1862,7 @@ static int hdj_probe(struct usb_interfac
+               (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONSOLE_RMX_PID)&&\r
+               (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONTROL_MP3_PID)&&\r
+               (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONTROL_MP3W_PID)&&\r
++              (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONTROL_MP3E2_PID)&&\r
+               (le16_to_cpu(usb_dev->descriptor.idProduct)!=DJ_CONSOLE_STEEL_PID))\r
+       {\r
+               printk(KERN_INFO"hdj_probe() unsupported device, idVendor%lx, idProduct:%lx\n",\r
+--- device.h.orig      2009-01-27 15:25:50.000000000 +0100
++++ device.h   2011-01-09 12:19:22.000000000 +0100
+@@ -38,6 +38,7 @@ extern int                                   netlink_unit;
+ #define DJ_CONSOLE_RMX_PID            0xb101\r
+ #define DJ_CONTROL_MP3_PID            0xd000\r
+ #define DJ_CONTROL_MP3W_PID           0xd001\r
++#define DJ_CONTROL_MP3E2_PID  0xb105\r
+ #define DJ_CONSOLE_STEEL_PID  0xb102\r
\r
+ #define DJ_BULK_IFNUM                 0\r
diff --git a/media-libs/hdj_mod/files/kernel_2.6.31_fix.patch b/media-libs/hdj_mod/files/kernel_2.6.31_fix.patch
new file mode 100644 (file)
index 0000000..0dbc66d
--- /dev/null
@@ -0,0 +1,22 @@
+--- device.c.orig      2011-02-17 19:42:06.000000000 -0800
++++ device.c   2011-02-17 21:16:55.442483443 -0800
+@@ -1660,11 +1660,19 @@
+               /* let the kernel option override custom id */\r
+               strncpy(card_id,id[idx],sizeof(card_id)-1);\r
+       }\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) )\r
++      err = snd_card_create(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0, &card);\r
++      if (err < 0) {\r
++              snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx);\r
++              return err;\r
++      }\r
++#else\r
+       card = snd_card_new(index[idx], card_id/*id[idx]*/, THIS_MODULE, 0);\r
+       if (card == NULL) {\r
+               snd_printk(KERN_WARNING "snd_hdj_chip_create(): cannot create card instance %d\n", idx);\r
+               return -ENOMEM;\r
+       }\r
++#endif\r
+       \r
+       /* save the index, so people who have the card can reference the chip */\r
+       card->private_data = (void*)(unsigned long)idx;\r
diff --git a/media-libs/hdj_mod/files/kernel_2.6.37_fix.patch b/media-libs/hdj_mod/files/kernel_2.6.37_fix.patch
new file mode 100644 (file)
index 0000000..f3a413c
--- /dev/null
@@ -0,0 +1,131 @@
+--- bulk.c.orig
++++ bulk.c
+@@ -34,6 +34,9 @@
+ #include <linux/usb.h>\r
+ #include <linux/delay.h>\r
+ #include <linux/version.h>    /* For LINUX_VERSION_CODE */\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++#include <linux/semaphore.h>\r
++#endif\r
+ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )\r
+ #include <linux/slab.h>\r
+ #endif\r
+@@ -3086,7 +3089,11 @@ int hdj_create_bulk_interface(struct snd_hdj_chip* chip,
+               goto hdj_create_bulk_interface_error;\r
+       }\r
+       /* allocate the buffer for bulk_out_urb */\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&ubulk->bulk_out_buffer_mutex,1);\r
++#else\r
+       init_MUTEX(&ubulk->bulk_out_buffer_mutex);\r
++#endif\r
+       \r
+       ubulk->bulk_out_buffer =\r
+ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )\r
+@@ -3633,7 +3640,11 @@ static int init_output_control_state(struct usb_hdjbulk *ubulk)
+               return -EINVAL;\r
+       }\r
\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&ubulk->output_control_mutex,1);\r
++#else\r
+       init_MUTEX(&ubulk->output_control_mutex);\r
++#endif\r
+       init_completion(&ubulk->output_control_completion);\r
\r
+       /* Every product here except the Steel targets HID.  Since the steel does not target HID, we don't\r
+@@ -3907,7 +3918,11 @@ int hdjbulk_init_dj_console(struct usb_hdjbulk *ubulk)
+       u16 value = 0;\r
+       struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context);\r
\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&dc->device_config_mutex,1);\r
++#else\r
+       init_MUTEX(&dc->device_config_mutex);\r
++#endif\r
+       \r
+       ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common);\r
+       if (ret!=0) {\r
+@@ -4185,7 +4200,11 @@ int hdjbulk_init_dj_steel(struct usb_hdjbulk *ubulk)
\r
+       spin_lock_init(&dc->bulk_buffer_lock);\r
+       init_completion(&dc->bulk_request_completion);\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&dc->bulk_request_mutex,1);\r
++#else\r
+       init_MUTEX(&dc->bulk_request_mutex);\r
++#endif\r
\r
+       if ((ret = init_continuous_reader(ubulk))!=0) {\r
+               printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n",\r
+--- device.c.orig
++++ device.c
+@@ -66,7 +66,11 @@ MODULE_PARM_DESC(index, "Index value for the Hercules DJ Series adapter.");
+ module_param_array(id, charp, NULL, 0444);\r
+ MODULE_PARM_DESC(id, "ID string for the Hercules DJ Series adapter.");\r
\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++static DEFINE_SEMAPHORE(register_mutex);\r
++#else\r
+ static DECLARE_MUTEX(register_mutex);\r
++#endif\r
+ static struct snd_hdj_chip *usb_chip[SNDRV_CARDS];\r
\r
+ /* reference count for the socket */\r
+@@ -1698,7 +1702,11 @@ static int snd_hdj_chip_create(struct usb_device *dev,
+       chip->card = card;\r
+       chip->product_code = product_code;\r
\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&chip->vendor_request_mutex,1);\r
++#else\r
+       init_MUTEX(&chip->vendor_request_mutex);\r
++#endif\r
\r
+       /* initialise the atomic variables */\r
+       atomic_set(&chip->locked_io, 0);\r
+@@ -1713,7 +1721,11 @@ static int snd_hdj_chip_create(struct usb_device *dev,
+       INIT_LIST_HEAD(&chip->bulk_list);\r
+       chip->usb_id = USB_ID(le16_to_cpu(dev->descriptor.idVendor),\r
+                             le16_to_cpu(dev->descriptor.idProduct));\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&chip->netlink_list_mutex,1);\r
++#else\r
+       init_MUTEX(&chip->netlink_list_mutex);\r
++#endif\r
+       INIT_LIST_HEAD(&chip->netlink_registered_processes);\r
+       \r
+       /* fill in DJ capabilities for this device */\r
+--- midi.c.orig
++++ midi.c
+@@ -34,6 +34,9 @@
+ #include <linux/module.h>\r
+ #include <linux/usb.h>\r
+ #include <linux/kthread.h>\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++#include <linux/semaphore.h>\r
++#endif\r
+ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )\r
+ #include <linux/slab.h>\r
+ #endif\r
+@@ -63,7 +66,7 @@
\r
+ unsigned long channel_list_initialized = 0;\r
+ struct midi_channel_elem channel_list[NUM_MIDI_CHANNELS];\r
+-spinlock_t channel_list_lock = SPIN_LOCK_UNLOCKED;\r
++DEFINE_SPINLOCK(channel_list_lock);\r
\r
+ static struct usb_protocol_ops snd_hdjmidi_standard_ops = {\r
+       .input = snd_hdjmidi_standard_input,\r
+@@ -732,7 +735,11 @@ static int controller_output_init(struct controller_output_hid *controller_state
+       \r
+       /* this buffer and URB below are for general control requests, like changing the\r
+        *  mouse setting or setting LEDs */\r
++#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) )\r
++      sema_init(&controller_state->output_control_ctl_mutex, 1);\r
++#else\r
+       init_MUTEX(&controller_state->output_control_ctl_mutex);\r
++#endif\r
+       init_completion(&controller_state->output_control_ctl_completion);\r
+ #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) )\r
+       controller_state->output_control_ctl_req = usb_alloc_coherent(ep->umidi->chip->dev, \r
diff --git a/media-libs/hdj_mod/hdj_mod-1.28.ebuild b/media-libs/hdj_mod/hdj_mod-1.28.ebuild
new file mode 100644 (file)
index 0000000..fb7eee5
--- /dev/null
@@ -0,0 +1,41 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+inherit eutils linux-info linux-mod rpm
+
+DESCRIPTION="GPL Linux MIDI drivers for Hercules DJ midi controller devices"
+HOMEPAGE="http://ts.hercules.com/eng/index.php?pg=view_files&gid=2&fid=28&pid=215&cid=1"
+MY_PN="Hercules_DJSeries_Linux"
+
+SRC_URI="ftp://ftp.hercules.com/pub/webupdate/DJCSeries/${MY_PN}.tgz -> ${P}.tgz
+       http://ompldr.org/vOG1vbg/${PN}-kernel_2.6.35_fix.patch"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+BUILD_TARGETS="clean modules"
+MODULE_NAMES="hdj_mod()"
+
+pkg_setup () {
+       BUILD_PARAMS="KERN_DIR=\"${KV_DIR}\" KERNOUT=\"${KV_OUT_DIR}\""
+       CONFIG_CHECK="SND_RAWMIDI SND_VIRMIDI"
+       linux-mod_pkg_setup
+}
+
+src_unpack () {
+       unpack ${A}
+       rpm_unpack "./kernel module/hdjmod-dkms-${PV}-1.noarch.rpm"
+       mv usr/src/hdjmod-${PV} "${S}" || die
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/dj_console_mp3_e2.patch
+       epatch "${FILESDIR}"/kernel_2.6.31_fix.patch
+       epatch "${DISTDIR}"/${PN}-kernel_2.6.35_fix.patch
+       epatch "${FILESDIR}"/kernel_2.6.37_fix.patch
+}
diff --git a/media-libs/hdj_mod/metadata.xml b/media-libs/hdj_mod/metadata.xml
new file mode 100644 (file)
index 0000000..cc9a79f
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer><email>maintainer-wanted@gentoo.org</email></maintainer>
+       <use></use>
+</pkgmetadata>