diff options
author | Thomas Weißschuh | 2015-07-06 06:01:45 +0000 |
---|---|---|
committer | Thomas Weißschuh | 2015-07-06 06:08:40 +0000 |
commit | 60d8a8bb9874c8f00ae50a40eb6250b326710a60 (patch) | |
tree | f0ebbc3e656fc7bf5e745cacd8df021e0eb4eaae | |
download | aur-60d8a8bb9874c8f00ae50a40eb6250b326710a60.tar.gz |
add temporary stuff
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | 0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch | 95 | ||||
-rw-r--r-- | 0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch | 31 | ||||
-rw-r--r-- | 0003-Remove-unused-err-variable.patch | 34 | ||||
-rw-r--r-- | PKGBUILD | 73 | ||||
-rw-r--r-- | novacomd.service | 8 |
6 files changed, 269 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..4e6970ea4719 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = palm-novacom-git + pkgdesc = WebOS <-> PC connection, open source version + pkgver = 20130426 + pkgrel = 1 + url = http://openwebosproject.org/ + arch = x86_64 + arch = i686 + license = Apache + makedepends = libusb-compat + makedepends = cmake-modules-webos-git + depends = libusb-compat + provides = palm-novacom + conflicts = palm-novacom + source = git+https://github.com/openwebos/novacom + source = git+https://github.com/openwebos/novacomd + source = novacomd.service + source = 0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch + source = 0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch + source = 0003-Remove-unused-err-variable.patch + sha256sums = SKIP + sha256sums = SKIP + sha256sums = 9d4ed1bc1f0a8d091394e0273353384962b8276c0f72f7341138daa87bc6d6e5 + sha256sums = 971f634077384bb53dcd679f59a76a5d98a9f3cc6ef2efd167c65a58003d3890 + sha256sums = cc7eff6b70b7b953b39f4f918718836bdf543e64b77137fadeee3d875434ef21 + sha256sums = 065d8b2976700d2ed6861d8fd9c6cf8b621be13ba16e9dd8c01c0e250b0d4415 + +pkgname = palm-novacom-git + diff --git a/0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch b/0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch new file mode 100644 index 000000000000..26fa5be49dd1 --- /dev/null +++ b/0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch @@ -0,0 +1,95 @@ +From c4586e80dc6f1a92513b466d8d43748ec733b7fd Mon Sep 17 00:00:00 2001 +From: Jonathan Dieter <jdieter@lesbg.com> +Date: Mon, 2 Apr 2012 14:35:09 +0300 +Subject: [PATCH 1/3] Use usb_bulk_[read|write] instead of homemade handlers. + This allows us to run against libusb-compat as well as + the old libusb. + +Signed-off-by: Jonathan Dieter <jdieter@lesbg.com> +--- + src/host/usb-linux.c | 42 ++++++------------------------------------ + 1 file changed, 6 insertions(+), 36 deletions(-) + +diff --git a/src/host/usb-linux.c b/src/host/usb-linux.c +index 55cc0b5..65f94c4 100644 +--- a/src/host/usb-linux.c ++++ b/src/host/usb-linux.c +@@ -49,20 +49,8 @@ + + #define USBDEVFS_IOCTL_TIMEOUT 2000 + +-struct myusb_dev_handle { +- int fd; +- +- // other stuff here +-}; +- + typedef struct { +- union { +- usb_dev_handle *handle; +- +- /* XXX cheezy hack to let us get to the file descriptor hidden in the libusb handle */ +- struct myusb_dev_handle *myhandle; +- }; +- ++ usb_dev_handle *handle; + novacom_usbll_handle_t usbll_handle; + + bool shutdown; +@@ -218,7 +206,7 @@ static novacom_usb_handle_t *novacom_usb_open( void ) + if (!handle) continue; + + #if USB_SCAN_TRACE +- log_printf(LOG_SPEW, "opened usb handle: fd %d\n", ((struct myusb_dev_handle *)handle)->fd); ++ log_printf(LOG_SPEW, "opened usb handle: devnum %d\n", dev->devnum); + #endif + + int eps[2]; +@@ -281,17 +269,10 @@ int novacom_usb_transport_init(void) + static int novacom_usb_read(novacom_usb_handle_t *handle, void *buf, size_t len) + { + // TRACEF("handle %p, buf %p, len %d, timeout %d\n", handle, buf, len, timeout); +-// TRACEF("fd %d\n", handle->myhandle->fd); +- +- struct usbdevfs_bulktransfer bulktransfer; +- +- bulktransfer.ep = handle->rxep; +- bulktransfer.len = len; +- bulktransfer.timeout = handle->rx_timeout; +- bulktransfer.data = buf; + + int rc; +- rc = ioctl(handle->myhandle->fd, USBDEVFS_BULK, &bulktransfer); ++ ++ rc = usb_bulk_read(handle->handle, handle->rxep, buf, len, handle->rx_timeout); + if (rc > 0) { //now check the packet header + + if (novacom_usbll_check_packet_header(buf, rc)) { //bad packet +@@ -303,22 +284,11 @@ static int novacom_usb_read(novacom_usb_handle_t *handle, void *buf, size_t len) + return rc; + } + +-static int novacom_usb_write(novacom_usb_handle_t *handle, const void *buf, size_t len) ++static int novacom_usb_write(novacom_usb_handle_t *handle, void *buf, size_t len) + { + // TRACEF("handle %p, buf %p, len %d, timeout %d\n", handle, buf, len, timeout); +-// TRACEF("fd %d\n", handle->myhandle->fd); +- +- struct usbdevfs_bulktransfer bulktransfer; + +- bulktransfer.ep = handle->txep; +- bulktransfer.len = len; +- bulktransfer.timeout = handle->tx_timeout; +- bulktransfer.data = (void *)buf; +- +- int rc; +- rc = ioctl(handle->myhandle->fd, USBDEVFS_BULK, &bulktransfer); +-// TRACEF("rc %d\n", rc); +- return rc; ++ return usb_bulk_write(handle->handle, handle->txep, buf, len, handle->tx_timeout); + } + + struct usb_thread_args { +-- +1.7.10 + diff --git a/0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch b/0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch new file mode 100644 index 000000000000..f743188fe598 --- /dev/null +++ b/0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch @@ -0,0 +1,31 @@ +From b5ef521cbd9f49add783d0855c27c23a674be045 Mon Sep 17 00:00:00 2001 +From: Jonathan Dieter <jdieter@lesbg.com> +Date: Mon, 2 Apr 2012 15:01:01 +0300 +Subject: [PATCH 2/3] Fix makefile so it respects environmental CFLAGS + +Signed-off-by: Jonathan Dieter <jdieter@lesbg.com> +--- + makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/makefile b/makefile +index 4b95bd7..5f87cef 100644 +--- a/makefile ++++ b/makefile +@@ -34,11 +34,12 @@ endif + + # compiler flags, default libs to link against + MYCFLAGS := -Wall -W -Wno-multichar -Wno-unused-parameter -Wno-unused-function -g -O2 -Iinclude -DBUILDVERSION=$(BUILDVERSION) ++CFLAGS := + # pull in the machine build name version from OE if it's set + ifneq ($(MACHINE),) + MYCFLAGS += -DMACHINE=\"$(MACHINE)\" + endif +-HOSTCFLAGS := $(MYCFLAGS) -Isrc ++HOSTCFLAGS := $(MYCFLAGS) $(CFLAGS) -Isrc + DEVICECFLAGS := $(MYCFLAGS) $(OECFLAGS) $(TARGET_CC_ARCH) -DPLATFORM_PTHREADS=1 + CPPFLAGS := -g + ASMFLAGS := +-- +1.7.10 + diff --git a/0003-Remove-unused-err-variable.patch b/0003-Remove-unused-err-variable.patch new file mode 100644 index 000000000000..22566ada1be6 --- /dev/null +++ b/0003-Remove-unused-err-variable.patch @@ -0,0 +1,34 @@ +From 3bea091f0aa28a337438842ee3a7b492570d127e Mon Sep 17 00:00:00 2001 +From: Jonathan Dieter <jdieter@lesbg.com> +Date: Mon, 2 Apr 2012 15:04:18 +0300 +Subject: [PATCH 3/3] Remove unused 'err' variable + +Signed-off-by: Jonathan Dieter <jdieter@lesbg.com> +--- + src/main.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/main.c b/src/main.c +index 28874aa..28f636e 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -733,7 +733,6 @@ static int main_loop(void) + struct active_device *temp_dev; + /* device */ + if (FD_ISSET(dev->socket, &fds) ) { +- int err; + SOCKET newsocket = accept_socket(dev->socket); + TRACEL(LOG_TRACE, "data socket %d\n", newsocket); + +@@ -741,7 +740,7 @@ static int main_loop(void) + + // Set non-blocking or novacomd will drop offline if the socket fills up + fcntl(newsocket, F_SETFL, fcntl(newsocket, F_GETFL) | O_NONBLOCK); +- err = novacom_register_client(dev, newsocket); ++ novacom_register_client(dev, newsocket); + } + } + +-- +1.7.10 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..8d0d8abb4083 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,73 @@ +# Maintainer: Thomas Weißschuh <thomas t-8ch de> +# Contributor: Carl George <cwgtex gmail.com> + +pkgname=palm-novacom-git +pkgver=20130426 +pkgrel=1 +pkgdesc="WebOS <-> PC connection, open source version" +arch=('x86_64' 'i686') +url="http://openwebosproject.org/" +license=('Apache') +depends=('libusb-compat') +makedepends=('libusb-compat' 'cmake-modules-webos-git') +provides=('palm-novacom') +conflicts=('palm-novacom') +source=( + 'git+https://github.com/openwebos/novacom' + 'git+https://github.com/openwebos/novacomd' + 'novacomd.service' + '0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch' + '0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch' + '0003-Remove-unused-err-variable.patch') + +build() { + cd "$srcdir" + + msg "Building Client" + + rm -rf client-build + mkdir client-build + cd client-build + + cmake ../novacom + make + + msg "Building Server" + + cd "$srcdir" + cd novacomd + + patch -Np1 -i "${srcdir}/0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch" +# patch -Np1 -i "${srcdir}/0002-Fix-makefile-so-it-respects-environmental-CFLAGS.patch" +# patch -Np1 -i "${srcdir}/0003-Remove-unused-err-variable.patch" + + cd "$srcdir" + rm -rf server-build + mkdir server-build + cd server-build + + cmake -DWEBOS_TARGET_MACHINE_IMPL=host -D WEBOS_INSTALL_ROOT=$pkgdir ../novacomd + + make + +} + +package() { + cd "$srcdir" + install -D -m755 novacomd.service $pkgdir/usr/lib/systemd/system/novacomd.service + + install -D -m755 "$srcdir/novacom/scripts/novaterm" "$pkgdir/usr/bin/novaterm" + install -D -m755 "$srcdir/client-build/novacom" "$pkgdir/usr/bin/novacom" + install -D -m755 "$srcdir/server-build/novacomd" "$pkgdir/usr/bin/novacomd" +} + +pkgver() { + date '+%Y%m%d' +} + +sha256sums=('SKIP' + 'SKIP' + '9d4ed1bc1f0a8d091394e0273353384962b8276c0f72f7341138daa87bc6d6e5' + '971f634077384bb53dcd679f59a76a5d98a9f3cc6ef2efd167c65a58003d3890' + 'cc7eff6b70b7b953b39f4f918718836bdf543e64b77137fadeee3d875434ef21' + '065d8b2976700d2ed6861d8fd9c6cf8b621be13ba16e9dd8c01c0e250b0d4415') diff --git a/novacomd.service b/novacomd.service new file mode 100644 index 000000000000..de0201c87eca --- /dev/null +++ b/novacomd.service @@ -0,0 +1,8 @@ +[Unit] +Description=Novacom WebOS daemon + +[Service] +ExecStart=/usr/bin/novacomd + +[Install] +WantedBy=multi-user.target |