gpg4libre: add glib2 dependency for Windows

Change-Id: Ib6b5393323a4dbfe94ea89689ac9170f8afa3899
Reviewed-on: https://gerrit.libreoffice.org/44856
Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
Thorsten Behrens 2017-11-17 04:37:29 +01:00
parent 5fccf17f33
commit daee5fc556
14 changed files with 5744 additions and 1 deletions

View file

@ -128,6 +128,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
$(call fetch_Optional,EPOXY,EPOXY_TARBALL) \
$(call fetch_Optional,GLM,GLM_TARBALL) \
$(call fetch_Optional,GLIB2,GLIB2_TARBALL) \
$(call fetch_Optional,GPGMEPP,GPGME_TARBALL) \
$(call fetch_Optional,GRAPHITE,GRAPHITE_TARBALL) \
$(call fetch_Optional,HARFBUZZ,HARFBUZZ_TARBALL) \

View file

@ -10151,8 +10151,11 @@ if test "$_os" = "Linux" -o "$_os" = "Darwin"; then
[AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], [])
else
AC_MSG_RESULT([internal])
BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
AC_DEFINE([GPGME_CAN_EXPORT_MINIMAL_KEY])
BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
if test "$_os" = "WINNT"; then
BUILD_TYPE="$BUILD_TYPE GLIB2"
fi
GPG_ERROR_CFLAGS="-I${WORKDIR}/UnpackedTarball/libgpg-error/src"
GPG_ERROR_LIBS="-L${WORKDIR}/UnpackedTarball/libgpg-error/src/.libs -lgpg-error"

View file

@ -78,6 +78,8 @@ export FREEHAND_SHA256SUM := 0e422d1564a6dbf22a9af598535425271e583514c0f7ba7d909
export FREEHAND_TARBALL := libfreehand-0.1.2.tar.xz
export FREETYPE_SHA256SUM := e5435f02e02d2b87bb8e4efdcaa14b1f78c9cf3ab1ed80f94b6382fb6acc7d78
export FREETYPE_TARBALL := freetype-2.8.1.tar.bz2
export GLIB2_SHA256SUM := 4d7ca95dbde8e8f60ab428c765b0dbb8a44be9eb9316491803ce5ee7b4748353
export GLIB2_TARBALL := glib-2.28.8.tar.xz
export GLM_SHA256SUM := d0312c360efe04dd048b3311fe375ff36f1993b4c2e3cb58c81062990532904a
export GLM_TARBALL := bae83fa5dc7f081768daace6e199adc3-glm-0.9.4.6-libreoffice.zip
export GPGME_SHA256SUM := 1b29fedb8bfad775e70eafac5b0590621683b2d9869db994568e6401f4034ceb

View file

@ -41,6 +41,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,FONTCONFIG,fontconfig) \
$(call gb_Helper_optional,FREEHAND,libfreehand) \
$(call gb_Helper_optional,FREETYPE,freetype) \
$(call gb_Helper_optional,GLIB2,glib2) \
$(call gb_Helper_optional,GLM,glm) \
$(call gb_Helper_optional,GPGMEPP,gpgme) \
$(call gb_Helper_optional,GRAPHITE,graphite) \

14
external/glib2/ExternalPackage_glib2.mk vendored Normal file
View file

@ -0,0 +1,14 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_ExternalPackage_ExternalPackage,glib2,glib2))
$(eval $(call gb_ExternalPackage_use_external_project,glib2,glib2))
# vim: set noet sw=4 ts=4:

33
external/glib2/ExternalProject_glib2.mk vendored Normal file
View file

