mapnik icon indicating copy to clipboard operation
mapnik copied to clipboard

freetype-config does not exist on Ubuntu 20.04 (removed from libfreetype6-dev)

Open hiddewie opened this issue 5 years ago • 2 comments

The freetype-config utility has been removed upstream. Configuring Mapnik does not work, because there is a requirement on freetype-config. For previous versions of Debian/Ubuntu, this utility was included in the libfreetype6-dev package.

Output:

# ^^ Docker install dependencies above
Step 28/30 : RUN python scons/scons.py configure CXX="clang++-10 -Qunused-arguments" CC="clang++-10" ENABLE_GLIBC_WORKAROUND=true
 ---> Running in 98552ca0595d
scons: Reading SConscript files ...

Welcome to Mapnik...

Configuring build environment...
Configuring on Linux in *release mode*...
Checking for freetype-config... no
Checking for dlfcn.h support ... yes
Checking if compiler (clang++-10 -Qunused-arguments) supports -std=c++11 flag... (cached) yes
Checking for C library z... yes
Checking for C++ library icuuc... yes
Checking for ICU version >= 4.2... found: icu 66.1
(cached) Checking for C++ library harfbuzz... yes
Checking for HarfBuzz version >= 0.9.34... found: HarfBuzz 2.6.4
Checking for HarfBuzz with freetype support
(cached) no
Searching for boost libs and headers... (cached) 
Using default boost lib dir: /usr/lib
Using default boost include dir: /usr/include
Checking for C++ header file boost/version.hpp... yes
Checking for Boost version >= 1.47... yes
Found boost lib version... 1_71
Checking for C++ library boost_system... yes
Checking for C++ library boost_filesystem... yes
Checking for C++ library boost_regex... yes
Checking for C++ library boost_program_options... yes
Checking whether Boost was compiled with C++11 scoped enums ... yes
Checking if boost_regex was built with ICU unicode support... (cached) yes
Checking for C library jpeg... yes
Checking for C library proj... no
Could not find optional header or shared library for proj
Checking for C library png... yes
Checking for C library webp... yes
Checking for C library tiff... yes
Checking for PROJ_LIB directory...Failed to detect (mapnik-config will have null value)
Checking for ICU data directory...Failed to detect (mapnik-config will have null value)
Checking for GDAL data directory...Failed to detect (mapnik-config will have null value)
Checking for pkg-config... yes
Checking for requested plugins dependencies...
Checking for pg_config... yes
Checking for C library sqlite3... yes
Checking if SQLite supports RTREE... (cached) yes
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of gdal library... yes
Checking for C++ library gdal... yes
Checking for pg_config... yes
Checking if gdal is ogr enabled... yes
Checking for gdal-config --libs... yes
Checking for gdal-config --cflags... yes
Checking for name of ogr library... yes
Checking for C++ library gdal... yes
Checking for cairo... yes
Checking for cairo lib and include paths... yes
Checking for cairo freetype font support ... yes

Exiting... the following required dependencies were not found:
   - freetype-config (freetype-config program | try setting FREETYPE_CONFIG SCons option or configure with FREETYPE_LIBS & FREETYPE_INCLUDES)
   - harfbuzz-with-freetype-support

See '/mapnik/config.log' for details on possible problems.

Also, these OPTIONAL dependencies were not found:
   - proj (Proj.4 C Projections library | configure with PROJ_LIBS & PROJ_INCLUDES | more info: http://trac.osgeo.org/proj/)

Set custom paths to these libraries and header files on the command-line or in a file called 'config.py'
    ie. $ python scons/scons.py BOOST_INCLUDES=/usr/local/include BOOST_LIBS=/usr/local/lib

Once all required dependencies are found a local 'config.py' will be saved and then install:
    $ sudo python scons/scons.py install

To view available path variables:
    $ python scons/scons.py --help or -h

To view overall SCons help options:
    $ python scons/scons.py --help-options or -H

More info: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation
The command '/bin/sh -c python scons/scons.py configure CXX="clang++-10 -Qunused-arguments" CC="clang++-10" ENABLE_GLIBC_WORKAROUND=true' returned a non-zero code: 1

Dockerfile (non-optimized, for testing purposes):

FROM ubuntu:20.04

LABEL maintainer="Hidde Wieringa <[email protected]>"

RUN apt update && apt install -y \
  --no-install-recommends \
  git \
  ca-certificates

RUN git clone https://github.com/mapnik/mapnik.git /mapnik
WORKDIR /mapnik
RUN git checkout v3.0.x
RUN git submodule update --init

RUN apt install -y --no-install-recommends python
RUN apt install -y --no-install-recommends build-essential

ARG DEBIAN_FRONTEND=noninteractive

RUN apt install -y --no-install-recommends libharfbuzz-dev
RUN apt install -y --no-install-recommends libicu-dev
RUN apt install -y --no-install-recommends libcairo-dev
RUN apt install -y --no-install-recommends libgdal-dev
RUN apt install -y --no-install-recommends libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev libboost-system-dev libboost-thread-dev
RUN apt install -y --no-install-recommends libtiff5-dev libfreetype6-dev libxml2-dev libproj-dev libsqlite3-dev libgdal-dev libcairo-dev python-cairo-dev
RUN apt install -y --no-install-recommends clang

RUN clang --version

ENV CCACHE_TEMPDIR=/tmp/.ccache-temp
ENV CCACHE_COMPRESS=1
ENV CCACHE_DIR=/ccache

RUN export CXX="ccache clang++-10 -Qunused-arguments"
RUN export CC="clang-10"
RUN export ENABLE_GLIBC_WORKAROUND=true

RUN g++ --version
RUN clang++-10 --version
RUN clang++ --version

#RUN ./configure CXX="ccache clang++ -Qunused-arguments" CC="clang" ENABLE_GLIBC_WORKAROUND=true
RUN python scons/scons.py configure CXX="clang++-10 -Qunused-arguments" CC="clang++-10" ENABLE_GLIBC_WORKAROUND=true
RUN JOBS=4 make
RUN make install

Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870618

hiddewie avatar Jun 14 '20 09:06 hiddewie

I haven't had the chance to look into why it does not work, but the fact that freetyle-config was deprecated in favour of pkg-config was brought up and supposedly addressed in #3870, and the fix merged in #3892. Maybe the patch no longer works for some reason?

traviss42 avatar Aug 03 '20 14:08 traviss42

Mapnik v3.1.0 seems to be unaffected

otbutz avatar May 31 '21 13:05 otbutz