File: mapnik-4.0.patch

package info (click to toggle)
python-mapnik 1%3A0.0~20240222-5ab32f020-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,364 kB
  • sloc: python: 11,685; cpp: 5,776; sh: 242; makefile: 10
file content (67 lines) | stat: -rw-r--r-- 2,553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Description: Use pkg-config instead of mapnik-config.
Author: Bas Couwenberg <sebastic@debian.org>
Bug-Debian: https://bugs.debian.org/1069130
Forwarded: https://github.com/mapnik/python-mapnik/pull/274

--- a/setup.py
+++ b/setup.py
@@ -91,30 +91,23 @@ os.environ['ARCHFLAGS'] = ''
 if os.environ.get("MASON_BUILD", "false") == "true":
     # run bootstrap.sh to get mason builds
     subprocess.call(['./bootstrap.sh'])
-    mapnik_config = 'mason_packages/.link/bin/mapnik-config'
     mason_build = True
 else:
-    mapnik_config = 'mapnik-config'
     mason_build = False
 
 
 linkflags = []
-lib_path = os.path.join(check_output([mapnik_config, '--prefix']),'lib')
-linkflags.extend(check_output([mapnik_config, '--libs']).split(' '))
-linkflags.extend(check_output([mapnik_config, '--ldflags']).split(' '))
-linkflags.extend(check_output([mapnik_config, '--dep-libs']).split(' '))
-linkflags.extend([
-'-lmapnik-wkt',
-'-lmapnik-json',
-] + ['-l%s' % i for i in get_boost_library_names()])
+lib_path = os.path.join(check_output(['pkg-config', '--variable=prefix', 'libmapnik']),'lib')
+linkflags.extend(check_output(['pkg-config', '--libs', 'libmapnik']).split(' '))
+linkflags.extend(['-l%s' % i for i in get_boost_library_names()])
 
 # Dynamically make the mapnik/paths.py file
 f_paths = open('mapnik/paths.py', 'w')
 f_paths.write('import os\n')
 f_paths.write('\n')
 
-input_plugin_path = check_output([mapnik_config, '--input-plugins'])
-font_path = check_output([mapnik_config, '--fonts'])
+input_plugin_path = check_output(['pkg-config', '--variable=plugins_dir', 'libmapnik'])
+font_path = check_output(['pkg-config', '--variable=fonts_dir', 'libmapnik'])
 
 if mason_build:
     try:
@@ -209,7 +202,7 @@ if mason_build:
         except shutil.Error:
             pass
 
-extra_comp_args = check_output([mapnik_config, '--cflags']).split(' ')
+extra_comp_args = check_output(['pkg-config', '--cflags', 'libmapnik']).split(' ')
 
 extra_comp_args = list(filter(lambda arg: arg != "-fvisibility=hidden", extra_comp_args))
 
@@ -237,9 +230,12 @@ else:
     linkflags.append('-Wl,-rpath=$ORIGIN/lib')
 
 if os.environ.get("CC", False) == False:
-    os.environ["CC"] = check_output([mapnik_config, '--cxx'])
+    os.environ["CC"] = 'c++'
 if os.environ.get("CXX", False) == False:
-    os.environ["CXX"] = check_output([mapnik_config, '--cxx'])
+    os.environ["CXX"] = 'c++'
+
+extra_comp_args = list(filter(lambda arg: arg != "", extra_comp_args))
+linkflags = list(filter(lambda arg: arg != "", linkflags))
 
 setup(
     name="mapnik",