1 # speedo.mk - Speedo rebuilds speedily.
2 # Copyright (C) 2008, 2014 g10 Code GmbH
4 # speedo is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # speedo is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 # speedo builds gnupg-related packages from GIT and installs them in a
18 # user directory, thereby providing a non-obstrusive test environment.
19 # speedo does only work with GNU make. The build system is similar to
20 # that of gpg4win. The following commands are supported:
22 # make -f speedo.mk all pkg2rep=/dir/with/tarballs
26 # Builds all packages and installs them under PLAY/inst. At the end,
27 # speedo prints commands that can be executed in the local shell to
28 # make use of the installed packages.
30 # make -f speedo.mk clean
32 # make -f speedo.mk clean-PACKAGE
34 # Removes all packages or the package PACKAGE from the installation
35 # and build tree. A subsequent make will rebuild these (and only
38 # make -f speedo.mk report
40 # make -f speedo.mk report-PACKAGE
42 # Lists packages and versions.
45 # We need to know our own name.
46 SPEEDO_MK := $(realpath $(lastword $(MAKEFILE_LIST)))
48 .PHONY : help native native-gui w32-installer w32-source
49 .PHONY : git-native git-native-gui git-w32-installer git-w32-source
50 .PHONY : this-native this-native-gui this-w32-installer this-w32-source
53 @echo 'usage: make -f speedo.mk TARGET'
54 @echo ' with TARGET being one of:'
55 @echo ' help This help'
56 @echo ' native Native build of the GnuPG core'
57 @echo ' native-gui Ditto but with pinentry and GPA'
58 @echo ' w32-installer Build a Windows installer'
59 @echo ' w32-source Pack a source archive'
60 @echo ' w32-release Build a Windows release'
61 @echo ' w32-sign-installer Sign the installer'
63 @echo 'You may append INSTALL_PREFIX=<dir> for native builds.'
64 @echo 'Prepend TARGET with "git-" to build from GIT repos.'
65 @echo 'Prepend TARGET with "this-" to build from the source tarball.'
66 @echo 'Use SELFCHECK=0 for a non-released version.'
67 @echo 'Use CUSTOM_SWDB=1 for an already downloaded swdb.lst.'
69 SPEEDOMAKE := $(MAKE) -f $(SPEEDO_MK) UPD_SWDB=1
72 $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=0 all
74 git-native: check-tools
75 $(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=0 all
77 this-native: check-tools
78 $(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=0 all
80 native-gui: check-tools
81 $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=1 all
83 git-native-gui: check-tools
84 $(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=1 all
86 this-native-gui: check-tools
87 $(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=1 all
89 w32-installer: check-tools
90 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 installer
92 git-w32-installer: check-tools
93 $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 installer
95 this-w32-installer: check-tools
96 $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 \
97 CUSTOM_SWDB=1 installer
99 w32-source: check-tools
100 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 dist-source
102 git-w32-source: check-tools
103 $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=0 dist-source
105 this-w32-source: check-tools
106 $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=0 \
107 CUSTOM_SWDB=1 dist-source
109 w32-release: check-tools
110 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 SELFCHECK=0 \
111 installer-from-source
113 w32-sign-installer: check-tools
114 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 SELFCHECK=0 \
117 w32-release-offline: check-tools
118 $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=0 SELFCHECK=0 \
119 CUSTOM_SWDB=1 pkgrep=${HOME}/b pkg10rep=${HOME}/b \
120 installer-from-source
123 # Set this to "git" to build from git,
124 # to "release" from tarballs,
125 # to "this" from the unpacked sources.
128 # Set target to "native" or "w32"
131 # Set to 1 to build the GUI tools
134 # Set to 1 to use a pre-installed swdb.lst instead of the online version.
137 # Set to 1 to really download the swdb.
140 # Set to 0 to skip the GnuPG version self-check
143 # Set to the location of the directory with tarballs of
145 TARBALLS=$(shell pwd)/../tarballs
147 # Number of parallel make jobs
150 # Name to use for the w32 installer and sources
153 # Use this to override the installaion directory for native builds.
156 # The Authenticode key used to sign the Windows installer
157 AUTHENTICODE_KEY=${HOME}/.gnupg/g10code-authenticode-key.p12
161 # They must be absolute, as we switch directories pretty often.
162 root := $(shell pwd)/PLAY
164 bdir := $(root)/build
165 bdir6:= $(root)/build-w64
166 ifeq ($(INSTALL_PREFIX),none)
169 idir := $(abspath $(INSTALL_PREFIX))
171 idir6:= $(root)/inst-w64
172 stampdir := $(root)/stamps
173 topsrc := $(shell cd $(dir $(SPEEDO_MK)).. && pwd)
174 auxsrc := $(topsrc)/build-aux/speedo
175 patdir := $(topsrc)/build-aux/speedo/patches
176 w32src := $(topsrc)/build-aux/speedo/w32
178 # =====BEGIN LIST OF PACKAGES=====
179 # The packages that should be built. The order is also the build order.
180 # Fixme: Do we need to build pkg-config for cross-building?
183 libgpg-error npth libgcrypt
185 ifeq ($(TARGETOS),w32)
189 speedo_spkgs += gettext libiconv
196 ifeq ($(TARGETOS),w32)
204 ifeq ($(TARGETOS),w32)
207 libffi glib pkg-config
214 ifeq ($(TARGETOS),w32)
218 gdk-pixbuf atk pixman cairo pango gtk+
222 ifeq ($(TARGETOS),w32)
224 speedo_spkgs += pinentry
226 speedo_spkgs += gpa gpgex
232 speedo_spkgs += pinentry gpa
238 # =====END LIST OF PACKAGES=====
241 # Packages which are additionally build for 64 bit Windows. They are
242 # only used for gpgex and thus we need to build them only if we want
246 speedo_w64_spkgs += libgpg-error libiconv gettext libassuan gpgex
249 # Packages which use the gnupg autogen.sh build style
250 speedo_gnupg_style = \
251 libgpg-error npth libgcrypt \
252 libassuan libksba ntbtls gnupg gpgme \
255 # Packages which use only make and no build directory
256 speedo_make_only_style = \
259 # Get the content of the software DB.
260 ifeq ($(CUSTOM_SWDB),1)
261 getswdb_options = --skip-download --skip-verify
265 ifeq ($(SELFCHECK),0)
266 getswdb_options += --skip-selfcheck
269 SWDB := $(shell $(topsrc)/build-aux/getswdb.sh $(getswdb_options) && echo okay)
270 ifeq ($(strip $(SWDB)),)
272 $(error Error getting GnuPG software version database)
276 # Version numbers of the released packages
277 gnupg_ver_this = $(shell cat $(topsrc)/VERSION)
279 gnupg_ver := $(shell awk '$$1=="gnupg22_ver" {print $$2}' swdb.lst)
281 libgpg_error_ver := $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst)
282 libgpg_error_sha1:= $(shell awk '$$1=="libgpg_error_sha1" {print $$2}' swdb.lst)
283 libgpg_error_sha2:= $(shell awk '$$1=="libgpg_error_sha2" {print $$2}' swdb.lst)
285 npth_ver := $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst)
286 npth_sha1 := $(shell awk '$$1=="npth_sha1" {print $$2}' swdb.lst)
287 npth_sha2 := $(shell awk '$$1=="npth_sha2" {print $$2}' swdb.lst)
289 libgcrypt_ver := $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst)
290 libgcrypt_sha1 := $(shell awk '$$1=="libgcrypt_sha1" {print $$2}' swdb.lst)
291 libgcrypt_sha2 := $(shell awk '$$1=="libgcrypt_sha2" {print $$2}' swdb.lst)
293 libassuan_ver := $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst)
294 libassuan_sha1 := $(shell awk '$$1=="libassuan_sha1" {print $$2}' swdb.lst)
295 libassuan_sha2 := $(shell awk '$$1=="libassuan_sha2" {print $$2}' swdb.lst)
297 libksba_ver := $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst)
298 libksba_sha1 := $(shell awk '$$1=="libksba_sha1" {print $$2}' swdb.lst)
299 libksba_sha2 := $(shell awk '$$1=="libksba_sha2" {print $$2}' swdb.lst)
301 ntbtls_ver := $(shell awk '$$1=="ntbtls_ver" {print $$2}' swdb.lst)
302 ntbtls_sha1 := $(shell awk '$$1=="ntbtls_sha1" {print $$2}' swdb.lst)
303 ntbtls_sha2 := $(shell awk '$$1=="ntbtls_sha2" {print $$2}' swdb.lst)
305 gpgme_ver := $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst)
306 gpgme_sha1 := $(shell awk '$$1=="gpgme_sha1" {print $$2}' swdb.lst)
307 gpgme_sha2 := $(shell awk '$$1=="gpgme_sha2" {print $$2}' swdb.lst)
309 pinentry_ver := $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst)
310 pinentry_sha1 := $(shell awk '$$1=="pinentry_sha1" {print $$2}' swdb.lst)
311 pinentry_sha2 := $(shell awk '$$1=="pinentry_sha2" {print $$2}' swdb.lst)
313 gpa_ver := $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst)
314 gpa_sha1 := $(shell awk '$$1=="gpa_sha1" {print $$2}' swdb.lst)
315 gpa_sha2 := $(shell awk '$$1=="gpa_sha2" {print $$2}' swdb.lst)
317 gpgex_ver := $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst)
318 gpgex_sha1 := $(shell awk '$$1=="gpgex_sha1" {print $$2}' swdb.lst)
319 gpgex_sha2 := $(shell awk '$$1=="gpgex_sha2" {print $$2}' swdb.lst)
321 zlib_ver := $(shell awk '$$1=="zlib_ver" {print $$2}' swdb.lst)
322 zlib_sha1 := $(shell awk '$$1=="zlib_sha1_gz" {print $$2}' swdb.lst)
323 zlib_sha2 := $(shell awk '$$1=="zlib_sha2_gz" {print $$2}' swdb.lst)
325 bzip2_ver := $(shell awk '$$1=="bzip2_ver" {print $$2}' swdb.lst)
326 bzip2_sha1 := $(shell awk '$$1=="bzip2_sha1_gz" {print $$2}' swdb.lst)
327 bzip2_sha2 := $(shell awk '$$1=="bzip2_sha2_gz" {print $$2}' swdb.lst)
329 sqlite_ver := $(shell awk '$$1=="sqlite_ver" {print $$2}' swdb.lst)
330 sqlite_sha1 := $(shell awk '$$1=="sqlite_sha1_gz" {print $$2}' swdb.lst)
331 sqlite_sha2 := $(shell awk '$$1=="sqlite_sha2_gz" {print $$2}' swdb.lst)
334 $(info Information from the version database)
335 $(info GnuPG ..........: $(gnupg_ver) (building $(gnupg_ver_this)))
336 $(info Libgpg-error ...: $(libgpg_error_ver))
337 $(info Npth ...........: $(npth_ver))
338 $(info Libgcrypt ......: $(libgcrypt_ver))
339 $(info Libassuan ......: $(libassuan_ver))
340 $(info Libksba ........: $(libksba_ver))
341 $(info Zlib ...........: $(zlib_ver))
342 $(info Bzip2 ..........: $(bzip2_ver))
343 $(info SQLite .........: $(sqlite_ver))
344 $(info NtbTLS .. ......: $(ntbtls_ver))
345 $(info GPGME ..........: $(gpgme_ver))
346 $(info Pinentry .......: $(pinentry_ver))
347 $(info GPA ............: $(gpa_ver))
348 $(info GpgEX.... ......: $(gpgex_ver))
351 # Version number for external packages
352 pkg_config_ver = 0.23
354 gettext_ver = 0.18.2.1
358 gdk_pixbuf_ver = 2.26.5
365 # The GIT repository. Using a local repo is much faster.
366 #gitrep = git://git.gnupg.org
369 # The tarball directories
370 pkgrep = ftp://ftp.gnupg.org/gcrypt
371 pkg10rep = ftp://ftp.g10code.com/g10code
372 pkg2rep = $(TARBALLS)
374 # For each package, the following variables can be defined:
376 # speedo_pkg_PACKAGE_git: The GIT repository that should be built.
377 # speedo_pkg_PACKAGE_gitref: The GIT revision to checkout
379 # speedo_pkg_PACKAGE_tar: URL to the tar file that should be built.
381 # Exactly one of the above variables is required. Note that this
382 # version of speedo does not cache repositories or tar files, and does
383 # not test the integrity of the downloaded software. If you care
384 # about this, you can also specify filenames to locally verified files.
385 # Filenames are differentiated from URLs by starting with a slash '/'.
387 # speedo_pkg_PACKAGE_configure: Extra arguments to configure.
389 # speedo_pkg_PACKAGE_make_args: Extra arguments to make.
391 # speedo_pkg_PACKAGE_make_args_inst: Extra arguments to make install.
393 # Note that you can override the defaults in this file in a local file
397 else ifeq ($(WHAT),git)
398 speedo_pkg_libgpg_error_git = $(gitrep)/libgpg-error
399 speedo_pkg_libgpg_error_gitref = master
400 speedo_pkg_npth_git = $(gitrep)/npth
401 speedo_pkg_npth_gitref = master
402 speedo_pkg_libassuan_git = $(gitrep)/libassuan
403 speedo_pkg_libassuan_gitref = master
404 speedo_pkg_libgcrypt_git = $(gitrep)/libgcrypt
405 speedo_pkg_libgcrypt_gitref = master
406 speedo_pkg_libksba_git = $(gitrep)/libksba
407 speedo_pkg_libksba_gitref = master
408 speedo_pkg_ntbtls_git = $(gitrep)/ntbtls
409 speedo_pkg_ntbtls_gitref = master
410 speedo_pkg_gpgme_git = $(gitrep)/gpgme
411 speedo_pkg_gpgme_gitref = master
412 speedo_pkg_pinentry_git = $(gitrep)/pinentry
413 speedo_pkg_pinentry_gitref = master
414 speedo_pkg_gpa_git = $(gitrep)/gpa
415 speedo_pkg_gpa_gitref = master
416 speedo_pkg_gpgex_git = $(gitrep)/gpgex
417 speedo_pkg_gpgex_gitref = master
418 else ifeq ($(WHAT),release)
419 speedo_pkg_libgpg_error_tar = \
420 $(pkgrep)/libgpg-error/libgpg-error-$(libgpg_error_ver).tar.bz2
421 speedo_pkg_npth_tar = \
422 $(pkgrep)/npth/npth-$(npth_ver).tar.bz2
423 speedo_pkg_libassuan_tar = \
424 $(pkgrep)/libassuan/libassuan-$(libassuan_ver).tar.bz2
425 speedo_pkg_libgcrypt_tar = \
426 $(pkgrep)/libgcrypt/libgcrypt-$(libgcrypt_ver).tar.bz2
427 speedo_pkg_libksba_tar = \
428 $(pkgrep)/libksba/libksba-$(libksba_ver).tar.bz2
429 speedo_pkg_ntbtls_tar = \
430 $(pkgrep)/ntbtls/ntbtls-$(ntbtls_ver).tar.bz2
431 speedo_pkg_gpgme_tar = \
432 $(pkgrep)/gpgme/gpgme-$(gpgme_ver).tar.bz2
433 speedo_pkg_pinentry_tar = \
434 $(pkgrep)/pinentry/pinentry-$(pinentry_ver).tar.bz2
435 speedo_pkg_gpa_tar = \
436 $(pkgrep)/gpa/gpa-$(gpa_ver).tar.bz2
437 speedo_pkg_gpgex_tar = \
438 $(pkg10rep)/gpgex/gpgex-$(gpgex_ver).tar.bz2
440 $(error invalid value for WHAT (use on of: git release this))
443 speedo_pkg_pkg_config_tar = $(pkg2rep)/pkg-config-$(pkg_config_ver).tar.gz
444 speedo_pkg_zlib_tar = $(pkgrep)/zlib/zlib-$(zlib_ver).tar.gz
445 speedo_pkg_bzip2_tar = $(pkgrep)/bzip2/bzip2-$(bzip2_ver).tar.gz
446 speedo_pkg_sqlite_tar = $(pkgrep)/sqlite/sqlite-autoconf-$(sqlite_ver).tar.gz
447 speedo_pkg_libiconv_tar = $(pkg2rep)/libiconv-$(libiconv_ver).tar.gz
448 speedo_pkg_gettext_tar = $(pkg2rep)/gettext-$(gettext_ver).tar.gz
449 speedo_pkg_libffi_tar = $(pkg2rep)/libffi-$(libffi_ver).tar.gz
450 speedo_pkg_glib_tar = $(pkg2rep)/glib-$(glib_ver).tar.xz
451 speedo_pkg_libpng_tar = $(pkg2rep)/libpng-$(libpng_ver).tar.bz2
452 speedo_pkg_gdk_pixbuf_tar = $(pkg2rep)/gdk-pixbuf-$(gdk_pixbuf_ver).tar.xz
453 speedo_pkg_atk_tar = $(pkg2rep)/atk-$(atk_ver).tar.bz2
454 speedo_pkg_pango_tar = $(pkg2rep)/pango-$(pango_ver).tar.bz2
455 speedo_pkg_pixman_tar = $(pkg2rep)/pixman-$(pixman_ver).tar.gz
456 speedo_pkg_cairo_tar = $(pkg2rep)/cairo-$(cairo_ver).tar.xz
457 speedo_pkg_gtk__tar = $(pkg2rep)/gtk+-$(gtk__ver).tar.xz
461 # Package build options
464 speedo_pkg_libgpg_error_configure = --enable-static
465 speedo_pkg_w64_libgpg_error_configure = --enable-static
467 speedo_pkg_libassuan_configure = --enable-static
468 speedo_pkg_w64_libassuan_configure = --enable-static
470 speedo_pkg_libgcrypt_configure = --disable-static
472 speedo_pkg_libksba_configure = --disable-static
474 # For now we build ntbtls only static
475 speedo_pkg_ntbtls_configure = --enable-static --disable-shared
477 ifeq ($(TARGETOS),w32)
478 speedo_pkg_gnupg_configure = \
479 --disable-g13 --enable-ntbtls \
480 --enable-build-timestamp
482 speedo_pkg_gnupg_configure = --disable-g13
484 speedo_pkg_gnupg_extracflags = -g
486 # Create the version info files only for W32 so that they won't get
487 # installed if for example INSTALL_PREFIX=/usr/local is used.
488 ifeq ($(TARGETOS),w32)
489 define speedo_pkg_gnupg_post_install
491 sed -n 's/.*PACKAGE_VERSION "\(.*\)"/\1/p' config.h >$(idir)/INST_VERSION; \
492 sed -n 's/.*W32INFO_VI_PRODUCTVERSION \(.*\)/\1/p' common/w32info-rc.h \
493 |sed 's/,/./g' >$(idir)/INST_PROD_VERSION )
497 # The LDFLAGS is needed for -lintl for glib.
499 speedo_pkg_gpgme_configure = \
500 --enable-static --enable-w32-glib --disable-w32-qt \
501 --with-gpg-error-prefix=$(idir) \
502 LDFLAGS=-L$(idir)/lib
504 speedo_pkg_gpgme_configure = \
505 --disable-static --disable-w32-glib --disable-w32-qt \
506 --with-gpg-error-prefix=$(idir) \
507 LDFLAGS=-L$(idir)/lib
511 ifeq ($(TARGETOS),w32)
512 speedo_pkg_pinentry_configure = --disable-pinentry-gtk2
514 speedo_pkg_pinentry_configure = --enable-pinentry-gtk2
516 speedo_pkg_pinentry_configure += \
517 --disable-pinentry-qt5 \
518 --disable-pinentry-qt \
519 --disable-pinentry-fltk \
520 --disable-pinentry-tty \
521 CPPFLAGS=-I$(idir)/include \
522 LDFLAGS=-L$(idir)/lib \
523 CXXFLAGS=-static-libstdc++
526 speedo_pkg_gpa_configure = \
527 --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
528 --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
529 --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
531 speedo_pkg_gpgex_configure = \
532 --with-gpg-error-prefix=$(idir) \
533 --with-libassuan-prefix=$(idir) \
536 speedo_pkg_w64_gpgex_configure = \
537 --with-gpg-error-prefix=$(idir6) \
538 --with-libassuan-prefix=$(idir6) \
546 ifeq ($(TARGETOS),w32)
547 speedo_pkg_zlib_make_args = \
548 -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a
550 speedo_pkg_zlib_make_args_inst = \
551 -fwin32/Makefile.gcc \
552 BINARY_PATH=$(idir)/bin INCLUDE_PATH=$(idir)/include \
553 LIBRARY_PATH=$(idir)/lib SHARED_MODE=1 IMPLIB=libz.dll.a
555 # Zlib needs some special magic to generate a libtool file.
556 # We also install the pc file here.
557 define speedo_pkg_zlib_post_install
558 (set -e; mkdir $(idir)/lib/pkgconfig || true; \
559 cp $(auxsrc)/zlib.pc $(idir)/lib/pkgconfig/; \
561 echo "# Generated by libtool" > lib/libz.la \
562 echo "dlname='../bin/zlib1.dll'" >> lib/libz.la; \
563 echo "library_names='libz.dll.a'" >> lib/libz.la; \
564 echo "old_library='libz.a'" >> lib/libz.la; \
565 echo "dependency_libs=''" >> lib/libz.la; \
566 echo "current=1" >> lib/libz.la; \
567 echo "age=2" >> lib/libz.la; \
568 echo "revision=5" >> lib/libz.la; \
569 echo "installed=yes" >> lib/libz.la; \
570 echo "shouldnotlink=no" >> lib/libz.la; \
571 echo "dlopen=''" >> lib/libz.la; \
572 echo "dlpreopen=''" >> lib/libz.la; \
573 echo "libdir=\"$(idir)/lib\"" >> lib/libz.la)
578 ifeq ($(TARGETOS),w32)
579 speedo_pkg_bzip2_make_args = \
580 CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
582 speedo_pkg_bzip2_make_args_inst = \
583 PREFIX=$(idir) CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
586 speedo_pkg_w64_libiconv_configure = \
587 --enable-shared=no --enable-static=yes
589 speedo_pkg_gettext_configure = \
590 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
591 CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
592 speedo_pkg_w64_gettext_configure = \
593 --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
594 CPPFLAGS=-I$(idir6)/include LDFLAGS=-L$(idir6)/lib
595 speedo_pkg_gettext_extracflags = -O2
596 # We only need gettext-runtime and there is sadly no top level
597 # configure option for this
598 speedo_pkg_gettext_make_dir = gettext-runtime
601 speedo_pkg_glib_configure = \
602 --disable-modular-tests \
603 --with-libiconv=gnu \
604 CPPFLAGS=-I$(idir)/include \
605 LDFLAGS=-L$(idir)/lib \
607 LIBFFI_CFLAGS=-I$(idir)/lib/libffi-$(libffi_ver)/include \
608 LIBFFI_LIBS=\"-L$(idir)/lib -lffi\"
609 ifeq ($(TARGETOS),w32)
610 speedo_pkg_glib_extracflags = -march=i486
613 ifeq ($(TARGETOS),w32)
614 speedo_pkg_libpng_configure = \
615 CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" \
616 LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\"
618 speedo_pkg_libpng_configure = \
619 CPPFLAGS=\"-I$(idir)/include\" \
620 LDFLAGS=\"-L$(idir)/lib\"
623 ifneq ($(TARGETOS),w32)
624 speedo_pkg_gdk_pixbuf_configure = --without-libtiff --without-libjpeg
627 speedo_pkg_pixman_configure = \
628 CPPFLAGS=-I$(idir)/include \
629 LDFLAGS=-L$(idir)/lib
631 ifeq ($(TARGETOS),w32)
632 speedo_pkg_cairo_configure = \
633 --disable-qt --disable-ft --disable-fc \
634 --enable-win32 --enable-win32-font \
635 CPPFLAGS=-I$(idir)/include \
636 LDFLAGS=-L$(idir)/lib
638 speedo_pkg_cairo_configure = \
640 CPPFLAGS=-I$(idir)/include \
641 LDFLAGS=-L$(idir)/lib
644 speedo_pkg_pango_configure = \
646 CPPFLAGS=-I$(idir)/include \
647 LDFLAGS=-L$(idir)/lib
649 speedo_pkg_gtk__configure = \
651 CPPFLAGS=-I$(idir)/include \
652 LDFLAGS=-L$(idir)/lib
659 report: report-speedo
663 ifeq ($(TARGETOS),w32)
664 STRIP = i686-w64-mingw32-strip
668 W32CC = i686-w64-mingw32-gcc
673 # The generic speedo code
678 SHA1SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha1sum)
679 ifeq ($(SHA1SUM),false)
680 $(error The sha1sum tool is missing)
682 SHA2SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha256sum)
683 ifeq ($(SHA2SUM),false)
684 $(error The sha256sum tool is missing)
688 BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
689 BUILD_DATESTR=$(subst -,,$(BUILD_ISODATE))
691 # The next two macros will work only after gnupg has been build.
692 ifeq ($(TARGETOS),w32)
693 INST_VERSION=$(shell head -1 $(idir)/INST_VERSION)
694 INST_PROD_VERSION=$(shell head -1 $(idir)/INST_PROD_VERSION)
698 speedo_build_list = $(speedo_spkgs)
699 speedo_w64_build_list = $(speedo_w64_spkgs)
701 # To avoid running external commands during the read phase (":=" style
702 # assignments), we check that the targetos has been given
705 # Determine build and host system
706 build := $(shell $(topsrc)/autogen.sh --silent --print-build)
707 ifeq ($(TARGETOS),w32)
708 speedo_autogen_buildopt := --build-w32
709 speedo_autogen_buildopt6 := --build-w64
710 host := $(shell $(topsrc)/autogen.sh --silent --print-host --build-w32)
711 host6:= $(shell $(topsrc)/autogen.sh --silent --print-host --build-w64)
712 speedo_host_build_option := --host=$(host) --build=$(build)
713 speedo_host_build_option6 := --host=$(host6) --build=$(build)
714 speedo_w32_cflags := -mms-bitfields
716 speedo_autogen_buildopt :=
718 speedo_host_build_option :=
725 speedo_makeopt=-j$(MAKE_J)
728 # End non-empty TARGETOS
733 # The playground area is our scratch area, where we unpack, build and
734 # install the packages.
735 $(stampdir)/stamp-directories:
736 $(MKDIR) $(root) || true
737 $(MKDIR) $(stampdir) || true
738 $(MKDIR) $(sdir) || true
739 $(MKDIR) $(bdir) || true
740 $(MKDIR) $(idir) || true
741 ifeq ($(TARGETOS),w32)
742 $(MKDIR) $(bdir6) || true
743 $(MKDIR) $(idir6) || true
745 touch $(stampdir)/stamp-directories
747 # Frob the name $1 by converting all '-' and '+' characters to '_'.
749 $(subst +,_,$(subst -,_,$(1)))
752 # Get the variable $(1) (which may contain '-' and '+' characters).
754 $($(call FROB_macro,$(1)))
757 # Set a couple of common variables.
760 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
761 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
762 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
763 ver="$(call GETVAR,$(1)_ver)"; \
764 sha2="$(call GETVAR,$(1)_sha2)"; \
765 sha1="$(call GETVAR,$(1)_sha1)"; \
766 pkgsdir="$(sdir)/$(1)"; \
767 if [ "$(1)" = "gnupg" ]; then \
771 pkgsdir="$(topsrc)"; \
773 pkgbdir="$(bdir)/$(1)"; \
774 pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)"; \
775 tmp="$(speedo_w32_cflags) \
776 $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
777 if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \
778 pkgextracflags="CFLAGS=\"$$$$tmp\""; \
782 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
783 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
784 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
785 pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
786 export PKG_CONFIG="/usr/bin/pkg-config"; \
787 export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig"; \
788 [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \
789 export SYSROOT="$(idir)"; \
790 export PATH="$(idir)/bin:$${PATH}"; \
791 export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}"
796 git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
797 gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
798 tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
799 ver="$(call GETVAR,$(1)_ver)"; \
800 sha2="$(call GETVAR,$(1)_sha2)"; \
801 sha1="$(call GETVAR,$(1)_sha1)"; \
802 pkgsdir="$(sdir)/$(1)"; \
803 if [ "$(1)" = "gnupg" ]; then \
807 pkgsdir="$(topsrc)"; \
809 pkgbdir="$(bdir6)/$(1)"; \
810 pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)"; \
811 tmp="$(speedo_w32_cflags) \
812 $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \
813 if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \
814 pkgextracflags="CFLAGS=\"$$$$tmp\""; \
818 pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \
819 pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \
820 pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
821 pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
822 export PKG_CONFIG="/usr/bin/pkg-config"; \
823 export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig"; \
824 [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \
825 export SYSROOT="$(idir6)"; \
826 export PATH="$(idir6)/bin:$${PATH}"; \
827 export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}"
831 # Template for source packages.
833 # Note that the gnupg package is special: The package source dir is
834 # the same as the topsrc dir and thus we need to detect the gnupg
835 # package and cd to that directory. We also test that no in-source build
836 # has been done. autogen.sh is not run for gnupg.
840 $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
842 @echo "speedo: * $(1)"
844 @(set -e; cd $(sdir); \
845 $(call SETVARS,$(1)); \
846 if [ "$(WHAT)" = "this" ]; then \
847 echo "speedo: using included source"; \
848 elif [ "$(1)" = "gnupg" ]; then \
850 if [ -f config.log ]; then \
851 echo "GnuPG has already been build in-source" >&2 ;\
852 echo "Please run \"make distclean\" and retry" >&2 ;\
855 echo "speedo: unpacking gnupg not needed"; \
856 elif [ -n "$$$${git}" ]; then \
857 echo "speedo: unpacking $(1) from $$$${git}:$$$${gitref}"; \
858 git clone -b "$$$${gitref}" "$$$${git}" "$$$${pkg}"; \
860 AUTOGEN_SH_SILENT=1 ./autogen.sh; \
861 elif [ -n "$$$${tar}" ]; then \
862 echo "speedo: unpacking $(1) from $$$${tar}"; \
863 case "$$$${tar}" in \
864 *.gz) pretar=zcat ;; \
865 *.bz2) pretar=bzcat ;; \
866 *.xz) pretar=xzcat ;; \
869 [ -f tmp.tgz ] && rm tmp.tgz; \
870 case "$$$${tar}" in \
871 /*) $$$${pretar} < $$$${tar} | tar xf - ;; \
872 *) wget -q -O - $$$${tar} | tee tmp.tgz \
873 | $$$${pretar} | tar x$$$${opt}f - ;; \
875 if [ -f tmp.tgz ]; then \
876 if [ -n "$$$${sha2}" ]; then \
877 tmp=$$$$($(SHA2SUM) <tmp.tgz|cut -d' ' -f1);\
878 if [ "$$$${tmp}" != "$$$${sha2}" ]; then \
880 echo "speedo: ERROR: SHA-256 checksum mismatch for $(1)";\
884 elif [ -n "$$$${sha1}" ]; then \
885 tmp=$$$$($(SHA1SUM) <tmp.tgz|cut -d' ' -f1);\
886 if [ "$$$${tmp}" != "$$$${sha1}" ]; then \
888 echo "speedo: ERROR: SHA-1 checksum mismatch for $(1)";\
894 echo "speedo: Warning: No checksum known for $(1)";\
899 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
900 | sed -e 's,\.tar.*$$$$,,'`; \
901 mv $$$${base} $(1); \
902 patch="$(patdir)/$(1)-$$$${base#$(1)-}.patch";\
903 patchx="$(patdir)/$(1).patch"; \
904 if [ -x "$$$${patch}" ]; then \
905 echo "speedo: applying patch $$$${patch}"; \
906 cd $(1); "$$$${patch}"; \
907 elif [ -x "$$$${patchx}" ]; then \
908 echo "speedo: applying patch $$$${patchx}";\
909 cd $(1); "$$$${patchx}"; \
910 elif [ -f "$$$${patch}" ]; then \
911 echo "speedo: warning: $$$${patch} is not executable"; \
914 echo "speedo: unpacking $(1) from UNKNOWN"; \
916 @touch $(stampdir)/stamp-$(1)-00-unpack
918 $(stampdir)/stamp-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
919 @echo "speedo: configuring $(1)"
920 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
921 @echo "speedo: configure run not required"
922 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
923 @($(call SETVARS,$(1)); \
924 mkdir "$$$${pkgbdir}"; \
925 cd "$$$${pkgbdir}"; \
926 if [ -n "$(speedo_autogen_buildopt)" ]; then \
927 eval AUTOGEN_SH_SILENT=1 w32root="$(idir)" \
928 "$$$${pkgsdir}/autogen.sh" \
929 $(speedo_autogen_buildopt) \
930 $$$${pkgcfg} $$$${pkgextracflags}; \
932 eval "$$$${pkgsdir}/configure" \
934 --enable-maintainer-mode \
936 $$$${pkgcfg} $$$${pkgextracflags}; \
939 @($(call SETVARS,$(1)); \
940 mkdir "$$$${pkgbdir}"; \
941 cd "$$$${pkgbdir}"; \
942 eval "$$$${pkgsdir}/configure" \
943 --silent $(speedo_host_build_option) \
945 $$$${pkgcfg} $$$${pkgextracflags}; \
948 @touch $(stampdir)/stamp-$(1)-01-configure
950 # Note that unpack has no 64 bit version becuase it is just the source.
951 # Fixme: We should use templates to create the standard and w64
952 # version of these rules.
953 $(stampdir)/stamp-w64-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
954 @echo "speedo: configuring $(1) (64 bit)"
955 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
956 @echo "speedo: configure run not required"
957 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
958 @($(call SETVARS_W64,$(1)); \
959 mkdir "$$$${pkgbdir}"; \
960 cd "$$$${pkgbdir}"; \
961 if [ -n "$(speedo_autogen_buildopt)" ]; then \
962 eval AUTOGEN_SH_SILENT=1 w64root="$(idir6)" \
963 "$$$${pkgsdir}/autogen.sh" \
964 $(speedo_autogen_buildopt6) \
965 $$$${pkgcfg} $$$${pkgextracflags}; \
967 eval "$$$${pkgsdir}/configure" \
969 --enable-maintainer-mode \
970 --prefix="$(idir6)" \
971 $$$${pkgcfg} $$$${pkgextracflags}; \
974 @($(call SETVARS_W64,$(1)); \
975 mkdir "$$$${pkgbdir}"; \
976 cd "$$$${pkgbdir}"; \
977 eval "$$$${pkgsdir}/configure" \
978 --silent $(speedo_host_build_option6) \
979 --prefix="$(idir6)" \
980 $$$${pkgcfg} $$$${pkgextracflags}; \
983 @touch $(stampdir)/stamp-w64-$(1)-01-configure
986 $(stampdir)/stamp-$(1)-02-make: $(stampdir)/stamp-$(1)-01-configure
987 @echo "speedo: making $(1)"
988 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
989 @($(call SETVARS,$(1)); \
990 cd "$$$${pkgsdir}"; \
991 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
992 if test "$$$${pkg}" = zlib -a "$(TARGETOS)" != w32 ; then \
993 ./configure --prefix="$(idir)" ; \
995 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
997 @($(call SETVARS,$(1)); \
998 cd "$$$${pkgbdir}"; \
999 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1000 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
1002 @touch $(stampdir)/stamp-$(1)-02-make
1004 $(stampdir)/stamp-w64-$(1)-02-make: $(stampdir)/stamp-w64-$(1)-01-configure
1005 @echo "speedo: making $(1) (64 bit)"
1006 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1007 @($(call SETVARS_W64,$(1)); \
1008 cd "$$$${pkgsdir}"; \
1009 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1010 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
1012 @($(call SETVARS_W64,$(1)); \
1013 cd "$$$${pkgbdir}"; \
1014 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1015 $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
1017 @touch $(stampdir)/stamp-w64-$(1)-02-make
1019 # Note that post_install must come last because it may be empty and
1020 # "; ;" is a syntax error.
1021 $(stampdir)/stamp-$(1)-03-install: $(stampdir)/stamp-$(1)-02-make
1022 @echo "speedo: installing $(1)"
1023 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1024 @($(call SETVARS,$(1)); \
1025 cd "$$$${pkgsdir}"; \
1026 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1027 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
1028 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1030 @($(call SETVARS,$(1)); \
1031 cd "$$$${pkgbdir}"; \
1032 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1033 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
1034 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1036 touch $(stampdir)/stamp-$(1)-03-install
1038 $(stampdir)/stamp-w64-$(1)-03-install: $(stampdir)/stamp-w64-$(1)-02-make
1039 @echo "speedo: installing $(1) (64 bit)"
1040 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
1041 @($(call SETVARS_W64,$(1)); \
1042 cd "$$$${pkgsdir}"; \
1043 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1044 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
1045 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1047 @($(call SETVARS_W64,$(1)); \
1048 cd "$$$${pkgbdir}"; \
1049 test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
1050 $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
1051 $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
1053 touch $(stampdir)/stamp-w64-$(1)-03-install
1055 $(stampdir)/stamp-final-$(1): $(stampdir)/stamp-$(1)-03-install
1056 @($(call SETVARS,$(1)); \
1057 printf "%-14s %-12s %s\n" $(1) "$$$${ver}" "$$$${sha1}" \
1058 >> $(bdir)/pkg-versions.txt)
1059 @echo "speedo: $(1) done"
1060 @touch $(stampdir)/stamp-final-$(1)
1062 $(stampdir)/stamp-w64-final-$(1): $(stampdir)/stamp-w64-$(1)-03-install
1063 @echo "speedo: $(1) (64 bit) done"
1064 @touch $(stampdir)/stamp-w64-final-$(1)
1068 @echo "speedo: uninstalling $(1)"
1069 @($(call SETVARS,$(1)); \
1070 (cd "$$$${pkgbdir}" 2>/dev/null && \
1071 $(MAKE) --no-print-directory \
1072 $$$${pkgmkargs_uninst} uninstall V=0 ) || true;\
1073 if [ "$(1)" = "gnupg" ]; then \
1074 rm -fR "$$$${pkgbdir}" || true ;\
1076 rm -fR "$$$${pkgsdir}" "$$$${pkgbdir}" || true;\
1078 -rm -f $(stampdir)/stamp-final-$(1) $(stampdir)/stamp-$(1)-*
1082 build-$(1): $(stampdir)/stamp-final-$(1)
1085 .PHONY : report-$(1)
1087 @($(call SETVARS,$(1)); \
1089 if [ -n "$$$${git}" ]; then \
1090 if [ -e "$$$${pkgsdir}/.git" ]; then \
1091 cd "$$$${pkgsdir}" && \
1096 elif [ -n "$$$${tar}" ]; then \
1097 base=`echo "$$$${tar}" | sed -e 's,^.*/,,' \
1098 | sed -e 's,\.tar.*$$$$,,'`; \
1105 # Insert the template for each source package.
1106 $(foreach spkg, $(speedo_spkgs), $(eval $(call SPKG_template,$(spkg))))
1108 $(stampdir)/stamp-final: $(stampdir)/stamp-directories clean-pkg-versions
1109 ifeq ($(TARGETOS),w32)
1110 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-w64-final-,$(speedo_w64_build_list))
1112 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-final-,$(speedo_build_list))
1113 touch $(stampdir)/stamp-final
1116 @: >$(bdir)/pkg-versions.txt
1118 all-speedo: $(stampdir)/stamp-final
1120 report-speedo: $(addprefix report-,$(speedo_build_list))
1122 # Just to check if we catched all stamps.
1124 $(RM) -fR $(stampdir)
1134 ifeq ($(TARGETOS),w32)
1136 dist-source: installer
1137 for i in 00 01 02 03; do sleep 1;touch PLAY/stamps/stamp-*-${i}-*;done
1139 tarname="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar" ;\
1140 [ -f "$$tarname" ] && rm "$$tarname" ;\
1141 tar -C $(topsrc) -cf "$$tarname" --exclude-backups --exclude-vcs \
1142 --transform='s,^\./,$(INST_NAME)-$(INST_VERSION)/,' \
1143 --anchored --exclude './PLAY' . ;\
1144 tar --totals -rf "$$tarname" --exclude-backups --exclude-vcs \
1145 --transform='s,^,$(INST_NAME)-$(INST_VERSION)/,' \
1146 PLAY/stamps/stamp-*-00-unpack PLAY/src swdb.lst swdb.lst.sig ;\
1147 [ -f "$$tarname".xz ] && rm "$$tarname".xz;\
1152 # Extract the two latest news entries. */
1153 $(bdir)/NEWS.tmp: $(topsrc)/NEWS
1154 awk '/^Notewo/ {if(okay>1){exit}; okay++};okay {print $0}' \
1155 <$(topsrc)/NEWS >$(bdir)/NEWS.tmp
1157 # Sort the file with the package versions.
1158 $(bdir)/pkg-versions.sorted: $(bdir)/pkg-versions.txt
1159 grep -v '^gnupg ' <$(bdir)/pkg-versions.txt \
1160 | sort | uniq >$(bdir)/pkg-versions.sorted
1162 $(bdir)/README.txt: $(bdir)/NEWS.tmp $(topsrc)/README $(w32src)/README.txt \
1163 $(w32src)/pkg-copyright.txt $(bdir)/pkg-versions.sorted
1165 -e '/!NEWSFILE!/{r $(bdir)/NEWS.tmp' -e 'd;}' \
1166 -e '/!GNUPGREADME!/{r $(topsrc)/README' -e 'd;}' \
1167 -e '/!PKG-COPYRIGHT!/{r $(w32src)/pkg-copyright.txt' -e 'd;}' \
1168 -e '/!PKG-VERSIONS!/{r $(bdir)/pkg-versions.sorted' -e 'd;}' \
1169 -e 's,!VERSION!,$(INST_VERSION),g' \
1170 < $(w32src)/README.txt \
1172 | awk '{printf "%s\r\n", $$0}' >$(bdir)/README.txt
1174 $(bdir)/g4wihelp.dll: $(w32src)/g4wihelp.c $(w32src)/exdll.h
1175 (set -e; cd $(bdir); \
1176 $(W32CC) -I. -shared -O2 -o g4wihelp.dll $(w32src)/g4wihelp.c \
1178 $(STRIP) g4wihelp.dll)
1180 w32_insthelpers: $(bdir)/g4wihelp.dll
1182 $(bdir)/inst-options.ini: $(w32src)/inst-options.ini
1183 cat $(w32src)/inst-options.ini >$(bdir)/inst-options.ini
1185 extra_installer_options =
1186 ifeq ($(WITH_GUI),1)
1187 extra_installer_options += -DWITH_GUI=1
1190 installer: all w32_insthelpers $(w32src)/inst-options.ini $(bdir)/README.txt
1192 -DINST_DIR=$(idir) \
1193 -DINST6_DIR=$(idir6) \
1194 -DBUILD_DIR=$(bdir) \
1195 -DTOP_SRCDIR=$(topsrc) \
1196 -DW32_SRCDIR=$(w32src) \
1197 -DBUILD_ISODATE=$(BUILD_ISODATE) \
1198 -DBUILD_DATESTR=$(BUILD_DATESTR) \
1199 -DNAME=$(INST_NAME) \
1200 -DVERSION=$(INST_VERSION) \
1201 -DPROD_VERSION=$(INST_PROD_VERSION) \
1202 $(extra_installer_options) $(w32src)/inst.nsi
1203 @echo "Ready: $(idir)/$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe"
1206 define MKSWDB_commands
1207 ( pref="#+macro: gnupg22_w32_" ;\
1208 echo "$${pref}ver $(INST_VERSION)_$(BUILD_DATESTR)" ;\
1209 echo "$${pref}date $(2)" ;\
1210 echo "$${pref}size $$(wc -c <$(1)|awk '{print int($$1/1024)}')k";\
1211 echo "$${pref}sha1 $$(sha1sum <$(1)|cut -d' ' -f1)" ;\
1212 echo "$${pref}sha2 $$(sha256sum <$(1)|cut -d' ' -f1)" ;\
1217 # Build the installer from the source tarball.
1218 installer-from-source: dist-source
1220 [ -d PLAY-release ] && rm -rf PLAY-release; \
1221 mkdir PLAY-release;\
1223 tar xJf "../$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar.xz";\
1224 cd $(INST_NAME)-$(INST_VERSION); \
1225 $(MAKE) -f build-aux/speedo.mk this-w32-installer SELFCHECK=0;\
1226 reldate="$$(date -u +%Y-%m-%d)" ;\
1227 exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
1228 cp "PLAY/inst/$$exefile" ../.. ;\
1229 exefile="../../$$exefile" ;\
1230 $(call MKSWDB_commands,$${exefile},$${reldate}); \
1233 # This target repeats some of the installer-from-source steps but it
1234 # is intended to be called interactively, so that the passphrase can be
1239 cd $(INST_NAME)-$(INST_VERSION); \
1240 reldate="$$(date -u +%Y-%m-%d)" ;\
1241 exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
1242 echo "speedo: /*" ;\
1243 echo "speedo: * Signing installer" ;\
1244 echo "speedo: * Key: $(AUTHENTICODE_KEY)";\
1245 echo "speedo: */" ;\
1246 osslsigncode sign -pkcs12 $(AUTHENTICODE_KEY) -askpass \
1247 -h sha256 -in "PLAY/inst/$$exefile" -out "../../$$exefile" ;\
1248 exefile="../../$$exefile" ;\
1249 $(call MKSWDB_commands,$${exefile},$${reldate}); \
1250 echo "speedo: /*" ;\
1251 echo "speedo: * Verification result" ;\
1252 echo "speedo: */" ;\
1253 osslsigncode verify $${exefile} \
1263 # Check availibility of standard tools
1269 # Mark phony targets
1271 .PHONY: all all-speedo report-speedo clean-stamps clean-speedo installer \
1272 w32_insthelpers check-tools clean-pkg-versions