Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Fix pc file for spatialite (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 18, 2020
1 parent 8ce5cb3 commit 8a42953
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions mingw-w64-libspatialite/PKGBUILD
Expand Up @@ -22,19 +22,21 @@ depends=("${MINGW_PACKAGE_PREFIX}-geos"
"${MINGW_PACKAGE_PREFIX}-sqlite3"
"${MINGW_PACKAGE_PREFIX}-libiconv")
options=('strip')
source=("https://www.gaia-gis.it/gaia-sins/${_realname}-${_ver}${_rel//./}.tar.gz"
"01-fix-pkgconfig.patch")
sha256sums=('88900030a4762904a7880273f292e5e8ca6b15b7c6c3fb88ffa9e67ee8a5a499'
'50dace4542a2f378131be76c9dfe45fd78e7cf135f1339df8665b5f26c8ad6cc')
source=("https://www.gaia-gis.it/gaia-sins/${_realname}-${_ver}${_rel//./}.tar.gz")
sha256sums=('88900030a4762904a7880273f292e5e8ca6b15b7c6c3fb88ffa9e67ee8a5a499')

prepare() {
cd "${srcdir}/${_realname}-${_ver}${_rel//./}"
sed -i configure.ac -e "s|mingw32|${MINGW_CHOST}|g"
patch -p1 -i ${srcdir}/01-fix-pkgconfig.patch

# Jeroen: hacks for linking static geos

# Jeroen: workarounds for static proj/geos
PROJLIBS=$(pkg-config --libs-only-l --static proj)
GEOSLIBS="-lgeos_c -lgeos -lstdc++ -lm"
XML2LIBS="$(pkg-config --libs-only-l --static libxml-2.0)"
FREEXLLIBS="$(pkg-config --libs-only-l --static freexl)"
sed -i 's/--ldflags`/--static-clibs`" -lstdc++"/g' configure.ac
sed -i 's/-lgeos_c/-lgeos_c -lgeos -lstdc++ -lm/' configure.ac
sed -i "s/-lgeos_c/${GEOSLIBS}/g" configure.ac
sed -i "s/-lspatialite/-lspatialite ${PROJLIBS} ${GEOSLIBS} ${FREEXLLIBS} ${XML2LIBS}/" spatialite.pc.in
autoreconf
}

Expand All @@ -44,8 +46,8 @@ build() {

# Remove CPPFLAGS for spatialite 5.0 (which should support proj6)
CPPFLAGS+=" -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"
LIBS="-lsqlite3 -lstdc++" \
LIBXML2_LIBS="$(pkg-config --libs-only-l --static libxml-2.0)" \
LIBXML2_LIBS="${XML2LIBS}" \
LIBS="${PROJLIBS}" \
../${_realname}-${_ver}${_rel//./}/configure \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
Expand Down

0 comments on commit 8a42953

Please sign in to comment.