mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-11 17:43:51 +02:00
New package: chuck-1.3.5.0
This commit is contained in:
parent
23088fb2e4
commit
2ebc27edd0
3 changed files with 199 additions and 0 deletions
149
srcpkgs/chuck/patches/hid-smc.patch
Normal file
149
srcpkgs/chuck/patches/hid-smc.patch
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
diff -ru chuck-1.2.1.1~/src/util_hid.cpp chuck-1.2.1.1/src/util_hid.cpp
|
||||||
|
--- chuck-1.2.1.1~/src/util_hid.cpp 2008-03-29 23:24:21.000000000 +0100
|
||||||
|
+++ chuck-1.2.1.1/src/util_hid.cpp 2008-03-29 23:24:54.000000000 +0100
|
||||||
|
@@ -7175,14 +7175,139 @@
|
||||||
|
int WiiRemote_send( const HidMsg * msg ){ return -1; }
|
||||||
|
const char * WiiRemote_name( int wr ){ return NULL; }
|
||||||
|
|
||||||
|
+#define SYSFS_TILTSENSOR_FILE "/sys/devices/platform/applesmc/position"
|
||||||
|
+#define TILTSENSOR_BUF_LEN 32
|
||||||
|
+
|
||||||
|
+static struct t_TiltSensor_data
|
||||||
|
+{
|
||||||
|
+ union
|
||||||
|
+ {
|
||||||
|
+ struct t_macbook
|
||||||
|
+ {
|
||||||
|
+ int x;
|
||||||
|
+ int y;
|
||||||
|
+ int z;
|
||||||
|
+ } macbook;
|
||||||
|
+ } data;
|
||||||
|
+ int dataType;
|
||||||
|
+ int detected;
|
||||||
|
+ int refcount;
|
||||||
|
+
|
||||||
|
+ t_TiltSensor_data()
|
||||||
|
+ {
|
||||||
|
+ refcount = 0;
|
||||||
|
+ dataType = -1;
|
||||||
|
+ detected = 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+} TiltSensor_data;
|
||||||
|
+enum
|
||||||
|
+{
|
||||||
|
+ linuxAppleSMCMacBookDataType
|
||||||
|
+};
|
||||||
|
+static int TiltSensor_detect()
|
||||||
|
+{
|
||||||
|
+ int fd;
|
||||||
|
+
|
||||||
|
+ fd = open(SYSFS_TILTSENSOR_FILE, O_RDONLY);
|
||||||
|
+
|
||||||
|
+ if (fd > 0)
|
||||||
|
+ {
|
||||||
|
+ TiltSensor_data.dataType = linuxAppleSMCMacBookDataType;
|
||||||
|
+ TiltSensor_data.detected = 1;
|
||||||
|
+ close(fd);
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ TiltSensor_data.detected = -1;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int TiltSensor_do_read()
|
||||||
|
+{
|
||||||
|
+
|
||||||
|
+ switch(TiltSensor_data.dataType)
|
||||||
|
+ {
|
||||||
|
+ case linuxAppleSMCMacBookDataType:
|
||||||
|
+ char buf[TILTSENSOR_BUF_LEN];
|
||||||
|
+ int ret, fd;
|
||||||
|
+ fd = open(SYSFS_TILTSENSOR_FILE, O_RDONLY);
|
||||||
|
+
|
||||||
|
+ if (fd < 0) {
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ ret = read(fd, buf, TILTSENSOR_BUF_LEN);
|
||||||
|
+ if (ret < 0) {
|
||||||
|
+ close(fd);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ if (sscanf(buf, "(%d,%d,%d)\n", &TiltSensor_data.data.macbook.x, &TiltSensor_data.data.macbook.y, &TiltSensor_data.data.macbook.z) != 3) {
|
||||||
|
+ close(fd);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
+ close(fd);
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
void TiltSensor_init(){}
|
||||||
|
void TiltSensor_quit(){}
|
||||||
|
void TiltSensor_probe(){}
|
||||||
|
-int TiltSensor_count(){ return 0; }
|
||||||
|
-int TiltSensor_open( int ts ){ return -1; }
|
||||||
|
-int TiltSensor_close( int ts ){ return -1; }
|
||||||
|
-int TiltSensor_read( int ts, int type, int num, HidMsg * msg ){ return -1; }
|
||||||
|
-const char * TiltSensor_name( int ts ){ return NULL; }
|
||||||
|
+int TiltSensor_count()
|
||||||
|
+{
|
||||||
|
+ if(TiltSensor_data.detected == 0)
|
||||||
|
+ TiltSensor_detect();
|
||||||
|
+
|
||||||
|
+ if(TiltSensor_data.detected == -1)
|
||||||
|
+ return 0;
|
||||||
|
+ else if(TiltSensor_data.detected == 1)
|
||||||
|
+ return 1;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+int TiltSensor_open( int ts )
|
||||||
|
+{
|
||||||
|
+ if(TiltSensor_data.detected == 0)
|
||||||
|
+ TiltSensor_detect();
|
||||||
|
+
|
||||||
|
+ if(TiltSensor_data.detected == -1)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ TiltSensor_data.refcount++;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+int TiltSensor_close( int ts )
|
||||||
|
+{
|
||||||
|
+ TiltSensor_data.refcount--;
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+int TiltSensor_read( int ts, int type, int num, HidMsg * msg )
|
||||||
|
+{
|
||||||
|
+
|
||||||
|
+ if(TiltSensor_data.detected == -1)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ if(!TiltSensor_do_read())
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ if(TiltSensor_data.dataType == linuxAppleSMCMacBookDataType)
|
||||||
|
+ {
|
||||||
|
+ msg->idata[0] = TiltSensor_data.data.macbook.x;
|
||||||
|
+ msg->idata[1] = TiltSensor_data.data.macbook.y;
|
||||||
|
+ msg->idata[2] = TiltSensor_data.data.macbook.z;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+const char * TiltSensor_name( int ts )
|
||||||
|
+{
|
||||||
|
+ return "Apple Sudden Motion Sensor";
|
||||||
|
+}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Only in chuck-1.2.1.1/src: util_hid.cpp.orig
|
27
srcpkgs/chuck/patches/makefile.patch
Normal file
27
srcpkgs/chuck/patches/makefile.patch
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
--- chuck-1.3.5.1/src/makefile
|
||||||
|
+++ chuck-1.3.5.1/src/makefile
|
||||||
|
@@ -40,8 +40,6 @@
|
||||||
|
|
||||||
|
ifneq ($(CHUCK_DEBUG),)
|
||||||
|
CFLAGS+= -g
|
||||||
|
-else
|
||||||
|
-CFLAGS+= -O3
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(USE_64_BIT_SAMPLE),)
|
||||||
|
--- chuck-1.3.5.1/src/makefile.alsa
|
||||||
|
+++ chuck-1.3.5.1/src/makefile.alsa
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
|
||||||
|
-CFLAGS+= -D__LINUX_ALSA__ -D__PLATFORM_LINUX__ -O3 -fno-strict-aliasing -D__CK_SNDFILE_NATIVE__
|
||||||
|
+CFLAGS+= -D__LINUX_ALSA__ -D__PLATFORM_LINUX__ -fno-strict-aliasing -D__CK_SNDFILE_NATIVE__
|
||||||
|
LDFLAGS+= -lasound -lstdc++ -ldl -lm -lsndfile -lpthread
|
||||||
|
|
||||||
|
--- chuck-1.3.5.1/src/makefile.jack
|
||||||
|
+++ chuck-1.3.5.1/src/makefile.jack
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
|
||||||
|
-CFLAGS+= -D__UNIX_JACK__ -D__PLATFORM_LINUX__ -O3 -fno-strict-aliasing -D__CK_SNDFILE_NATIVE__
|
||||||
|
+CFLAGS+= -D__UNIX_JACK__ -D__PLATFORM_LINUX__ -fno-strict-aliasing -D__CK_SNDFILE_NATIVE__
|
||||||
|
LDFLAGS+= -lasound -ljack -lstdc++ -ldl -lm -lsndfile -lpthread
|
||||||
|
|
23
srcpkgs/chuck/template
Normal file
23
srcpkgs/chuck/template
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Template file for 'chuck'
|
||||||
|
pkgname=chuck
|
||||||
|
version=1.3.5.0
|
||||||
|
revision=1
|
||||||
|
build_wrksrc=src
|
||||||
|
hostmakedepends="bison flex"
|
||||||
|
makedepends="jack-devel libsndfile-devel liblo-devel"
|
||||||
|
short_desc="Concurrent, on-the-fly audio programming language"
|
||||||
|
maintainer="Andrea Brancaleoni <miwaxe@gmail.com>"
|
||||||
|
license="GPL-3"
|
||||||
|
homepage="http://chuck.cs.princeton.edu"
|
||||||
|
distfiles="http://chuck.cs.princeton.edu/release/files/$pkgname-$version.tgz"
|
||||||
|
checksum=658e361ceb2ef263c38432e8182664dfe7bf0473fc4580a392a4326b66a14266
|
||||||
|
|
||||||
|
patch_args="-Np1"
|
||||||
|
|
||||||
|
do_build() {
|
||||||
|
make CXX="$CXX" CC="$CC" LD="$CXX" linux-jack
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install() {
|
||||||
|
vbin chuck
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue