Ticket #1193: rules

File rules, 3.8 KB (added by jörg frings-fürst, 6 years ago)

debian/rules

Line 
1#!/usr/bin/make -f
2
3# This is to let dpkg-buildflags do its job with CFLAGS
4CMAKEFLAGS = -DCMAKE_BUILD_TYPE=debian -DCMAKE_C_FLAGS_DEBIAN=""
5
6# Cross building
7ifneq ($(DEB_HOST_MULTIARCH),$(DEB_BUILD_MULTIARCH))
8export CC=$(DEB_HOST_MULTIARCH)-gcc
9export CXX=$(DEB_HOST_MULTIARCH)-g++
10export CMAKE_TOOLCHAIN_FILE=/etc/dpkg-cross/cmake/CMakeCross.txt
11CMAKEFLAGS += -DCMAKE_LIBRARY_PATH="/usr/$(DEB_HOST_MULTIARCH)/lib" -DCMAKE_REQUIRED_INCLUDES="/usr/$(DEB_HOST_MULTIARCH)/include;/usr/$(DEB_HOST_MULTIARCH)/include/$(DEB_HOST_MULTIARCH)" \
12        -DCMAKE_C_FLAGS_DEBIAN="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) -I/usr/$(DEB_HOST_MULTIARCH)/include -I/usr/$(DEB_HOST_MULTIARCH)/include/$(DEB_HOST_MULTIARCH)" \
13        -DCMAKE_CXX_FLAGS_DEBIAN="$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) -I/usr/$(DEB_HOST_MULTIARCH)/include -I/usr/$(DEB_HOST_MULTIARCH)/include/$(DEB_HOST_MULTIARCH) -I/usr/$(DEB_HOST_MULTIARCH)/include/qt4"
14CMAKEFLAGS += -DQT_QTCORE_LIBRARY="/usr/$(DEB_HOST_MULTIARCH)/lib/libQtCore.so"
15CMAKEFLAGS += -DQT_QTCORE_LIBRARY_RELEASE="/usr/$(DEB_HOST_MULTIARCH)/lib/libQtCore.so"
16else
17export CC=gcc
18export CXX=g++
19CMAKEFLAGS += -DCMAKE_C_FLAGS_DEBIAN="$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
20        -DCMAKE_CXX_FLAGS_DEBIAN="$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)"
21endif
22CMAKEFLAGS += -DCMAKE_MODULE_LINKER_FLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
23CMAKEFLAGS += -DCMAKE_SHARED_LINKER_FLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
24CMAKEFLAGS += -DCMAKE_EXE_LINKER_FLAGS="$(shell dpkg-buildflags --get LDFLAGS)"
25
26# Native compiler (for navit/map/garmin/gentypes.c)
27CMAKEFLAGS += -DNATIVE_CC=gcc
28
29# Fonts
30CMAKEFLAGS += -Dfont/freetype=TRUE
31
32# svg2png is required to display country flags
33CMAKEFLAGS += -Dsvg2png_scaling=0,8,16,32,48,96 -Dsvg2png_scaling_flag=8,16,32,48,96 -Dsvg2png_scaling_nav=8,16,32,48,96
34
35# Force svg2png conversion using rsvg-convert since it is the most reliable
36# ATM
37CMAKEFLAGS += -DIMAGE_CONVERTER_SVGZ=rsvg-convert
38
39# Enable GUIs we want
40CMAKEFLAGS += -Dgui/gtk=TRUE -Dgui/internal=TRUE -Dgui/qml=FALSE
41
42# Bindings
43CMAKEFLAGS += -Dbinding/dbus=TRUE
44# Pyrhon binding not available through cmake
45#CMAKEFLAGS += -Dbinding/python=FALSE
46
47# Wanted graphic backends
48CMAKEFLAGS += -Dgraphics/gtk_drawing_area=TRUE -Dgraphics/qt_qpainter=TRUE -Dgraphics/null=TRUE
49
50# Unwanted graphic backends (yet)
51# opengl and sdl backends aren't mature enough
52# gd backend segfaults
53CMAKEFLAGS += -Dgraphics/android=FALSE -Dgraphics/gd=FALSE -Dgraphics/sdl=FALSE -Dgraphics/opengl=FALSE
54
55# don't build the samplemap - we don't want to download
56# stuff while building...
57CMAKEFLAGS += -DSAMPLE_MAP=FALSE
58
59# Maps
60CMAKEFLAGS += -Dmap/garmin=TRUE -Dmap/mg=TRUE -Dmap/binfile=TRUE -Dmap/csv=TRUE -Dmap/shapefile=TRUE
61
62# Vehicles
63CMAKEFLAGS += -Dvehicle/null=TRUE -Dvehicle/demo=TRUE -Dvehicle/gpsd=TRUE
64# disable gypsy support as there's no gypsy in Debian
65CMAKEFLAGS += -Dvehicle/gypsy=FALSE
66
67# Enable plugin pedestrian
68CMAKEFLAGS += -Dplugin/pedestrian=TRUE
69
70# Enable support/shapefile
71CMAKEFLAGS += -Dsupport/shapefile=TRUE
72
73# Avoid floating point calculation for armel
74ifeq ($(DEB_HOST_ARCH), armel)
75  CMAKEFLAGS += -DAVOID_FLOAT=TRUE
76endif
77
78# Prevent installing into lib64 when arch is 64 bits
79CMAKEFLAGS += -DLIBDIR=lib
80
81%:
82        dh $@
83
84override_dh_auto_configure:
85        dh_auto_configure -- $(CMAKEFLAGS)
86
87override_dh_auto_install:
88        dh_auto_install
89        # Generate icon for Debian menu
90        mkdir -p $(CURDIR)/debian/tmp/usr/share/pixmaps
91        convert $(CURDIR)/navit/xpm/desktop_icons/128x128/navit.png -resize 32x32 $(CURDIR)/debian/tmp/usr/share/pixmaps/navit.xpm
92
93        # Default navit configuration file moved into /etc
94        mkdir -p $(CURDIR)/debian/tmp/etc/navit
95        mv $(CURDIR)/debian/tmp/usr/share/navit/navit.xml \
96           $(CURDIR)/debian/tmp/etc/navit/