diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk index f81a835ee..ae84d66ef 100644 --- a/build-aux/speedo.mk +++ b/build-aux/speedo.mk @@ -45,6 +45,60 @@ # We need to know our own name. SPEEDO_MK := $(realpath $(lastword $(MAKEFILE_LIST))) +.PHONY : help native native-gui w32-installer w32-source +.PHONY : git-native git-native-gui git-w32-installer git-w32-source +.PHONY : this-native this-native-gui this-w32-installer this-w32-source + +help: + @echo 'usage: make -f speedo.mk TARGET' + @echo ' with TARGET being one of:' + @echo ' help This help' + @echo ' native Native build of the GnuPG core' + @echo ' native-gui Ditto but with pinentry and GPA' + @echo ' w32-installer Build a Windows installer' + @echo ' w32-source Pack a source archive' + @echo + @echo 'Prepend TARGET with "git-" to build from GIT repos' + @echo 'Prepend TARGET with "this-" to build from the source tarball' + +SPEEDOMAKE := $(MAKE) -f $(SPEEDO_MK) UPD_SWDB=1 + +native: + $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=0 all + +git-native: + $(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=0 all + +this-native: + $(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=0 all + +native-gui: + $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=1 all + +git-native-gui: + $(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=1 all + +this-native-gui: + $(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=1 all + +w32-installer: + $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=1 installer + +git-w32-installer: + $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=1 installer + +this-w32-installer: + $(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=1 installer + +w32-source: + $(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=1 dist-source + +git-w32-source: + $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=1 dist-source + +this-w32-source: + $(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=1 dist-source + # Set this to "git" to build from git, # to "release" from tarballs, @@ -54,6 +108,12 @@ WHAT=git # Set target to "native" or "w32" TARGETOS=w32 +# Set to 1 to build the GUI tools +WITH_GUI=0 + +# Set to 1 to really download the swdb. +UPD_SWDB=0 + # Set to the location of the directory with tarballs of # external packages. TARBALLS=$(shell pwd)/../tarballs @@ -108,8 +168,11 @@ speedo_spkgs += \ gdk-pixbuf atk pixman cairo pango gtk+ endif + +ifeq ($(WITH_GUI),1) speedo_spkgs += \ pinentry gpa +endif ifeq ($(TARGETOS),w32) speedo_spkgs += \ @@ -134,6 +197,7 @@ speedo_make_only_style = \ zlib # Get the content of the software DB. +ifeq ($(UPD_SWDB),1) SWDB := $(shell $(topsrc)/build-aux/getswdb.sh && echo okay) ifeq ($(strip $(SWDB)),) $(error Error getting GnuPG software version database) @@ -141,15 +205,33 @@ endif # Version numbers of the released packages gnupg_ver = $(shell cat $(topsrc)/VERSION) -libgpg_error_ver = $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst) -npth_ver = $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst) -libgcrypt_ver = $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst) -libassuan_ver = $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst) -libksba_ver = $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst) -gpgme_ver = $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst) -pinentry_ver = $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst) -gpa_ver = $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst) -gpgex_ver = $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst) + +libgpg_error_ver := $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst) +libgpg_error_sha1:= $(shell awk '$$1=="libgpg_error_sha1" {print $$2}' swdb.lst) + +npth_ver := $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst) +npth_sha1 := $(shell awk '$$1=="npth_sha1" {print $$2}' swdb.lst) + +libgcrypt_ver := $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst) +libgcrypt_sha1 := $(shell awk '$$1=="libgcrypt_sha1" {print $$2}' swdb.lst) + +libassuan_ver := $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst) +libassuan_sha1 := $(shell awk '$$1=="libassuan_sha1" {print $$2}' swdb.lst) + +libksba_ver := $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst) +libksba_sha1 := $(shell awk '$$1=="libksba_sha1" {print $$2}' swdb.lst) + +gpgme_ver := $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst) +gpgme_sha1 := $(shell awk '$$1=="gpgme_sha1" {print $$2}' swdb.lst) + +pinentry_ver := $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst) +pinentry_sha1 := $(shell awk '$$1=="pinentry_sha1" {print $$2}' swdb.lst) + +gpa_ver := $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst) +gpa_sha1 := $(shell awk '$$1=="gpa_sha1" {print $$2}' swdb.lst) + +gpgex_ver := $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst) +gpgex_sha1 := $(shell awk '$$1=="gpgex_sha1" {print $$2}' swdb.lst) $(info Information from the version database) $(info GnuPG ..........: $(gnupg_ver)) @@ -161,7 +243,7 @@ $(info GPGME ..........: $(gpgme_ver)) $(info Pinentry .......: $(pinentry_ver)) $(info GPA ............: $(gpa_ver)) $(info GpgEX.... ......: $(gpgex_ver)) - +endif # Version number for external packages pkg_config_ver = 0.23 @@ -324,6 +406,7 @@ speedo_pkg_w64_gpgex_configure = \ # External packages # +ifeq ($(TARGETOS),w32) speedo_pkg_zlib_make_args = \ -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a @@ -353,6 +436,9 @@ echo "dlpreopen=''" >> lib/libz.la; \ echo "libdir=\"$(idir)/lib\"" >> lib/libz.la) endef +endif + + speedo_pkg_w64_libiconv_configure = \ --enable-shared=no --enable-static=yes @@ -370,7 +456,7 @@ speedo_pkg_gettext_make_dir = gettext-runtime speedo_pkg_glib_configure = \ --disable-modular-tests \ - --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \ + --with-libiconv=gnu \ CPPFLAGS=-I$(idir)/include \ LDFLAGS=-L$(idir)/lib \ CCC=$(host)-g++ \ @@ -380,19 +466,36 @@ ifeq ($(TARGETOS),w32) speedo_pkg_glib_extracflags = -march=i486 endif +ifeq ($(TARGETOS),w32) speedo_pkg_libpng_configure = \ CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" \ LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\" +else +speedo_pkg_libpng_configure = \ + CPPFLAGS=\"-I$(idir)/include\" \ + LDFLAGS=\"-L$(idir)/lib\" +endif + +ifneq ($(TARGETOS),w32) +speedo_pkg_gdk_pixbuf_configure = --without-libtiff --without-libjpeg +endif speedo_pkg_pixman_configure = \ CPPFLAGS=-I$(idir)/include \ LDFLAGS=-L$(idir)/lib +ifeq ($(TARGETOS),w32) speedo_pkg_cairo_configure = \ --disable-qt --disable-ft --disable-fc \ --enable-win32 --enable-win32-font \ CPPFLAGS=-I$(idir)/include \ LDFLAGS=-L$(idir)/lib +else +speedo_pkg_cairo_configure = \ + --disable-qt \ + CPPFLAGS=-I$(idir)/include \ + LDFLAGS=-L$(idir)/lib +endif speedo_pkg_pango_configure = \ --disable-gtk-doc \ @@ -490,60 +593,76 @@ endef # Set a couple of common variables. define SETVARS - pkg="$(1)"; \ - git="$(call GETVAR,speedo_pkg_$(1)_git)"; \ - gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \ - tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \ - pkgsdir="$(sdir)/$(1)"; \ - if [ "$(1)" = "gnupg" ]; then \ - git=''; \ - gitref=''; \ - tar=''; \ + pkg="$(1)"; \ + git="$(call GETVAR,speedo_pkg_$(1)_git)"; \ + gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \ + tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \ + sha1="$(call GETVAR,$(1)_sha1)"; \ + pkgsdir="$(sdir)/$(1)"; \ + if [ "$(1)" = "gnupg" ]; then \ + git=''; \ + gitref=''; \ + tar=''; \ pkgsdir="$(topsrc)"; \ fi; \ - pkgbdir="$(bdir)/$(1)"; \ - pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)"; \ - pkgextracflags="$(call GETVAR,speedo_pkg_$(1)_extracflags)"; \ - pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \ - pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \ - pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \ - export PKG_CONFIG="/usr/bin/pkg-config"; \ - export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig"; \ - export PKG_CONFIG_LIBDIR=""; \ - export SYSROOT="$(idir)"; \ - export PATH="$(idir)/bin:$${PATH}"; \ - export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}" + pkgbdir="$(bdir)/$(1)"; \ + pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)"; \ + tmp="$(speedo_w32_cflags) \ + $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \ + if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \ + pkgextracflags="CFLAGS=\"$$$$tmp\""; \ + else \ + pkgextracflags=; \ + fi; \ + pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \ + pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \ + pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \ + pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \ + export PKG_CONFIG="/usr/bin/pkg-config"; \ + export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig"; \ + [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \ + export SYSROOT="$(idir)"; \ + export PATH="$(idir)/bin:$${PATH}"; \ + export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}" endef define SETVARS_W64 - pkg="$(1)"; \ - git="$(call GETVAR,speedo_pkg_$(1)_git)"; \ - gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \ - tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \ - pkgsdir="$(sdir)/$(1)"; \ - if [ "$(1)" = "gnupg" ]; then \ - git=''; \ - gitref=''; \ - tar=''; \ + pkg="$(1)"; \ + git="$(call GETVAR,speedo_pkg_$(1)_git)"; \ + gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \ + tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \ + sha1="$(call GETVAR,$(1)_sha1)"; \ + pkgsdir="$(sdir)/$(1)"; \ + if [ "$(1)" = "gnupg" ]; then \ + git=''; \ + gitref=''; \ + tar=''; \ pkgsdir="$(topsrc)"; \ fi; \ - pkgbdir="$(bdir6)/$(1)"; \ - pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)"; \ - pkgextracflags="$(call GETVAR,speedo_pkg_$(1)_extracflags)"; \ - pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \ - pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \ - pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \ - export PKG_CONFIG="/usr/bin/pkg-config"; \ - export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig"; \ - export PKG_CONFIG_LIBDIR=""; \ - export SYSROOT="$(idir6)"; \ - export PATH="$(idir6)/bin:$${PATH}"; \ - export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}" + pkgbdir="$(bdir6)/$(1)"; \ + pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)"; \ + tmp="$(speedo_w32_cflags) \ + $(call GETVAR,speedo_pkg_$(1)_extracflags)"; \ + if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then \ + pkgextracflags="CFLAGS=\"$$$$tmp\""; \ + else \ + pkgextracflags=; \ + fi; \ + pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)"; \ + pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)"; \ + pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \ + pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \ + export PKG_CONFIG="/usr/bin/pkg-config"; \ + export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig"; \ + [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR=""; \ + export SYSROOT="$(idir6)"; \ + export PATH="$(idir6)/bin:$${PATH}"; \ + export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}" endef # Template for source packages. -# + # Note that the gnupg package is special: The package source dir is # the same as the topsrc dir and thus we need to detect the gnupg # package and cd to that directory. We also test that no in-source build @@ -580,11 +699,27 @@ $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories *.xz) opt=J ;; \ *) opt= ;; \ esac; \ + [ -f tmp.tgz ] && rm tmp.tgz; \ case "$$$${tar}" in \ - /*) cmd=cat ;; \ - *) cmd="wget -q -O -" ;; \ + /*) tar x$$$${opt}f - < $$$${tar} ;; \ + *) wget -q -O - $$$${tar} | tee tmp.tgz | tar x$$$${opt}f - ;; \ esac; \ - $$$${cmd} "$$$${tar}" | tar x$$$${opt}f - ; \ + if [ -f tmp.tgz ]; then \ + if [ -n "$$$${sha1}" ]; then \ + tmp=$$$$(sha1sum /dev/null && \ $(MAKE) --no-print-directory \ - $$$${pkgmkargs_inst} uninstall V=0 ) || true ;\ + $$$${pkgmkargs_uninst} uninstall V=0 ) || true;\ if [ "$(1)" = "gnupg" ]; then \ rm -fR "$$$${pkgbdir}" || true ;\ else \ @@ -851,7 +983,7 @@ w32_insthelpers: $(bdir)/g4wihelp.dll $(bdir)/inst-options.ini: $(w32src)/inst-options.ini cat $(w32src)/inst-options.ini >$(bdir)/inst-options.ini -installer: all w32_insthelpers $(bdir)/inst-options.ini $(bdir)/README.txt +installer: all w32_insthelpers $(w32dir)/inst-options.ini $(bdir)/README.txt $(MAKENSIS) -V2 \ -DINST_DIR=$(idir) \ -DINST6_DIR=$(idir6) \ @@ -868,5 +1000,5 @@ installer: all w32_insthelpers $(bdir)/inst-options.ini $(bdir)/README.txt # # Mark phony targets # -.PHONY: all-speedo report-speedo clean-stamps clean-speedo installer \ +.PHONY: all all-speedo report-speedo clean-stamps clean-speedo installer \ w32_insthelpers diff --git a/build-aux/speedo/patches/libiconv-1.14.patch b/build-aux/speedo/patches/libiconv-1.14.patch new file mode 100755 index 000000000..5e606897f --- /dev/null +++ b/build-aux/speedo/patches/libiconv-1.14.patch @@ -0,0 +1,19 @@ +#! /bin/sh +patch -p0 -l -f $* < $0 +exit $? + +On some systems the gets macro has been removed and thus the test +leads to an unresolved symbol error. + +--- srclib/stdio.in.h~ 2011-08-07 15:42:06.000000000 +0200 ++++ srclib/stdio.in.h 2014-09-04 13:07:07.079024312 +0200 +@@ -691,11 +691,6 @@ + _GL_CXXALIAS_SYS (gets, char *, (char *s)); + # undef gets + # endif +-_GL_CXXALIASWARN (gets); +-/* It is very rare that the developer ever has full control of stdin, +- so any use of gets warrants an unconditional warning. Assume it is +- always declared, since it is required by C89. */ +-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); + #endif