Add geoclue package.

This commit is contained in:
Alexpux
2014-01-23 16:33:07 +04:00
parent fbc157e0a5
commit b132fddfd3
3 changed files with 271 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=geoclue
_mingw_suff=mingw-w64-${CARCH}
pkgname="${_mingw_suff}-${_realname}"
pkgver=0.12.99
pkgrel=1
arch=('any')
pkgdesc="Modular Geoinformation Service (mingw-w64)"
depends=("${_mingw_suff}-glib2" "${_mingw_suff}-gtk2" "${_mingw_suff}-libxml2" "${_mingw_suff}-libxslt" "${_mingw_suff}-dbus-glib")
makedepends=("${_mingw_suff}-gcc" "${_mingw_suff}-pkg-config" "${_mingw_suff}-python2" "gtk-doc" )
optdepends=('libsoup-gnome: Skyhook location provider')
options=('strip' 'staticlibs')
license=("BSD")
url="http://geoclue.freedesktop.org/"
source=(http://freedesktop.org/~hadess/${_realname}-$pkgver.tar.gz
geoclue-0.12.0-win32reloc.patch
geoclue-0.12.99-ldflags.patch
)
md5sums=('779245045bfeeec4853da8baaa3a18e6'
'175021cc9767407260908f315d3c36d3'
'b446a0942aaa88bfbc2e8ec47bb24877')
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
patch -p1 -i ${srcdir}/geoclue-0.12.0-win32reloc.patch
patch -p1 -i ${srcdir}/geoclue-0.12.99-ldflags.patch
autoreconf -f -i
}
build() {
mkdir -p build-${MINGW_CHOST}
cd build-${MINGW_CHOST}
../${_realname}-${pkgver}/configure \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--build=${MINGW_CHOST} \
--prefix=${MINGW_PREFIX} \
--enable-shared \
--disable-static
make
}
package() {
cd "$srcdir/build-${MINGW_CHOST}"
make DESTDIR=$pkgdir install
find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
rm -rf "${pkgdir}${MINGW_PREFIX}"/share/man
#rm -rf "${pkgdir}${MINGW_PREFIX}"/{etc,var,libexec,share}
}

View File

@@ -0,0 +1,66 @@
--- geoclue-0.12.0/src/master.c 2010-02-20 12:21:56.000000000 +0100
+++ geoclue-0.12.0/src/master.c 2010-04-16 15:31:52.000000000 +0200
@@ -40,6 +40,63 @@
#endif
#endif
+#ifdef _WIN32
+# include <shlobj.h>
+# include <mbstring.h>
+
+/* search for data relative to where we are installed */
+
+static HMODULE hmodule;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ hmodule = hinstDLL;
+ break;
+ }
+
+ return TRUE;
+}
+
+static char *
+_get_geoclue_providers_dir (void)
+{
+ static char retval[1000];
+ static int beenhere = 0;
+
+ unsigned char *p;
+
+ if (beenhere)
+ return retval;
+
+ if (!GetModuleFileName (hmodule, (CHAR *) retval, sizeof(retval) - 10))
+ return GEOCLUE_PROVIDERS_DIR;
+
+ p = _mbsrchr ((const unsigned char *) retval, '\\');
+ *p = '\0';
+ p = _mbsrchr ((const unsigned char *) retval, '\\');
+ if (p) {
+ if (stricmp ((const char *) (p+1), "bin") == 0)
+ *p = '\0';
+ }
+ strcat (retval, "\\share\\geoclue-providers");
+
+ beenhere = 1;
+
+ return retval;
+}
+
+#undef GEOCLUE_PROVIDERS_DIR
+#define GEOCLUE_PROVIDERS_DIR _get_geoclue_providers_dir ()
+
+#endif
+
+
enum {
OPTIONS_CHANGED,
LAST_SIGNAL

View File

@@ -0,0 +1,154 @@
--- geoclue-0.12.99/geoclue/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/geoclue/Makefile.am 2012-09-28 09:35:18.798627007 +0200
@@ -49,6 +49,8 @@
libgeoclue_la_LIBADD = \
$(GEOCLUE_LIBS)
+libgeoclue_la_LDFLAGS = -no-undefined
+
libgeoclue_la_CFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
--- geoclue-0.12.99/providers/example/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/example/Makefile.am 2012-09-28 09:35:18.809626738 +0200
@@ -12,6 +12,8 @@
geoclue_example_SOURCES = \
geoclue-example.c
+geoclue_example_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-example.provider
--- geoclue-0.12.99/providers/geonames/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/geonames/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -17,6 +17,8 @@
$(GEOCLUE_LIBS) \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_geonames_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-geonames.provider
--- geoclue-0.12.99/providers/gpsd/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/gpsd/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -14,6 +14,8 @@
geoclue_gpsd_SOURCES = \
geoclue-gpsd.c
+geoclue_gpsd_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-gpsd.provider
--- geoclue-0.12.99/providers/gsmloc/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/gsmloc/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -32,6 +32,8 @@
$(GEOCLUE_LIBS) \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_gsmloc_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-gsmloc.provider
--- geoclue-0.12.99/providers/gypsy/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/gypsy/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -14,6 +14,8 @@
geoclue_gypsy_SOURCES = \
geoclue-gypsy.c
+geoclue_gypsy_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-gypsy.provider
--- geoclue-0.12.99/providers/hostip/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/hostip/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -17,6 +17,8 @@
$(GEOCLUE_LIBS) \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_hostip_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-hostip.provider
--- geoclue-0.12.99/providers/localnet/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/localnet/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -23,6 +23,8 @@
$(top_builddir)/src/libconnectivity.la \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_localnet_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-localnet.provider
--- geoclue-0.12.99/providers/manual/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/manual/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -21,6 +21,8 @@
$(GEOCLUE_LIBS) \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_manual_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-manual.provider
--- geoclue-0.12.99/providers/nominatim/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/nominatim/Makefile.am 2012-09-28 09:35:18.810626713 +0200
@@ -17,6 +17,8 @@
$(GEOCLUE_LIBS) \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_nominatim_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-nominatim.provider
--- geoclue-0.12.99/providers/plazes/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/plazes/Makefile.am 2012-09-28 09:36:25.669977941 +0200
@@ -15,6 +15,8 @@
$(top_builddir)/src/libconnectivity.la \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_plazes_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-plazes.provider
--- geoclue-0.12.99/providers/skyhook/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/skyhook/Makefile.am 2012-09-28 09:35:18.811626688 +0200
@@ -17,6 +17,8 @@
$(top_builddir)/src/libconnectivity.la \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_skyhook_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-skyhook.provider
--- geoclue-0.12.99/providers/yahoo/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/providers/yahoo/Makefile.am 2012-09-28 09:35:18.811626688 +0200
@@ -13,6 +13,8 @@
$(GEOCLUE_LIBS) \
$(top_builddir)/geoclue/libgeoclue.la
+geoclue_yahoo_LDFLAGS = -mwindows
+
providersdir = $(datadir)/geoclue-providers
providers_DATA = geoclue-yahoo.provider
--- geoclue-0.12.99/src/Makefile.am 2012-07-31 18:47:05.000000000 +0200
+++ geoclue-0.12.99/src/Makefile.am 2012-09-28 09:35:18.811626688 +0200
@@ -17,6 +17,8 @@
$(GEOCLUE_LIBS) \
$(MASTER_LIBS)
+geoclue_master_LDFLAGS = -mwindows
+
NOINST_H_FILES = \
main.h \
master.h \