"Kirill Bychkov" <ki...@linklevel.net> writes:

> On Thu, September 9, 2021 00:14, Omar Polo wrote:
>>
>> "Kirill Bychkov" <ki...@linklevel.net> writes:
>>
>>> [...]
>>>> - graphics/mapnik
>>>>    breaks because of python2.  Easy to fix, but then fails at
>>>>    linking:
>>>>
>>>> ----------------8<----------------
>>>> ld: error: relocation R_X86_64_PC32 cannot be used against symbol typeinfo
>>>> for
>>>> boost::wrapexcept<boost::bad_function_call>; recompile with -fPIC
>>>>>>> defined in src/expression_grammar.os
>>>>>>> referenced by expression_grammar.cpp
>>>>>>>               src/expression_grammar.os:(void
>>>>>>> boost::throw_exception<boost::bad_function_call>(boost::bad_function_call
>>>>>>> const&))
>>>>
>>>> ld: error: relocation R_X86_64_PC32 cannot be used against symbol vtable
>>>> for
>>>> boost::exception_detail::clone_base; recompile with -fPIC
>>>>>>> defined in src/expression_grammar.os
>>>>>>> referenced by expression_grammar.cpp
>>>>>>>               
>>>>>>> src/expression_grammar.os:(boost::wrapexcept<boost::bad_function_call>::wrapexcept(boost::bad_function_call
>>>>>>> const&))
>>>>
>>>> ...
>>>> ---------------->8----------------
>>>>
>>>>    it shouldn't be hard to fix, I haven't really investigated it
>>>>    because I was working on the other ports
>>>>
>>>>    Attaching wip diff
>>>
>>> Hi,
>>> Adding -fPIC fixes linking:
>>> -WARNING_CXXFLAGS="-I${X11BASE}/include/freetype2" \
>>> +WARNING_CXXFLAGS="-I${X11BASE}/include/freetype2 -fPIC" \
>>
>> Yes, thanks for spotting it!  I went for a slightly different tweak
>> (adding CUSTOM_CXXFLAGS) instead, but that' the trick :)
>>
>>
> This one looks better.
> About
> -from __future__ import print_function # support python2
> Is this removal needed for py3 support?

I dropped because I've seen it, but it builds with that and scons 4, so
I've dropped the removal.

> If so, should we drop ${MODPY_DEFAULT_VERSION_2} from ports Makefile?
> Removing "env.SourceCode(".", None)" does not break scons-2.x as I've
> noticed.

Now that I look closer, there's no need for the lang/python module at
all: it was there since the first import, but I don't know why.  If the
env.SourceCode call doesn't break on scons 2, I guess the following diff
could be committed before the switch to scons 4?

(while there I've also fixed a typo)

Cheers,

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/graphics/mapnik/Makefile,v
retrieving revision 1.39
diff -u -p -r1.39 Makefile
--- Makefile    29 Aug 2021 21:02:05 -0000      1.39
+++ Makefile    12 Sep 2021 17:18:29 -0000
@@ -26,9 +26,7 @@ WANTLIB += intl jpeg m pcre pixman-1 png
 WANTLIB += sqlite3 tiff xcb xcb-render xcb-shm xml2 z ${COMPILER_LIBCXX}
 
 MASTER_SITES = https://github.com/mapnik/mapnik/releases/download/v${V}/
-MODULES =      devel/scons \
-               lang/python
-MODPY_VERSION =        ${MODPY_DEFAULT_VERSION_2}
+MODULES =      devel/scons
 
 # C++14
 COMPILER =     base-clang ports-gcc
@@ -52,6 +50,7 @@ MODSCONS_FLAGS =      PREFIX="${TRUEPREFIX}" 
                        HB_INCLUDES=${LOCALBASE}/include \
                        HB_LIBS=${LOCALBASE}/lib \
                        WARNING_CXXFLAGS="-I${X11BASE}/include/freetype2" \
+                       CUSTOM_CXXFLAGS="-fPIC" \
                        SYSTEM_FONTS=${X11BASE}/lib/X11/fonts/TTF/ \
                        CUSTOM_LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" \
                        FAST=yes \
@@ -63,7 +62,7 @@ pre-configure:
        ${SUBST_CMD} ${WRKSRC}/src/build.py
 
 do-test:
-       # Test data cuold be fetched from github and extracted to test subdir.
+       # Test data could be fetched from github and extracted to test subdir.
        # https://github.com/mapnik/test-data
        # https://github.com/mapnik/test-data-visual
        # warning: some tests may swap your machine to death
Index: patches/patch-SConstruct
===================================================================
RCS file: /home/cvs/ports/graphics/mapnik/patches/patch-SConstruct,v
retrieving revision 1.8
diff -u -p -r1.8 patch-SConstruct
--- patches/patch-SConstruct    23 May 2021 17:47:01 -0000      1.8
+++ patches/patch-SConstruct    12 Sep 2021 17:21:16 -0000
@@ -1,9 +1,20 @@
 $OpenBSD: patch-SConstruct,v 1.8 2021/05/23 17:47:01 kirby Exp $
-2nd chunk is needed for proper boost_thread detection
+
+1st chuck is for scons 4
+3rd chunk is needed for proper boost_thread detection
+
 Index: SConstruct
 --- SConstruct.orig
 +++ SConstruct
-@@ -297,7 +297,7 @@ opts.AddVariables(
+@@ -126,7 +126,6 @@ PLUGINS = { # plugins with external dependencies
+ 
+ def init_environment(env):
+     env.Decider('MD5-timestamp')
+-    env.SourceCode(".", None)
+     if os.environ.get('RANLIB'):
+         env['RANLIB'] = os.environ['RANLIB']
+     if os.environ.get('AR'):
+@@ -297,7 +296,7 @@ opts.AddVariables(
      ('CUSTOM_LDFLAGS', 'Custom linker flags, e.g. -L<lib dir> if you have 
libraries in a nonstandard directory <lib dir>', ''),
      EnumVariable('LINKING', "Set library format for libmapnik",'shared', 
['shared','static']),
      EnumVariable('RUNTIME_LINK', "Set preference for linking 
dependencies",'shared', ['shared','static']),
@@ -12,7 +23,7 @@ Index: SConstruct
      # Note: setting DEBUG=True will override any custom OPTIMIZATION level
      BoolVariable('DEBUG', 'Compile a debug version of Mapnik', 'False'),
      BoolVariable('COVERAGE', 'Compile a libmapnik and plugins with 
--coverage', 'False'),
-@@ -1364,6 +1364,9 @@ if not preconfigured:
+@@ -1364,6 +1363,9 @@ if not preconfigured:
  
      thread_suffix = 'mt'
      if env['PLATFORM'] == 'FreeBSD':

Reply via email to