Skip to content

Commit

Permalink
glpk: update to 4.65 (msys2#3655)
Browse files Browse the repository at this point in the history
This updates glpk to 4.65.
  • Loading branch information
Adsun701 authored and Alexpux committed Apr 30, 2018
1 parent 433c495 commit b8f1b85
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
12 changes: 8 additions & 4 deletions mingw-w64-glpk/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_realname=glpk
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=4.61
pkgver=4.65
pkgrel=1
pkgdesc="GNU Linear Programming Kit: solve LP, MIP and other problems (mingw-w64)"
arch=('any')
Expand All @@ -12,20 +12,24 @@ license=('GPL')
depends=("${MINGW_PACKAGE_PREFIX}-gmp")
options=('staticlibs' 'strip')
source=("https://ftp.gnu.org/gnu/glpk/glpk-${pkgver}.tar.gz"
'timeval-64bit.patch')
sha256sums=('9866de41777782d4ce21da11b88573b66bb7858574f89c28be6967ac22dfaba9'
'a3cc547d1b1ddcbf17d9b2047e72dabc06b8b5943230f22bcb21e250a07aaa25')
'timeval-64bit.patch'
'fix-platform-check.patch')
sha256sums=('4281e29b628864dfe48d393a7bedd781e5b475387c20d8b0158f329994721a10'
'2d09d58139fd85d695f5b2933ec750adf0b438a1e9a53dee1b264b80dd2e0f6a'
'9a866c1e14f7a200a46b83c78b9f2d207167633e6ef0c51341008f07ee677d8a')

prepare () {
cd "${srcdir}/glpk-${pkgver}"
patch -p1 -i "${srcdir}/timeval-64bit.patch"
patch -Np1 -i "${srcdir}/fix-platform-check.patch"
sed -i "s|-version-info|-no-undefined -version-info|g" src/Makefile.am
autoreconf -vfi
}

build() {
[[ -d build-${CARCH} ]] && rm -rf build-${CARCH}
mkdir -p build-${CARCH} && cd build-${CARCH}

../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
Expand Down
11 changes: 11 additions & 0 deletions mingw-w64-glpk/fix-platform-check.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- glpk-4.65/src/env/stdc.c.orig 2018-04-29 17:40:03.665385500 -0400
+++ glpk-4.65/src/env/stdc.c 2018-04-29 17:40:08.229017800 -0400
@@ -49,7 +49,7 @@

/* MS Windows version *************************************************/

-#elif defined(__WOE__)
+#elif defined(_WIN32)

#include "stdc.h"

16 changes: 10 additions & 6 deletions mingw-w64-glpk/timeval-64bit.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
diff -Naur glpk-4.55.orig/src/env/time.c glpk-4.55/src/env/time.c
--- glpk-4.55.orig/src/env/time.c 2015-03-27 02:15:07.371110800 +0100
+++ glpk-4.55/src/env/time.c 2015-03-27 17:24:58.926888700 +0100
@@ -54,10 +54,12 @@
diff -Naur glpk-4.65.orig/src/env/time.c glpk-4.65/src/env/time.c
--- glpk-4.65.orig/src/env/time.c 2018-04-29 17:19:55.861485500 -0400
+++ glpk-4.65/src/env/time.c 2018-04-29 17:22:26.023473000 -0400
@@ -55,13 +55,15 @@
double glp_time(void)
{ struct timeval tv;
struct tm *tm;
+ time_t sec;
int j;
double t;
+ sec = tv.tv_sec;
gettimeofday(&tv, NULL);
#if 0 /* 29/I-2017 */
- tm = gmtime(&tv.tv_sec);
+ sec = tv.tv_sec;
+ tm = gmtime(&sec);
#else
- tm = xgmtime(&tv.tv_sec);
+ tm = xgmtime(&sec);
#endif
j = jday(tm->tm_mday, tm->tm_mon + 1, 1900 + tm->tm_year);
xassert(j >= 0);
t = ((((double)(j - EPOCH) * 24.0 + (double)tm->tm_hour) * 60.0 +

0 comments on commit b8f1b85

Please sign in to comment.