Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new package: lpsolve #1181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions tur-on-device/lpsolve/0001-timeb.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/lp_utils.c b/lp_utils.c
index 418f7c8..fa7480d 100644
--- a/lp_utils.c
+++ b/lp_utils.c
@@ -5,7 +5,9 @@
#include "lp_lib.h"
#include "lp_utils.h"
#include <time.h>
+#ifndef __ANDROID__
#include <sys/timeb.h>
+#endif
#include "lp_bit.h"

#ifdef FORTIFY
diff --git a/shared/commonlib.c b/shared/commonlib.c
index 5ab4f12..137eb3a 100644
--- a/shared/commonlib.c
+++ b/shared/commonlib.c
@@ -5,6 +5,8 @@
# include <time.h>
#elif defined EnhTime
# include <windows.h>
+#elif defined(__ANDROID__)
+#include <sys/time.h>
#else
#include <sys/timeb.h>
#endif
@@ -843,6 +845,12 @@
timeBase = clockNow() - (double) now.QuadPart/(double) freq.QuadPart;
}
return( timeBase + (double) now.QuadPart/(double) freq.QuadPart );
+#elif defined(__ANDROID__)
+ struct timeval tv;
+ struct timezone tz;
+
+ gettimeofday(&tv, &tz);
+ return((double)tv.tv_sec+((double)tv.tv_usec)/1000000.0);
#else
struct timeb buf;

38 changes: 38 additions & 0 deletions tur-on-device/lpsolve/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
TERMUX_PKG_HOMEPAGE=http://lpsolve.sourceforge.net/
TERMUX_PKG_DESCRIPTION="a Mixed Integer Linear Programming (MILP) solver"
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION=5.5.2.11
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/lpsolve/lpsolve/${TERMUX_PKG_VERSION}/lp_solve_${TERMUX_PKG_VERSION}_source.tar.gz
TERMUX_PKG_SHA256=6d4abff5cc6aaa933ae8e6c17a226df0fc0b671c438f69715d41d09fe81f902f
TERMUX_PKG_BUILD_IN_SRC=true

termux_step_pre_configure() {
if [ "${TERMUX_ON_DEVICE_BUILD}" = false ]; then
termux_error_exit "This package doesn't support cross-compiling."
fi
}

termux_step_configure() {
:
}

termux_step_make() {
cd lpsolve55
sh -x ccc
rm bin/ux*/liblpsolve55.a

cd ../lp_solve
sh -x ccc
cd .
}


termux_step_make_install() {
install -dm755 "$TERMUX_PREFIX"/{bin,lib,include/lpsolve}
install -m755 lp_solve/bin/ux*/lp_solve "$TERMUX_PREFIX"/bin/
install -m755 lpsolve55/bin/ux*/liblpsolve55.so "$TERMUX_PREFIX"/lib/
install -m644 lp*.h "$TERMUX_PREFIX"/include/lpsolve/

install -D -m644 README.txt -t "$TERMUX_PREFIX/share/licenses/$TERMUX_PKG_NAME/"
}
Loading
Loading