@ -0,0 +1,33 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_ExternalProject_ExternalProject,glib2))
ifeq ($(OS),WNT)
$(eval $(call gb_ExternalProject_register_targets,glib2,\
build \
))
$(eval $(call gb_ExternalProject_use_external,glib2,zlib))
# get local copies of zlib.h & zlib.lib (glib imposes fixed dir
# structure on that), run native msbuild for binaries then
$(call gb_ExternalProject_get_state_target,glib2,build):
$(call gb_ExternalProject_run,build,\
mkdir -p $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)/etc/include && \
cp $(WORKDIR)/UnpackedTarball/zlib/zlib.h $(WORKDIR)/UnpackedTarball/zlib/zconf.h */etc/include/ && \
mkdir -p $(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)/etc/lib && \
cp $(WORKDIR)/LinkTarget/StaticLibrary/zlib.lib */etc/lib/ && \
msbuild.exe glib.sln \
/p:GlibEtcInstallRoot=./$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release)/etc \
/p:Configuration=$(if $(MSVC_USE_DEBUG_RUNTIME),Debug,Release) \
,build/win32/vs10)
endif
# vim: set noet sw=4 ts=4:

7
external/glib2/Makefile vendored Normal file
View file

@ -0,0 +1,7 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
include $(module_directory)/../../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:

18
external/glib2/Module_glib2.mk vendored Normal file
View file

@ -0,0 +1,18 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Module_Module,glib2))
$(eval $(call gb_Module_add_targets,glib2,\
ExternalPackage_glib2 \
ExternalProject_glib2 \
UnpackedTarball_glib2 \
))
# vim: set noet sw=4 ts=4:

1
external/glib2/README vendored Normal file
View file

