axel: Add package
authorHax4us <30441647+Hax4us@users.noreply.github.com>
Sun, 18 Mar 2018 20:58:25 +0000 (02:28 +0530)
committerFredrik Fornwall <fredrik@fornwall.net>
Sun, 18 Mar 2018 20:58:25 +0000 (21:58 +0100)
packages/axel/axel.c.patch [new file with mode: 0644]
packages/axel/build.sh [new file with mode: 0755]
packages/axel/search.c.patch [new file with mode: 0644]

diff --git a/packages/axel/axel.c.patch b/packages/axel/axel.c.patch
new file mode 100644 (file)
index 0000000..decb0d7
--- /dev/null
@@ -0,0 +1,32 @@
+--- axel-2.16.1/src/axel.c     2017-12-05 10:46:05.000000000 +0530
++++ axel.c     2018-03-14 19:29:42.000000000 +0530
+@@ -617,7 +617,7 @@
+                       } else {
+                               if (gettime() > (axel->conn[i].last_transfer +
+                                                axel->conf->reconnect_delay)) {
+-                                      pthread_cancel(*axel->conn[i].setup_thread);
++                                      pthread_kill(*axel->conn[i].setup_thread, 0);
+                                       axel->conn[i].state = false;
+                                       pthread_join(*axel->conn[i].
+                                                    setup_thread, NULL);
+@@ -687,7 +687,7 @@
+       for (int i = 0; i < axel->conf->num_connections; i++) {
+               /* don't try to kill non existing thread */
+               if (*axel->conn[i].setup_thread != 0) {
+-                      pthread_cancel(*axel->conn[i].setup_thread);
++                      pthread_kill(*axel->conn[i].setup_thread, 0);
+                       pthread_join(*axel->conn[i].setup_thread, NULL);
+               }
+               conn_disconnect(&axel->conn[i]);
+@@ -770,9 +770,11 @@
+       int oldstate;
+       /* Allow this thread to be killed at any time. */
++#ifndef __ANDROID__
+       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);
+       pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
++#endif
+       pthread_mutex_lock(&conn->lock);
+       if (conn_setup(conn)) {
+               conn->last_transfer = gettime();
diff --git a/packages/axel/build.sh b/packages/axel/build.sh
new file mode 100755 (executable)
index 0000000..a570294
--- /dev/null
@@ -0,0 +1,9 @@
+TERMUX_PKG_HOMEPAGE=https://github.com/axel-download-accelerator/axel
+TERMUX_PKG_DESCRIPTION="light command line download acceleratorr"
+TERMUX_PKG_VERSION=2.16.1
+TERMUX_PKG_MAINTAINER="lokesh @hax4us"
+TERMUX_PKG_DEPENDS="openssl"
+TERMUX_PKG_BUILD_DEPENDS="pkg-config, gettext"
+TERMUX_PKG_SHA256=675a8608ffa305b98624a3c2684c84e4696572e3fd7dce6d12e0a9b61d64b67f
+TERMUX_PKG_SRCURL=https://github.com/axel-download-accelerator/axel/releases/download/v${TERMUX_PKG_VERSION}/axel-${TERMUX_PKG_VERSION}.tar.gz
+TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" --disable-nls"
diff --git a/packages/axel/search.c.patch b/packages/axel/search.c.patch
new file mode 100644 (file)
index 0000000..2e94e01
--- /dev/null
@@ -0,0 +1,23 @@
+--- axel-2.16.1/src/search.c   2017-12-05 10:46:05.000000000 +0530
++++ search.c   2018-03-14 19:30:01.000000000 +0530
+@@ -211,7 +211,7 @@
+                               if (gettime() < results[i].speed_start_time
+                                   + results->conf->search_timeout)
+                                       continue; // not timed out yet
+-                              pthread_cancel(*results[i].speed_thread);
++                              pthread_kill(*results[i].speed_thread, 0);
+                               break; // do the bookkeeping
+                       case SPEED_FAILED:
+                               break; // do the bookkeeping
+@@ -262,9 +262,11 @@
+       int oldstate;
+       /* Allow this thread to be killed at any time. */
++#ifndef __ANDROID__
+       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);
+       pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
++#endif
+       memset(conn, 0, sizeof(conn_t));
+       conn->conf = results->conf;
+       if (conn_set(conn, results->url)