Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] help needed writing python/boost ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Wed Jan 18, 2017 1:04 pm    Post subject: [solved] help needed writing python/boost ebuild Reply with quote

Please help me write an ebuild for sci-geosciences/python-mapnik. I can never get around doing it properly for python based stuff as they way differrent than regular ebuilds.

This packages installs python bindings for mapnik (in portage). Looking at redme https://github.com/mapnik/python-mapnik/blob/master/README.md it should be fairly easy to install however in the process one has to point to the BOOST_PYTHON_LIB like this
BOOST_PYTHON_LIB=boost_python-3.4 ./setup.py build
BOOST_PYTHON_LIB=boost_python-3.4 ./setup.py install

This is what I got so far for live ebuild as packages has not seen any release, but it would not work
EDIT:
Code:
deleted completely not working code


Any ideas to fix it are welcome :)
_________________
Sky is not the limit...


Last edited by ryszardzonk on Sat Jan 21, 2017 10:07 pm; edited 3 times in total
Back to top
View user's profile Send private message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Fri Jan 20, 2017 10:31 am    Post subject: Reply with quote

I got a bit closer to completing the task, but still have problem setting proper python boost version to the environment. All I need is to have variable say "2.7" while the closest I got looking at the different classes is ${EPYTHON} variable, but it provides name with the version like "python2.7" Any ideas how to fix that?

Code:
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6
PYTHON_COMPAT=( python2_7 python3_{4,5} )

inherit  distutils-r1 git-r3 python-utils-r1

DESCRIPTION="Python bindings for the mapnik"
HOMEPAGE="https://github.com/mapnik/python-mapnik"
EGIT_REPO_URI="https://github.com/mapnik/python-mapnik"
EGIT_SUBMODULES=( '*' '-test-*' )
EGIT_COMMIT="ea5fd11"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE=""
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="
        dev-libs/boost:=[python,${PYTHON_USEDEP}]
        sci-geosciences/mapnik
        ${PYTHON_DEPS}
"
DEPEND="${RDEPEND}"

DOCS=( AUTHORS.md CHANGELOG.md CONTRIBUTING.md README.md )
PATCHES=( "${FILESDIR}/flags_fix.patch" )

python_compile() {
        distutils-r1_python_compile BOOST_PYTHON_LIB=boost_python-${EPYTHON}
}

python_install() {
        distutils-r1_python_install BOOST_PYTHON_LIB=boost_python-${EPYTHON}
}

pkg_postinst() {
        python_mod_optimize ${PN}
}

pkg_postrm() {
        python_mod_cleanup ${PN}
}

_________________
Sky is not the limit...
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 402
Location: France

PostPosted: Fri Jan 20, 2017 1:15 pm    Post subject: Reply with quote

Hello
https://wiki.gentoo.org/wiki/Project:Python/Implementations
Looking here, looks like what you need is USE_PYTHON

++
Gi)
Back to top
View user's profile Send private message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Fri Jan 20, 2017 2:30 pm    Post subject: Reply with quote

I was actually looking at that page at least twice today and failed to notice that column ;) Thanks.

Code:
python_compile() {
        BOOST_PYTHON_LIB=boost_python-${USE_PYTHON} distutils-r1_python_compile
}

It sure did get me further, but for some reason that option did not pass to the linker. See the missing version number in "cannot find -lboost_python-"
Maybe it should be specified elsewhere than "python_compile" or some other inherit is required?

Code:
>>> Emerging (1 of 1) sci-geosciences/python-mapnik-0.1.9999::bigvo
>>> Unpacking source...
 * Fetching https://github.com/mapnik/python-mapnik ...
git fetch https://github.com/mapnik/python-mapnik +HEAD:refs/git-r3/HEAD
remote: Counting objects: 14, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 14 (delta 9), reused 9 (delta 9), pack-reused 3
Unpacking objects: 100% (14/14), done.
From https://github.com/mapnik/python-mapnik
   8ded0f76e..947db1b36             -> refs/git-r3/HEAD
git update-ref --no-deref refs/git-r3/sci-geosciences/python-mapnik/0/__main__ ea5fd11
 * Fetching https://github.com/mapnik/test-data-visual.git ...