@ -0,0 +1 @@
GLib2 lib, for gpgme on Windows, from [https://github.com/GNOME/glib/releases]

21
external/glib2/UnpackedTarball_glib2.mk vendored Normal file
View file

@ -0,0 +1,21 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_UnpackedTarball_UnpackedTarball,glib2))
$(eval $(call gb_UnpackedTarball_set_tarball,glib2,$(GLIB2_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,glib2,\
external/glib2/glib-upgrade-vs12.patch.1 \
external/glib2/glib-disable-libintl.patch.1 \
external/glib2/glib-fix-broken-includes.patch.1 \
external/glib2/glib-remove-wgetmainargs.patch.1 \
))
# vim: set noet sw=4 ts=4:

View file

@ -0,0 +1,26 @@
diff -ur glib2.org/build/win32/vs10/glib.props glib2/build/win32/vs10/glib.props
--- glib2.org/build/win32/vs10/glib.props 2017-11-16 23:53:51.710733000 +0100
+++ glib2/build/win32/vs10/glib.props 2017-11-17 16:43:34.326253400 +0100
@@ -464,10 +464,6 @@
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
</ClCompile>
- <Link>
- <AdditionalDependencies>intl.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(GlibEtcInstallRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
<PreBuildEvent>
<Command>
if exist ..\..\..\config.h goto DONE_CONFIG_H
diff -ur glib2.org/config.h.win32 glib2/config.h.win32
--- glib2.org/config.h.win32 2017-11-16 23:53:51.523015800 +0100
+++ glib2/config.h.win32 2017-11-17 16:37:29.286580700 +0100
@@ -26,7 +26,7 @@
/* #undef ENABLE_GC_FRIENDLY_DEFAULT */
/* always defined to indicate that i18n is enabled */
-#define ENABLE_NLS 1
+/* #define ENABLE_NLS 1 */
/* include GRegex */
#define ENABLE_REGEX /**/

View file

@ -0,0 +1,24 @@
diff -ur glib2.org/build/win32/vs10/glib.props glib2/build/win32/vs10/glib.props
--- glib2.org/build/win32/vs10/glib.props 2017-11-18 00:24:16.017422400 +0100
+++ glib2/build/win32/vs10/glib.props 2017-11-18 00:26:26.886453600 +0100
@@ -460,7 +460,7 @@
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
- <AdditionalIncludeDirectories>..\..\..;..\..\..\glib;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>..\..\..;..\..\..\glib;..\..\..\gmodule;$(GlibEtcInstallRoot)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_DEPRECATED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
</ClCompile>
diff -ur glib2.org/glib/gi18n.h glib2/glib/gi18n.h
--- glib2.org/glib/gi18n.h 2017-11-18 00:24:17.221625400 +0100
+++ glib2/glib/gi18n.h 2017-11-18 00:35:17.729524800 +0100
@@ -22,7 +22,7 @@
#include <glib.h>
-#include <libintl.h>
+#include <glibintl.h>
#include <string.h>
#define _(String) gettext (String)

View file

@ -0,0 +1,83 @@
From 3cc349b04e76880a9d2f3c3d2195d171e110f66c Mon Sep 17 00:00:00 2001
From: TingPing <tingping@tingping.se>
Date: Sat, 20 Dec 2014 18:39:00 -0500
Subject: [PATCH] win32: Replace usage of __wgetmainargs()
It was an internal function that has been removed with VS 2015
Use g_win32_get_command_line() or CommandLineToArgvW() directly.
https://bugzilla.gnome.org/show_bug.cgi?id=741822
---
glib/gspawn-win32-helper.c | 20 +++----------------
glib/gspawn.c | 9 ++-------
3 files changed, 22 insertions(+), 56 deletions(-)
diff -ur glib2.org/glib/gspawn.c glib2/glib/gspawn.c
--- glib2.org/glib/gspawn.c 2017-11-16 23:53:53.619191200 +0100
+++ glib2/glib/gspawn.c 2017-11-17 21:48:54.905453400 +0100
@@ -480,13 +480,8 @@
* main(). wmain() has a wide character argument vector as parameter.
*
* At least currently, mingw doesn't support wmain(), so if you use
- * mingw to develop the spawned program, it will have to call the
- * undocumented function __wgetmainargs() to get the wide character
- * argument vector and environment. See gspawn-win32-helper.c in the
- * GLib sources or init.c in the mingw runtime sources for a prototype
- * for that function. Alternatively, you can retrieve the Win32 system
- * level wide character command line passed to the spawned program
- * using the GetCommandLineW() function.
+ * mingw to develop the spawned program, it should call
+ * g_win32_get_command_line() to get arguments in UTF-8.
*
* On Windows the low-level child process creation API
* <function>CreateProcess()</function> doesn't use argument vectors,
diff -ur glib2.org/glib/gspawn-win32-helper.c glib2/glib/gspawn-win32-helper.c
--- glib2.org/glib/gspawn-win32-helper.c 2017-11-16 23:53:53.556618800 +0100
+++ glib2/glib/gspawn-win32-helper.c 2017-11-17 21:48:16.887044400 +0100
@@ -54,20 +54,6 @@
* away in the global __argc and __argv by the C runtime startup code.
*/
-/* Info peeked from mingw runtime's source code. __wgetmainargs() is a
- * function to get the program's argv in wide char format.
- */
-
-typedef struct {
- int newmode;
-} _startupinfo;
-
-extern void __wgetmainargs(int *argc,
- wchar_t ***wargv,
- wchar_t ***wenviron,
- int expand_wildcards,
- _startupinfo *startupinfo);
-
/* Copy of protect_argv that handles wchar_t strings */
static gint
@@ -169,14 +155,13 @@
gint argv_zero_offset = ARG_PROGRAM;
wchar_t **new_wargv;
int argc;
- wchar_t **wargv, **wenvp;
- _startupinfo si = { 0 };
+ wchar_t **wargv;
char c;
g_assert (__argc >= ARG_COUNT);
/* Fetch the wide-char argument vector */
- __wgetmainargs (&argc, &wargv, &wenvp, 0, &si);
+ wargv = CommandLineToArgvW (GetCommandLineW(), &argc);
/* We still have the system codepage args in __argv. We can look
* at the first args in which gspawn-win32.c passes us flags and
@@ -329,5 +314,7 @@
read (helper_sync_fd, &c, 1);
+ LocalFree (wargv);
+
return 0;
}

5509
external/glib2/glib-upgrade-vs12.patch.1 vendored Normal file

File diff suppressed because it is too large Load diff