summaryrefslogtreecommitdiffstats
path: root/rules/imagemagick.make
blob: 56172fb4d3c76657dcd6455071ee6cab8fb64230 (plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# -*-makefile-*-
#
# Copyright (C) 2016 by Guillermo Rodriguez <guille.rodriguez@gmail.com>
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_IMAGEMAGICK) += imagemagick

#
# Paths and names
#
IMAGEMAGICK_VERSION	:= 7.1.1-12
IMAGEMAGICK_MD5		:= 7d04ecc28b035922697630c92cdfbfb8
IMAGEMAGICK		:= ImageMagick-$(IMAGEMAGICK_VERSION)
IMAGEMAGICK_SUFFIX	:= tar.xz
IMAGEMAGICK_URL		:= https://imagemagick.org/archive/releases/$(IMAGEMAGICK).$(IMAGEMAGICK_SUFFIX)
IMAGEMAGICK_SOURCE	:= $(SRCDIR)/$(IMAGEMAGICK).$(IMAGEMAGICK_SUFFIX)
IMAGEMAGICK_DIR		:= $(BUILDDIR)/$(IMAGEMAGICK)
IMAGEMAGICK_LICENSE	:= Apache-2.0

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

#
# Supported values for quantum depth are 8, 16, and 32.
# Most display adapters and image formats don't support more than 8 bits
# per pixel quantum (i.e. per each of the R, G, B, and alpha components),
# and higher values have an impact in runtime performance.
#
IMAGEMAGICK_QUANTUM_DEPTH := 8

#
# See: http://www.imagemagick.org/script/advanced-unix-installation.php
#
# Notes:
# - Threading is disabled as it brings in a dependency with libgomp.so
#   (OpenMP) which fails at runtime; disabling openmp itself doesn't seem
#   to be enough.
# - HDRI is disabled. It is not supported by most image formats, and has
#   a severe impact in runtime performance.
# - The configure script will try to detect external "helper" programs
#   available in the host and store their paths in delegates.xml. These
#   are not applicable on the target, but also not needed for any of the
#   supported configure options. Just ignore the generated delegates.xml
#   file.
#
IMAGEMAGICK_CONF_TOOL := autoconf
IMAGEMAGICK_CONF_OPT := \
	$(CROSS_AUTOCONF_USR) \
	--disable-openmp \
	--disable-opencl \
	$(GLOBAL_LARGE_FILE_OPTION) \
	--enable-shared \
	--disable-static \
	--enable-installed \
	--enable-cipher \
	--disable-zero-configuration \
	--disable-hdri \
	--disable-docs \
	--without-dmalloc \
	--without-threads \
	--without-modules \
	--with-utilities \
	--with-quantum-depth=$(IMAGEMAGICK_QUANTUM_DEPTH) \
	--without-magick-plus-plus \
	--without-perl \
	--without-jemalloc \
	--without-tcmalloc \
	--without-umem \
	--without-bzlib \
	--without-x \
	--without-zip \
	--$(call ptx/wwo, PTXCONF_IMAGEMAGICK_USE_ZLIB)-zlib \
	--without-zstd \
	--without-autotrace \
	--without-dps \
	--without-fftw \
	--without-flif \
	--without-fpx \
	--without-djvu \
	--without-fontconfig \
	--without-freetype \
	--without-raqm \
	--without-gdi32 \
	--without-gslib \
	--without-gvc \
	--without-dmr \
	--without-heic \
	--without-jbig \
	--$(call ptx/wwo, PTXCONF_IMAGEMAGICK_USE_LIBJPEG)-jpeg \
	--without-jxl \
	--without-lcms \
	--without-openjp2 \
	--without-lqr \
	--without-lzma \
	--without-openexr \
	--without-pango \
	--$(call ptx/wwo, PTXCONF_IMAGEMAGICK_USE_LIBPNG)-png \
	--without-raw \
	--without-rsvg \
	--without-tiff \
	--$(call ptx/wwo, PTXCONF_IMAGEMAGICK_USE_LIBWEBP)-webp \
	--without-wmf \
	--without-xml

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

$(STATEDIR)/imagemagick.targetinstall:
	@$(call targetinfo)

	@$(call install_init, imagemagick)
	@$(call install_fixup, imagemagick, PRIORITY, optional)
	@$(call install_fixup, imagemagick, SECTION, base)
	@$(call install_fixup, imagemagick, AUTHOR, "Guillermo Rodriguez <guille.rodriguez@gmail.com>")
	@$(call install_fixup, imagemagick, DESCRIPTION, missing)

	@$(call install_copy, imagemagick, 0, 0, 0755, -, /usr/bin/magick)
	@$(call install_lib, imagemagick, 0, 0, 0644, libMagickCore-7.Q$(IMAGEMAGICK_QUANTUM_DEPTH))
	@$(call install_lib, imagemagick, 0, 0, 0644, libMagickWand-7.Q$(IMAGEMAGICK_QUANTUM_DEPTH))

	@$(call install_link, imagemagick, magick, /usr/bin/compare)
	@$(call install_link, imagemagick, magick, /usr/bin/composite)
	@$(call install_link, imagemagick, magick, /usr/bin/conjure)
	@$(call install_link, imagemagick, magick, /usr/bin/convert)
	@$(call install_link, imagemagick, magick, /usr/bin/identify)
	@$(call install_link, imagemagick, magick, /usr/bin/magick-script)
	@$(call install_link, imagemagick, magick, /usr/bin/mogrify)
	@$(call install_link, imagemagick, magick, /usr/bin/montage)
	@$(call install_link, imagemagick, magick, /usr/bin/stream)

	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/colors.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/delegates.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/log.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/mime.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/policy.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/quantization-table.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/thresholds.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/type-apple.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/type-dejavu.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/type-ghostscript.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/type-urw-base35.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/type-windows.xml)
	@$(call install_alternative, imagemagick, 0, 0, 0644, /etc/ImageMagick-7/type.xml)

	@$(call install_finish, imagemagick)

	@$(call touch)

# vim: syntax=make