git fetch https://github.com/mapnik/test-data-visual.git --prune +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/* +refs/notes/*:refs/notes/* +HEAD:refs/git-r3/HEAD
git update-ref --no-deref refs/git-r3/sci-geosciences/python-mapnik/0/test/data-visual/__main__ 941db3d00920dc7aceaa6797096a7228bc7bac14
 * Fetching https://github.com/mapnik/test-data.git ...
git fetch https://github.com/mapnik/test-data.git --prune +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/* +refs/notes/*:refs/notes/* +HEAD:refs/git-r3/HEAD
git update-ref --no-deref refs/git-r3/sci-geosciences/python-mapnik/0/test/data/__main__ 6ce59adfc4f11b16a5dc0e2020c36dc614850989
 * Checking out https://github.com/mapnik/python-mapnik to /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999 ...
git checkout --quiet ea5fd113504bd789fdd450ba5abf0474bd841106
GIT update -->
   repository:               https://github.com/mapnik/python-mapnik
   at the commit:            ea5fd113504bd789fdd450ba5abf0474bd841106
 * Checking out https://github.com/mapnik/test-data-visual.git to /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999/test/data-visual ...
git checkout --quiet 941db3d00920dc7aceaa6797096a7228bc7bac14
GIT update -->
   repository:               https://github.com/mapnik/test-data-visual.git
   at the commit:            941db3d00920dc7aceaa6797096a7228bc7bac14
 * Checking out https://github.com/mapnik/test-data.git to /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999/test/data ...
git checkout --quiet 6ce59adfc4f11b16a5dc0e2020c36dc614850989
GIT update -->
   repository:               https://github.com/mapnik/test-data.git
   at the commit:            6ce59adfc4f11b16a5dc0e2020c36dc614850989
>>> Source unpacked in /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work
>>> Preparing source in /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999 ...
 * Applying flags_fix.patch ...                                                                                                                                                                         [ ok ]
>>> Source prepared.
>>> Configuring source in /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999 ...
>>> Source configured.
>>> Compiling source in /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999 ...
 * python2_7: running distutils-r1_run_phase python_compile
/usr/bin/python2.7 setup.py build
running build
running build_py
creating /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/lib/mapnik
copying mapnik/paths.py -> /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/lib/mapnik
copying mapnik/mapnik_settings.py -> /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/lib/mapnik
copying mapnik/__init__.py -> /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/lib/mapnik
warning: build_py: byte-compiling is disabled, skipping.

running build_ext
building 'mapnik._mapnik' extension
creating /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7
creating /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src
x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fgcse-sm -fgcse-las -fgcse-after-reload -ftree-vectorize -fabi-version=0 -fPIC -I/usr/include/python2.7 -c src/mapnik_color.cpp -o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_color.o -I/usr/include -I/usr/include/mapnik/agg -I/usr/include/mapnik -I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2 -I/usr/include/gdal -I/usr/include/postgresql-9.6 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/libpng16 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ4 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DLINUX -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -std=c++11 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -march=native -pipe -O3 -ftree-vectorize -findirect-inlining

...[snap]...

