[Slackbuilds-users] osm-gps-map built with introspection

Luiz Carlos Ramos lramos.prof at yahoo.com.br
Sat Oct 12 13:29:01 UTC 2019


Hello,

I installed gramps in my system, following the installation of
osm-gps-map. When gramps started, it complained about not reaching
OsmGpsMap (and GExiv2, which is another subject).

After some research, I found that osm-gps-map was not being built with
introspection enabled. Also, I found a patch which may be crucial to
make it built with introspection googling a little.

The modified version of osm-gps-map could then be recognized by gramps
and made it work.

The same apply to some "examples" shipped with osm-gps-map source code,
that can be accessed in the "examples" subdirectory in the source tree.
One of them in special, mapviewer.py, started to work after this change.

The modifications are in the patch below.

Many thanks,

Luiz Ramos
S??o Paulo - Brazil


From: Luiz Ramos <lramos.prof at yahoo.com.br>
Date: Thu, 10 Oct 2019 21:21:48 -0300
Subject: [PATCH 1/3] gis/osm-gps-map: enabled introspection

The previous version of osm-gps-map was built without introspection, and
this fact had the undesired effect that gramps could not use its
geography features, which depend upon osm-gps-map Python bindings.

Don't know for sure if all these changes are needed, but reenabling
instrospection using the configure option --enable-instrospection=yes
and applying this patch grabbed from the project git repository:

  a8bd491866b3a0afcc2eb684cf69e0ae51e8acea

both were sufficient to build the additional components needed for
gramps work again with osm-gps-map.

-- Luiz Ramos, 10/Oct/2019
---
 ...ct-annotations-and-add-some-missing-comme.patch | 132 +++++++++++++++++++++
 gis/osm-gps-map/osm-gps-map.SlackBuild             |   9 +-
 2 files changed, 140 insertions(+), 1 deletion(-)
 create mode 100644 gis/osm-gps-map/0001-fix-incorrect-annotations-and-add-some-missing-comme.patch

diff --git a/gis/osm-gps-map/0001-fix-incorrect-annotations-and-add-some-missing-comme.patch b/gis/osm-gps-map/0001-fix-incorrect-annotations-and-add-some-missing-comme.patch
new file mode 100644
index 0000000000..ba334a2214
--- /dev/null
+++ b/gis/osm-gps-map/0001-fix-incorrect-annotations-and-add-some-missing-comme.patch
@@ -0,0 +1,132 @@
+From a8bd491866b3a0afcc2eb684cf69e0ae51e8acea Mon Sep 17 00:00:00 2001
+From: Patrick Salecker <mail at salecker.org>
+Date: Fri, 19 Feb 2016 13:35:36 +0100
+Subject: [PATCH] fix incorrect annotations and add some missing comment blocks
+
+---
+ docs/reference/libosmgpsmap-sections.txt |  7 +++++++
+ src/osm-gps-map-polygon.h                |  7 +++++++
+ src/osm-gps-map-track.c                  |  2 ++
+ src/osm-gps-map-track.h                  | 31 +++++++++++++++++++++++++------
+ 4 files changed, 41 insertions(+), 6 deletions(-)
+
+diff --git a/docs/reference/libosmgpsmap-sections.txt b/docs/reference/libosmgpsmap-sections.txt
+index d012769..4a4c36e 100644
+--- a/docs/reference/libosmgpsmap-sections.txt
++++ b/docs/reference/libosmgpsmap-sections.txt
+@@ -112,5 +112,12 @@ OsmGpsMapTrackClass
+ osm_gps_map_track_add_point
+ osm_gps_map_track_get_color
+ osm_gps_map_track_get_points
++osm_gps_map_track_get_length
++osm_gps_map_track_get_point
++osm_gps_map_track_get_type
++osm_gps_map_track_insert_point
++osm_gps_map_track_n_points
++osm_gps_map_track_remove_point
++osm_gps_map_track_set_color
+ osm_gps_map_track_new
+ </SECTION>
+diff --git a/src/osm-gps-map-polygon.h b/src/osm-gps-map-polygon.h
+index 5eb3139..da97f12 100644
+--- a/src/osm-gps-map-polygon.h
++++ b/src/osm-gps-map-polygon.h
+@@ -53,6 +53,13 @@ struct _OsmGpsMapPolygonClass
+ GType osm_gps_map_polygon_get_type (void) G_GNUC_CONST;
+ 
+ OsmGpsMapPolygon*		osm_gps_map_polygon_new           (void);
++
++/**
++ * osm_gps_map_polygon_get_track:
++ * @poly: a #OsmGpsMapPolygon
++ *
++ * Returns: (transfer none): The #OsmGpsMapTrack of the polygon
++ **/
+ OsmGpsMapTrack*			osm_gps_map_polygon_get_track(OsmGpsMapPolygon* poly);
+ 
+ G_END_DECLS
+diff --git a/src/osm-gps-map-track.c b/src/osm-gps-map-track.c
+index 6faac49..ca54b2e 100644
+--- a/src/osm-gps-map-track.c
++++ b/src/osm-gps-map-track.c
+@@ -231,6 +231,8 @@ osm_gps_map_track_class_init (OsmGpsMapTrackClass *klass)
+ 	/**
+ 	 * OsmGpsMapTrack::point-added:
+ 	 * @self: A #OsmGpsMapTrack
++	 * @arg1: A #OsmGpsMapPoint
++	 * @userdata: user data set when the signal handler was connected.
+ 	 *
+ 	 * The point-added signal.
+ 	 */
+diff --git a/src/osm-gps-map-track.h b/src/osm-gps-map-track.h
+index ed01e9e..082d991 100644
+--- a/src/osm-gps-map-track.h
++++ b/src/osm-gps-map-track.h
+@@ -63,15 +63,15 @@ GType osm_gps_map_track_get_type (void) G_GNUC_CONST;
+ OsmGpsMapTrack *    osm_gps_map_track_new           (void);
+ /**
+  * osm_gps_map_track_add_point:
+- * track (in,out): a #OsmGpsMapTrack
+- * @point (in): point to add
++ * @track: (inout): a #OsmGpsMapTrack
++ * @point: (in): point to add
+  *
+  * Since: 0.7.0
+  **/
+ void                osm_gps_map_track_add_point     (OsmGpsMapTrack *track, const OsmGpsMapPoint *point);
+ /**
+  * osm_gps_map_track_get_points:
+- * @track (in): a #OsmGpsMapTrack
++ * @track: (in): a #OsmGpsMapTrack
+  *
+  * Returns: (element-type OsmGpsMapPoint) (transfer full): list of #OsmGpsMapPoint
+  *
+@@ -83,23 +83,42 @@ void                osm_gps_map_track_get_color     (OsmGpsMapTrack *track, GdkR
+ 
+ /**
+  * osm_gps_map_track_remove_point:
+- * @track (in): a #OsmGpsMapTrack
++ * @track: (in): a #OsmGpsMapTrack
+  * @pos: Position of the point to remove
+  *
+  **/
+ void                osm_gps_map_track_remove_point(OsmGpsMapTrack* track, int pos);
+ 
+ /**
++ * osm_gps_map_track_n_points:
++ * @track: a #OsmGpsMapTrack
+  *
++ * Returns: the number of points of the track.
+  **/
+ int                 osm_gps_map_track_n_points(OsmGpsMapTrack* track);
++
++/**
++ * osm_gps_map_track_insert_point:
++ * @track: a #OsmGpsMapTrack
++ * @np: a #OsmGpsMapPoint
++ * @pos: Position for the point
++ *
++ **/
+ void                osm_gps_map_track_insert_point(OsmGpsMapTrack* track, OsmGpsMapPoint* np, int pos);
++
++/**
++ * osm_gps_map_track_get_point:
++ * @track: a #OsmGpsMapTrack
++ * @pos: Position of the point to get
++ *
++ * Returns: a #OsmGpsMapPoint
++ **/
+ OsmGpsMapPoint*     osm_gps_map_track_get_point(OsmGpsMapTrack* track, int pos);
+ 
+ /**
+  * osm_gps_map_track_get_length:
+- * @track (in): a #OsmGpsMapTrack
+- * 
++ * @track: (in): a #OsmGpsMapTrack
++ *
+  * Returns: the length of the track in meters.
+  **/
+ double              osm_gps_map_track_get_length(OsmGpsMapTrack* track);
+-- 
+2.14.5
+
diff --git a/gis/osm-gps-map/osm-gps-map.SlackBuild b/gis/osm-gps-map/osm-gps-map.SlackBuild
index 8868ed1562..8213fde11a 100644
--- a/gis/osm-gps-map/osm-gps-map.SlackBuild
+++ b/gis/osm-gps-map/osm-gps-map.SlackBuild
@@ -3,6 +3,7 @@
 # Slackware build script for osm-gps-map
 
 # Copyright 2015 David Spencer, Baildon, West Yorkshire, U.K.
+# Copyright 2019 Luiz Ramos, Sao Paulo, Brazil
 # All rights reserved.
 #
 # Redistribution and use of this script, with or without modification, is
@@ -22,6 +23,8 @@
 #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+# Modified by Luiz Ramos (included patch for build introspection) 
+
 PRGNAM=osm-gps-map
 VERSION=${VERSION:-1.1.0}
 BUILD=${BUILD:-1}
@@ -69,6 +72,8 @@ find -L . \
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
+patch -p1 -i $CWD/0001-fix-incorrect-annotations-and-add-some-missing-comme.patch
+
 ./autogen.sh
 
 CFLAGS="$SLKCFLAGS" \
@@ -81,11 +86,13 @@ CXXFLAGS="$SLKCFLAGS" \
   --mandir=/usr/man \
   --docdir=/usr/doc/$PRGNAM-$VERSION \
   --disable-static \
-  --enable-introspection=no \
+  --enable-introspection=yes \
   --build=$ARCH-slackware-linux
 
 make
 make install DESTDIR=$PKG
+#install -d $PKG/usr/lib64/girepository-1.0
+#install -m 644 -o root -g root -D $PKG/usr/lib64/girepository-1.0 src/OsmGpsMap-1.0.typelib
 
 find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-- 
2.14.5



More information about the SlackBuilds-users mailing list