FS#71630 - [mapnik] fails to build with scons v4.X

Attached to Project: Community Packages
Opened by n (cholin) - Tuesday, 27 July 2021, 14:51 GMT
Last edited by Evangelos Foutras (foutrelis) - Monday, 22 November 2021, 10:22 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jaroslav Lichtblau (Dragonlord)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

For building mapnik you need scons as build dependency. Recently (2 weeks ago) scons was updated in ArchLinux from v3.1.2 to v4.1.0 (see https://github.com/archlinux/svntogit-packages/commit/ff16b668923695e2ffbf412831474156eff91377#diff-3e341d2d9c67be01819b25b25d5e53ea3cdf3a38d28846cda85a195eb9b7203a ). This update has breaking changes. Hence, mapnik does not build anymore with current PKGBUILD. It seems the issue has as well been reported upstream (see https://github.com/mapnik/mapnik/issues/4213). A workaround for me seems to be to use the existing bundled scons package (v3.0.1 https://github.com/mapnik/mapnik/tree/v3.1.x/scons) in the mapnik source itself (as it is v3.X and not v4.X like in ArchLinux) like the following:

$ diff -u PKGBUILD.old PKGBUILD
--- PKGBUILD.old 2021-07-27 16:45:18.556967067 +0200
+++ PKGBUILD 2021-07-27 16:45:32.060016933 +0200
@@ -17,8 +17,9 @@
sha256sums=('43d76182d2a975212b4ad11524c74e577576c11039fdab5286b828397d8e6261')

build() {
+ scons="python2 ${srcdir}/mapnik-v$pkgver/scons/scons.py"
cd "${srcdir}"/$pkgname-v$pkgver
- scons configure FAST=True \
+ $scons configure FAST=True \
PREFIX="/usr" \
INPUT_PLUGINS=all \
XMLPARSER=libxml2 \
@@ -26,10 +27,11 @@
CUSTOM_CXXFLAGS="$CXXFLAGS" \
CUSTOM_LDFLAGS="$LDFLAGS" \
CUSTOM_DEFINES="-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 -DMAPNIK_USE_PROJ4=1"
- scons $(expr "$MAKEFLAGS" : '.*\(\-j[0-9]\+\)')
+ $scons $(expr "$MAKEFLAGS" : '.*\(\-j[0-9]\+\)')
}

package(){
+ scons="python2 ${srcdir}/mapnik-v$pkgver/scons/scons.py"
cd "${srcdir}"/$pkgname-v$pkgver
- scons install
+ $scons install
}


Additional info:
* package version(s): mapnik 3.1.0-5, scons 4.1.0-2
* link to upstream bug report: https://github.com/mapnik/mapnik/issues/4213


Steps to reproduce: Build mapnik manually

$ wget https://github.com/archlinux/svntogit-community/blob/packages/mapnik/trunk/PKGBUILD
$ makepkg
==> Making package: mapnik 3.1.0-5 (2021-07-27T16:09:12 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found mapnik-v3.1.0.tar.bz2
==> Validating source files with sha256sums...
mapnik-v3.1.0.tar.bz2 ... Passed
==> Extracting sources...
-> Extracting mapnik-v3.1.0.tar.bz2 with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
scons: Reading SConscript files ...
AttributeError: 'SConsEnvironment' object has no attribute 'SourceCode':
File "mapnik-arch/src/mapnik-v3.1.0/SConstruct", line 137:
init_environment(env)
File "mapnik-arch/src/mapnik-v3.1.0/SConstruct", line 129:
env.SourceCode(".", None)
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Monday, 22 November 2021, 10:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed during the icu 70 rebuilds.
Comment by loqs (loqs) - Friday, 20 August 2021, 19:57 GMT
Already fixed upstream in [1] however I think a one line sed fix will also work. See attached diff. This avoids using the bundled scons which requires python2.

[1] https://github.com/mapnik/mapnik/pull/4217

Loading...