x86_64-pc-linux-gnu-g++ -shared -Wl,-O1 -Wl,--hash-style=both -Wl,--as-needed -Wl,--relax -Wl,--sort-common -march=native -O2 -pipe -fgcse-sm -fgcse-las -fgcse-after-reload -ftree-vectorize -fabi-version=0 /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_color.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_coord.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_datasource.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_datasource_cache.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_envelope.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_expression.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_feature.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_featureset.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_font_engine.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_fontset.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_gamma_method.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_geometry.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_grid.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_grid_view.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_image.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_image_view.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_label_collision_detector.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_layer.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_logger.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_map.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_palette.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_parameters.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_proj_transform.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_projection.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_python.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_query.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_raster_colorizer.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_rule.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_scaling_method.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_style.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_svg_generator_grammar.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_symbolizer.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_text_placement.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/mapnik_view_transform.o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/temp.linux-x86_64-2.7/src/python_grid_utils.o -L/usr/lib64 -lpython2.7 -o /tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999-python2_7/lib/mapnik/_mapnik.so -L/usr/lib -lmapnik -L/usr/lib -L/usr/lib64 -L/usr/lib64/postgresql-9.6/lib64 -Wl,-O1 -Wl,--hash-style=both -Wl,--as-needed -Wl,--relax -Wl,--sort-common -pthread -lboost_filesystem -lboost_regex -lcairo -lpng -lproj -ltiff -lwebp -lxml2 -licui18n -lboost_system -lharfbuzz -ljpeg -licuuc -lfreetype -lz -ldl -lmapnik-wkt -lmapnik-json -lboost_python- -lboost_thread -lboost_system -lrt -Wl,-z,origin -Wl,-rpath=$ORIGIN/lib
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lboost_python-
collect2: error: ld returned 1 exit status
error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1
 * ERROR: sci-geosciences/python-mapnik-0.1.9999::bigvo failed (compile phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line  115:  Called src_compile
 *   environment, line 4294:  Called distutils-r1_src_compile
 *   environment, line 1161:  Called _distutils-r1_run_foreach_impl 'python_compile'
 *   environment, line  341:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3829:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 2922:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 2920:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_compile'
 *   environment, line  830:  Called distutils-r1_run_phase 'python_compile'
 *   environment, line 1154:  Called python_compile
 *   environment, line 3417:  Called distutils-r1_python_compile
 *   environment, line 1029:  Called esetup.py 'build'
 *   environment, line 1720:  Called die
 * The specific snippet of code:
 *       "${@}" || die "${die_args[@]}";
 *
 * If you need support, post the output of `emerge --info '=sci-geosciences/python-mapnik-0.1.9999::bigvo'`,
 * the complete build log and the output of `emerge -pqv '=sci-geosciences/python-mapnik-0.1.9999::bigvo'`.
 * The complete build log is located at '/tmp/logs/sci-geosciences:python-mapnik-0.1.9999:20170120-141057.log'.
 * For convenience, a symlink to the build log is located at '/tmp/portage/sci-geosciences/python-mapnik-0.1.9999/temp/build.log'.
 * The ebuild environment file is located at '/tmp/portage/sci-geosciences/python-mapnik-0.1.9999/temp/environment'.
 * Working directory: '/tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999'
 * S: '/tmp/portage/sci-geosciences/python-mapnik-0.1.9999/work/python-mapnik-0.1.9999'

>>> Failed to emerge sci-geosciences/python-mapnik-0.1.9999, Log file:

>>>  '/tmp/logs/sci-geosciences:python-mapnik-0.1.9999:20170120-141057.log'

_________________
Sky is not the limit...
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Fri Jan 20, 2017 4:12 pm    Post subject: Reply with quote

have you tried
python_compile() {
BOOST_PYTHON_LIB=boost_python-3.4 distutils-r1_python_compile
}
or
python_compile() {
BOOST_PYTHON_LIB=boost_python-2.7 distutils-r1_python_compile
}
_________________
Defund the FCC.
Back to top
View user's profile Send private message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Fri Jan 20, 2017 7:12 pm    Post subject: Reply with quote

I tried both and both failed while compile commands below do work. I would like to avoid those as they are not a proper Gentoo way and might be the cause of of sandbox violations during install phase.

EDIT:
This ebuild and patch are working for python 2.7. For python 3,4 & 3.5 it also compiles and installs, but for those would not work as importing mapnik module for python 3.4 & 3.5 results in unresolved symbols. I have no idea why ${USE_PYTHON} would not work here.

EDIT2: Placed here final & working version of an ebuild
python-mapnik-0.1.9999.ebuild
Code:
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

PYTHON_COMPAT=( python2_7 python3_{4,5} )
inherit distutils-r1 git-r3

DESCRIPTION="Python bindings for the mapnik"
HOMEPAGE="https://github.com/mapnik/python-mapnik"
EGIT_REPO_URI="https://github.com/mapnik/python-mapnik"
EGIT_SUBMODULES=( '*' '-test-*' )
EGIT_COMMIT="ea5fd11"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86"

IUSE=""
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

RDEPEND="
        dev-libs/boost:=[python,${PYTHON_USEDEP}]
        sci-geosciences/mapnik
        ${PYTHON_DEPS}
"
DEPEND="${RDEPEND}"

DOCS=( AUTHORS.md CHANGELOG.md CONTRIBUTING.md README.md )
PATCHES=(
        "${FILESDIR}/flags_fix.patch"
        "${FILESDIR}/paths_fix.patch"
)

python_compile() {
        my_ver=${EPYTHON/python/}

        BOOST_PYTHON_LIB=boost_python-${my_ver} distutils-r1_python_compile
}

python_install() {
        BOOST_PYTHON_LIB=boost_python-${my_ver} distutils-r1_python_install
}


files/flags_fix.patch
Code:
diff -Naur python-mapnik-9999.old/setup.py python-mapnik-9999/setup.py
--- python-mapnik-9999.old/setup.py     2017-01-19 08:42:25.165927328 +0100
+++ python-mapnik-9999/setup.py 2017-01-19 08:42:42.574517707 +0100
@@ -82,22 +82,6 @@
         print("\n".join(get_boost_library_names()))
 
 
-cflags = sysconfig.get_config_var('CFLAGS')
-sysconfig._config_vars['CFLAGS'] = re.sub(
-    ' +', ' ', cflags.replace('-g ', '').replace('-Os', '').replace('-arch i386', ''))
-opt = sysconfig.get_config_var('OPT')
-sysconfig._config_vars['OPT'] = re.sub(
-    ' +', ' ', opt.replace('-g ', '').replace('-Os', ''))
-ldshared = sysconfig.get_config_var('LDSHARED')
-sysconfig._config_vars['LDSHARED'] = re.sub(
-    ' +', ' ', ldshared.replace('-g ', '').replace('-Os', '').replace('-arch i386', ''))
-ldflags = sysconfig.get_config_var('LDFLAGS')
-sysconfig._config_vars['LDFLAGS'] = re.sub(
-    ' +', ' ', ldflags.replace('-g ', '').replace('-Os', '').replace('-arch i386', ''))
-pycflags = sysconfig.get_config_var('PY_CFLAGS')
-sysconfig._config_vars['PY_CFLAGS'] = re.sub(
-    ' +', ' ', pycflags.replace('-g ', '').replace('-Os', '').replace('-arch i386', ''))
-sysconfig._config_vars['CFLAGSFORSHARED'] = ''
 os.environ['ARCHFLAGS'] = ''
 
 if os.environ.get("MASON_BUILD", "false") == "true":


files/paths_fix.patch
Code:
diff -Naur python-mapnik-3.0.9999.old/build.py python-mapnik-3.0.9999/build.py
--- python-mapnik-3.0.9999.old/build.py 2017-01-19 17:50:23.852609700 +0100
+++ python-mapnik-3.0.9999/build.py     2017-01-19 18:00:12.115174107 +0100
@@ -13,7 +13,7 @@
         print stderr
 
 
-prefix = env['PREFIX']
+prefix = env['${D}''PREFIX']
 target_path = os.path.normpath(sysconfig.get_python_lib() + os.path.sep + env['MAPNIK_NAME'])
 
 py_env = env.Clone()

_________________
Sky is not the limit...


Last edited by ryszardzonk on Sat Jan 21, 2017 10:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 402
Location: France

PostPosted: Sat Jan 21, 2017 2:25 pm    Post subject: Reply with quote

Saw in the page that USE_PYTHON column is empty for some python versions.
Maybe variable happens to be undefined and you should try and replace with a regex: my_version=${EPYTHON/python//}

++
Gi)
Back to top
View user's profile Send private message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Sat Jan 21, 2017 10:06 pm    Post subject: Reply with quote

It sure worked, just with one less / --> my_version=${EPYTHON/python/}
Thanks!
_________________
Sky is not the limit...
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 402
Location: France

PostPosted: Sun Jan 22, 2017 2:44 pm    Post subject: Reply with quote

oops :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum