summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoryhfudev2015-06-13 00:42:03 -0400
committeryhfudev2015-06-13 00:42:03 -0400
commit2ba09416929f9e0e4e0e6210abac3b0b4dc4d3b7 (patch)
tree4a87195b7ff4ad8595b0a38b226c42f8c1656da2
downloadaur-2ba09416929f9e0e4e0e6210abac3b0b4dc4d3b7.tar.gz
init
-rw-r--r--.SRCINFO34
-rw-r--r--PKGBUILD93
-rw-r--r--openocd-0.9.0-exit-clean.patch59
-rw-r--r--openocd-git.install22
-rw-r--r--openocd.install22
5 files changed, 230 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..df605118cb38
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = openocd-git
+ pkgdesc = Debugging, in-system programming and boundary-scan testing for embedded target devices (git version)
+ pkgver = 6734.09ca5af
+ pkgrel = 1
+ url = http://openocd.sourceforge.net/
+ install = openocd-git.install
+ arch = i686
+ arch = x86_64
+ arch = arm
+ license = GPL
+ makedepends = git
+ makedepends = automake>=1.11
+ makedepends = autoconf
+ makedepends = libtool
+ makedepends = tcl
+ depends = libftdi
+ depends = libftdi-compat
+ depends = libusb
+ depends = libusb-compat
+ optdepends = libftdi: support devices using this FTDI implementation
+ optdepends = libftd2xx: support devices using this FTDI implementation
+ optdepends = hidapi: support CMSIS-DAP compliant devices
+ provides = openocd
+ conflicts = openocd
+ options = !strip
+ source = openocd::git://git.code.sf.net/p/openocd/code
+ source = openocd-0.9.0-exit-clean.patch
+ md5sums = SKIP
+ md5sums = 72f43470849c08d298a8de6b4598ba3b
+ sha1sums = SKIP
+ sha1sums = 5456bd27e1bdb466a3df12f163efb8b6128429b9
+
+pkgname = openocd-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..878ac33d1745
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,93 @@
+# Maintainer: yhfudev <yhfudev ta gmail dot com>
+# Contributor: veox <veox ta wemakethings dot net>
+# Contributor: Nick Østergaard <oe.nick at gmail dot com>
+# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
+# Contributor: Matthias Bauch <matthias.bauch@gmail.com>
+# Contributor: Laszlo Papp <djszapi2 at gmail com>
+# Contributor: Samuel Tardieu <sam@rfc1149.net>
+
+pkgname=openocd-git
+_gitname=openocd
+pkgver=6734.09ca5af
+pkgrel=1
+pkgdesc="Debugging, in-system programming and boundary-scan testing for embedded target devices (git version)"
+arch=('i686' 'x86_64' 'arm')
+url="http://openocd.sourceforge.net/"
+license=('GPL')
+depends=('libftdi' 'libftdi-compat' 'libusb' 'libusb-compat')
+optdepends=('libftdi: support devices using this FTDI implementation'
+ 'libftd2xx: support devices using this FTDI implementation'
+ 'hidapi: support CMSIS-DAP compliant devices')
+makedepends=('git' 'automake>=1.11' 'autoconf' 'libtool' 'tcl')
+options=(!strip)
+install=openocd-git.install
+provides=('openocd')
+conflicts=('openocd')
+
+source=(
+ "${_gitname}::git://git.code.sf.net/p/openocd/code"
+ "openocd-0.9.0-exit-clean.patch"
+ )
+md5sums=(
+ 'SKIP'
+ '72f43470849c08d298a8de6b4598ba3b'
+ )
+sha1sums=(
+ 'SKIP'
+ '5456bd27e1bdb466a3df12f163efb8b6128429b9'
+ )
+
+# Specify desired features and device support here. A list can be
+# obtained by running ./configure in the source directory.
+_features=(
+ sysfsgpio amtjtagaccel arm-jtag-ew at91rm9200 buspirate ep93xx ftdi gw16012 jlink
+ oocd_trace opendous osbdm parport presto_libftdi remote-bitbang rlink stlink ti-icdi
+ ulink usbprog vsllink
+ arm-jtag-ew dummy
+ )
+
+pkgver_git() {
+ cd "${srcdir}/${pkgname}"
+ local ver="$(git show | grep commit | awk '{print $2}' )"
+ #printf "r%s" "${ver//[[:alpha:]]}"
+ echo ${ver:0:7}
+}
+
+pkgver_svn() {
+ cd "${srcdir}/${pkgname}"
+ #printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ local ver="$(svn info | grep Revision | awk '{print $2}' )"
+ #printf "r%s" "${ver//[[:alpha:]]}"
+ echo ${ver:0:7}
+}
+
+pkgver() {
+ pkgver_git
+}
+
+prepare() {
+ cd "$srcdir/${_gitname}"
+ patch -p1 <$srcdir/openocd-0.9.0-exit-clean.patch
+}
+
+build() {
+ cd "$srcdir/${_gitname}"
+
+ ./bootstrap
+ ./configure --prefix=/usr \
+ --enable-maintainer-mode \
+ --disable-werror \
+ ${_features[@]/#/--enable-} \
+ --enable-legacy-ft2232_libftdi \
+ --enable-usb_blaster_libftdi \
+ $(NULL)
+
+ make
+}
+
+package() {
+ cd "$srcdir/${_gitname}"
+ make DESTDIR=${pkgdir} install
+ #rm -rf ${srcdir}/$_gitname-build
+ #rm -rf $pkgdir/usr/share/info/dir
+}
diff --git a/openocd-0.9.0-exit-clean.patch b/openocd-0.9.0-exit-clean.patch
new file mode 100644
index 000000000000..4babc355a651
--- /dev/null
+++ b/openocd-0.9.0-exit-clean.patch
@@ -0,0 +1,59 @@
+diff --git a/src/helper/command.c b/src/helper/command.c
+index c29f113..d01c35e 100644
+--- a/src/helper/command.c
++++ b/src/helper/command.c
+@@ -118,10 +118,17 @@ static void command_log_capture_finish(struct log_capture_state *state)
+ static int command_retval_set(Jim_Interp *interp, int retval)
+ {
+ int *return_retval = Jim_GetAssocData(interp, "retval");
+- if (return_retval != NULL)
+- *return_retval = retval;
+
+- return (retval == ERROR_OK) ? JIM_OK : JIM_ERR;
++ if (retval == ERROR_COMMAND_CLOSE_CONNECTION)
++ {
++ if (return_retval != NULL)
++ *return_retval = 0;
++ return JIM_EXIT;
++ } else {
++ if (return_retval != NULL)
++ *return_retval = retval;
++ return (retval == ERROR_OK) ? JIM_OK : JIM_ERR;
++ }
+ }
+
+ extern struct command_context *global_cmd_ctx;
+@@ -671,8 +678,7 @@ int command_run_line(struct command_context *context, char *line)
+ }
+ return retval;
+ } else if (retcode == JIM_EXIT) {
+- /* ignore.
+- * exit(Jim_GetExitCode(interp)); */
++ return ERROR_OK_EXIT;
+ } else {
+ const char *result;
+ int reslen;
+diff --git a/src/helper/log.h b/src/helper/log.h
+index 7f9f32c..8a15b41 100644
+--- a/src/helper/log.h
++++ b/src/helper/log.h
+@@ -140,5 +140,6 @@ extern int debug_level;
+ #define ERROR_FAIL (-4)
+ #define ERROR_WAIT (-5)
+
++#define ERROR_OK_EXIT (-6)
+
+ #endif /* LOG_H */
+diff --git a/src/openocd.c b/src/openocd.c
+index b0dd21a..847c137 100644
+--- a/src/openocd.c
++++ b/src/openocd.c
+@@ -283,6 +283,8 @@ static int openocd_thread(int argc, char *argv[], struct command_context *cmd_ct
+ return ERROR_FAIL;
+
+ ret = parse_config_file(cmd_ctx);
++ if (ret == ERROR_OK_EXIT)
++ return ERROR_OK;
+ if (ret != ERROR_OK)
+ return ERROR_FAIL;
+
diff --git a/openocd-git.install b/openocd-git.install
new file mode 100644
index 000000000000..ac561dd8c404
--- /dev/null
+++ b/openocd-git.install
@@ -0,0 +1,22 @@
+infodir=usr/share/info
+filelist=(openocd.info openocd.info-1 openocd.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/openocd.install b/openocd.install
new file mode 100644
index 000000000000..ac561dd8c404
--- /dev/null
+++ b/openocd.install
@@ -0,0 +1,22 @@
+infodir=usr/share/info
+filelist=(openocd.info openocd.info-1 openocd.info-2)
+
+post_install() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ [ -x usr/bin/install-info ] || return 0
+ for file in ${filelist[@]}; do
+ install-info --delete $infodir/$file.gz $infodir/dir 2> /dev/null
+ done
+}
+
+# vim:set ts=2 sw=2 et: