Bug 214819 - converters/osm2pgsql: ERROR: error: calling a protected constructor
Summary: converters/osm2pgsql: ERROR: error: calling a protected constructor
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-25 10:14 UTC by O. Hartmann
Modified: 2017-02-09 10:24 UTC (History)
1 user (show)

See Also:
ohartmann: maintainer-feedback+


Attachments
New port for legacy geos-3.5 (22.80 KB, text/plain)
2016-11-25 14:29 UTC, Dmitry Marakasov
no flags Details
Osm2pgsql update to latest version, use geos35 (4.30 KB, patch)
2016-11-25 14:30 UTC, Dmitry Marakasov
no flags Details | Diff
patch to osm2pgsql to make it compile with geos-3.6.0 (14.74 KB, patch)
2016-11-25 16:36 UTC, Martin Birgmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2016-11-25 10:14:37 UTC
Upgrade osm2pgsql-0.87.2_1 to osm2pgsql-0.87.2_2 on 12-CURRENT fails due to the error shown below:

[...]
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I/usr/include -I/usr/local/include -I/usr/local/include -DOSM2PGSQL_DATADIR=\"/usr/local/share/osm2pgsql\" -Igeos-fallback -I/usr/local/include/lua52 -pthread -I/usr/local/include -I/usr/local/include -O2 -pipe -O3 -fstack-protector -fno-strict-aliasing -MT id-tracker.lo -MD -MP -MF .deps/id-tracker.Tpo -c id-tracker.cpp  -fPIC -DPIC -o .libs/id-tracker.o
geometry-builder.cpp:97:21: error: calling a protected constructor of class 'geos::geom::GeometryFactory'
    GeometryFactory gf;
                    ^
/usr/local/include/geos/geom/GeometryFactory.h:420:2: note: declared protected here
        GeometryFactory();
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2016-11-25 14:23:34 UTC
Ooh, nice - now I have a tester for this port :)
I'm aware of the failure, it's caused by geos update. I have legavy geos 3.5 port ready as well as osm2pgsql update to latest 0.90.1. Could you please test these?
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2016-11-25 14:29:56 UTC
Created attachment 177386 [details]
New port for legacy geos-3.5
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2016-11-25 14:30:35 UTC
Created attachment 177387 [details]
Osm2pgsql update to latest version, use geos35
Comment 4 Martin Birgmeier 2016-11-25 16:36:51 UTC
Created attachment 177390 [details]
patch to osm2pgsql to make it compile with geos-3.6.0

I have created a patch which makes osm2pgsql compile with geos-3.6.0, however currently do not have the possibility to test the resulting executable (except for running "osm2pgsql -h", which works).

So whoever can test it give it a try, and if it works we maybe do not need to fall back to geos-3.5.0.

-- Martin
Comment 5 O. Hartmann 2016-11-25 17:03:37 UTC
The patch designated " patch to osm2pgsql to make it compile with geos-3.6.0 " solved the problems I reported. The port compiles. I haven't had the chance to test its proper functionality. That for the first.

Second, I tried version 0.90.1 with graphics/geos (3.6). It fails with:

===>  Performing out-of-source build
/bin/mkdir -p /usr/ports/converters/osm2pgsql/work/.build
-- Building osm2pgsql 0.90.1-dev
CMake Warning at cmake/FindOsmium.cmake:163 (message):
  Osmium: GEOS library is required but not found, please install it or
  configure the paths.
Call Stack (most recent call first):
  CMakeLists.txt:98 (find_package)


CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Osmium (missing: GEOS_INCLUDE_DIR GEOS_LIBRARY)
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindOsmium.cmake:262 (find_package_handle_standard_args)
  CMakeLists.txt:98 (find_package)


-- Configuring incomplete, errors occurred!
See also "/usr/ports/converters/osm2pgsql/work/.build/CMakeFiles/CMakeOutput.log".
See also "/usr/ports/converters/osm2pgsql/work/.build/CMakeFiles/CMakeError.log".
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/converters/osm2pgsql
*** Error code 1

Stop.
make: stopped in /usr/ports/converters/osm2pgsql
Comment 6 Dmitry Marakasov freebsd_committer freebsd_triage 2016-11-28 14:18:10 UTC
(In reply to Martin Birgmeier from comment #4)
> Created attachment 177390 [details]
> patch to osm2pgsql to make it compile with geos-3.6.0
> 
> I have created a patch which makes osm2pgsql compile with geos-3.6.0,
> however currently do not have the possibility to test the resulting
> executable (except for running "osm2pgsql -h", which works).

I'd like to discuss this to upstream before commiting. Here's an issue:

https://github.com/openstreetmap/osm2pgsql/issues/649
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-02-07 13:16:34 UTC
A commit references this bug:

Author: amdmi3
Date: Tue Feb  7 13:16:18 UTC 2017
New revision: 433549
URL: https://svnweb.freebsd.org/changeset/ports/433549

Log:
  - Update to 0.92.0 and unbreak by switching geos dependency to graphics/geos35

  PR:		214819, 216338

Changes:
  head/converters/osm2pgsql/Makefile
  head/converters/osm2pgsql/distinfo
  head/converters/osm2pgsql/files/
  head/converters/osm2pgsql/files/patch-CMakeLists.txt
  head/converters/osm2pgsql/files/patch-cmake_FindOsmium.cmake
Comment 8 Dmitry Marakasov freebsd_committer freebsd_triage 2017-02-07 13:17:10 UTC
Should be fixed now, please test.