$OpenBSD: patch-src_build_py,v 1.8 2021/09/04 08:37:51 kirby Exp $
Index: src/build.py
--- src/build.py.orig
+++ src/build.py
@@ -37,9 +37,6 @@ def call(cmd, silent=True):
     elif not silent:
         print (stderr)
 
-def ldconfig(*args,**kwargs):
-    call('ldconfig')
-
 if env['LINKING'] == 'static':
     lib_env.Append(CXXFLAGS="-fPIC")
 
@@ -114,7 +111,7 @@ if env['PLATFORM'] == 'Linux':
     lib_env['LINKFLAGS'].append('-pthread')
 
 if env['RUNTIME_LINK'] != 'static':
-    lib_env['LIBS'].insert(0, 'agg')
+    lib_env['LIBS'].insert(0, 'agg_bundled')
 
 lib_env['LIBS'].append('z')
 
@@ -133,14 +130,14 @@ if env['PLATFORM'] == 'Darwin':
 else: # unix, non-macos
     mapnik_libname = env.subst(env['MAPNIK_LIB_NAME'])
     if env['ENABLE_SONAME']:
-        mapnik_libname = env.subst(env['MAPNIK_LIB_NAME']) + (".%d.%d" % (int(ABI_VERSION[0]),int(ABI_VERSION[1])))
+        mapnik_libname = env.subst(env['MAPNIK_LIB_NAME']) + (".${LIBmapnik_VERSION}")
     if env['PLATFORM'] == 'SunOS':
         if env['CXX'].startswith('CC'):
             mapnik_lib_link_flag += ' -R. -h %s' % mapnik_libname
         else:
             mapnik_lib_link_flag += ' -Wl,-h,%s' %  mapnik_libname
     else: # Linux and others
-        if env['PLATFORM'] != 'FreeBSD':
+        if env['PLATFORM'] != 'OpenBSD':
             lib_env['LIBS'].append('dl')
         mapnik_lib_link_flag += ' -Wl,-rpath-link,.'
         if env['ENABLE_SONAME']:
@@ -450,9 +447,7 @@ else:
             os.remove(trgt)
         os.symlink(os.path.basename(src), trgt)
 
-    major, minor, micro = ABI_VERSION
-
-    soFile = "%s.%d.%d.%d" % (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])), int(major), int(minor), int(micro))
+    soFile = "%s.${LIBmapnik_VERSION}" % (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])))
     target = os.path.join(env['MAPNIK_LIB_BASE_DEST'], soFile)
 
     if 'uninstall' not in COMMAND_LINE_TARGETS:
@@ -462,30 +457,8 @@ else:
             mapnik = lib_env_final.SharedLibrary(env['MAPNIK_NAME'], source)
         result = env.InstallAs(target=target, source=mapnik)
         env.Alias(target='install', source=result)
-        if result:
-              env.AddPostAction(result, ldconfig)
 
-    # Install symlinks
-    target1 = os.path.join(env['MAPNIK_LIB_BASE_DEST'], "%s.%d.%d" % \
-        (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])),int(major), int(minor)))
-    target2 = os.path.join(env['MAPNIK_LIB_BASE_DEST'], os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])))
-    if 'uninstall' not in COMMAND_LINE_TARGETS:
-        link1 = env.Command(target1, target, symlink)
-        env.Alias(target='install', source=link1)
-        link2 = env.Command(target2, target1, symlink)
-        env.Alias(target='install', source=link2)
-    # delete in reverse order..
-    env['create_uninstall_target'](env, target2)
-    env['create_uninstall_target'](env, target1)
     env['create_uninstall_target'](env, target)
 
-    # to enable local testing
-    lib_major_minor = "%s.%d.%d" % (os.path.basename(env.subst(env['MAPNIK_LIB_NAME'])), int(major), int(minor))
-    local_lib = os.path.basename(env.subst(env['MAPNIK_LIB_NAME']))
-    if os.path.islink(lib_major_minor) or os.path.exists(lib_major_minor):
-        os.remove(lib_major_minor)
-    os.symlink(local_lib,lib_major_minor)
-    Clean(mapnik,lib_major_minor);
-
 if not env['RUNTIME_LINK'] == 'static':
-    Depends(mapnik, env.subst('../deps/agg/libagg.a'))
+    Depends(mapnik, env.subst('../deps/agg/libagg_bundled.a'))
