Skip to content

Commit

Permalink
jq: Fix building.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpux committed Feb 29, 2016
1 parent 34e37be commit b5566c5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
20 changes: 16 additions & 4 deletions mingw-w64-jq/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Maintainer: Gore Liu <[email protected]>

_realname=jq
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.5
pkgrel=1
Expand All @@ -9,12 +10,23 @@ arch=('any')
url='https://stedolan.github.io/jq/'
license=('MIT')
makedepends=("autoconf" "automake" "bison" "flex" "python2")
source=("https://github.com/stedolan/${_realname}/releases/download/${_realname}-1.5/${_realname}-${pkgver}.tar.gz")
sha256sums=('c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c')
source=("https://github.com/stedolan/${_realname}/releases/download/${_realname}-${pkgver}/${_realname}-${pkgver}.tar.gz"
no-undefined.patch
missing-library.patch)
sha256sums=('c4d2bfec6436341113419debf479d833692cc5cdab7eb0326b5a4d4fbe9f493c'
'e4b6f5eb5bfeda43564bcede307eac36cf26dbd3437eef45b51b2db617a525b5'
'cbc4365d5ea514a318568582693e1883249473c64b79609007fe3c565b2b81ed')

prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
patch -p1 -i ${srcdir}/no-undefined.patch
patch -p1 -i ${srcdir}/missing-library.patch

autoreconf -fiv
}

build() {
cd "$srcdir"/${_realname}-${pkgver}
[ -d "${srcdir}"/build-${CARCH} ] && rm -rf "${srcdir}"/build-${CARCH}
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
../${_realname}-${pkgver}/configure \
--prefix=${MINGW_PREFIX} \
Expand Down
17 changes: 17 additions & 0 deletions mingw-w64-jq/missing-library.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--- jq-1.5/configure.ac.orig 2016-02-29 11:11:42.012406600 +0300
+++ jq-1.5/configure.ac 2016-02-29 11:15:59.950033700 +0300
@@ -214,6 +214,14 @@

AC_SUBST([BUNDLER], ["$bundle_cmd"])

+case "$host" in
+ *mingw*)
+ LIBS="$LIBS -lshlwapi"
+ ;;
+ *)
+ ;;
+esac
+
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
11 changes: 11 additions & 0 deletions mingw-w64-jq/no-undefined.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- jq-1.5/Makefile.am.orig 2016-02-29 11:00:10.368042000 +0300
+++ jq-1.5/Makefile.am 2016-02-29 11:00:19.805042000 +0300
@@ -43,7 +43,7 @@
lib_LTLIBRARIES = libjq.la
libjq_la_SOURCES = ${LIBJQ_SRC}
libjq_la_LIBADD = -lm
-libjq_la_LDFLAGS = -export-symbols-regex '^j[qv]_' -version-info 1:4:0
+libjq_la_LDFLAGS = -export-symbols-regex '^j[qv]_' -version-info 1:4:0 -no-undefined

include_HEADERS = jv.h jq.h

0 comments on commit b5566c5

Please sign in to comment.