From 16e4ecd883e508eeafa873303fa048b8d12c2e34 Mon Sep 17 00:00:00 2001 From: Ignacio Casal Quinteiro Date: Fri, 25 Mar 2016 23:25:20 +0100 Subject: [PATCH] gspell: add patch to fix the build --- .../0001-Extern-the-gspell-HMODULE.patch | 138 ++++++++++++++++++ mingw-w64-gspell/PKGBUILD | 8 +- 2 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 mingw-w64-gspell/0001-Extern-the-gspell-HMODULE.patch diff --git a/mingw-w64-gspell/0001-Extern-the-gspell-HMODULE.patch b/mingw-w64-gspell/0001-Extern-the-gspell-HMODULE.patch new file mode 100644 index 0000000000..8236046c29 --- /dev/null +++ b/mingw-w64-gspell/0001-Extern-the-gspell-HMODULE.patch @@ -0,0 +1,138 @@ +From 0ec8f5bfe9c51076094c5cf603484ba5e9d18ee2 Mon Sep 17 00:00:00 2001 +From: Ignacio Casal Quinteiro +Date: Fri, 25 Mar 2016 23:11:47 +0100 +Subject: [PATCH] Extern the gspell HMODULE + +This is to avoid redeclaring the DllMain function +--- + gspell/Makefile.am | 3 ++- + gspell/gspell-init.c | 1 + + gspell/gspell-init.h | 31 +++++++++++++++++++++++++++++++ + gspell/gspell-language.c | 34 ++-------------------------------- + 4 files changed, 36 insertions(+), 33 deletions(-) + create mode 100644 gspell/gspell-init.h + +diff --git a/gspell/Makefile.am b/gspell/Makefile.am +index f025b4d..4803e6c 100644 +--- a/gspell/Makefile.am ++++ b/gspell/Makefile.am +@@ -46,7 +46,8 @@ gspell_private_headers = \ + gspell-inline-checker-text-buffer.h \ + gspell-text-iter.h \ + gspell-text-region.h \ +- gspell-utils.h ++ gspell-utils.h \ ++ gspell-init.h + + gspell_private_c_files = \ + gspell-init.c \ +diff --git a/gspell/gspell-init.c b/gspell/gspell-init.c +index 0631cdb..5a88c85 100644 +--- a/gspell/gspell-init.c ++++ b/gspell/gspell-init.c +@@ -27,6 +27,7 @@ + #include + #include + #include "gconstructor.h" ++#include "gspell-init.h" + + #ifdef G_OS_WIN32 + #define WIN32_LEAN_AND_MEAN +diff --git a/gspell/gspell-init.h b/gspell/gspell-init.h +new file mode 100644 +index 0000000..bc37a15 +--- /dev/null ++++ b/gspell/gspell-init.h +@@ -0,0 +1,31 @@ ++/* ++ * This file is part of gspell, a spell-checking library. ++ * ++ * Copyright 2016 - Ignacio Casal Quinteiro ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public License ++ * along with this library; if not, see . ++ */ ++ ++#ifndef __GSPELL_INIT_H__ ++#define __GSPELL_INIT_H__ ++ ++#ifdef G_OS_WIN32 ++#define WIN32_LEAN_AND_MEAN ++#include ++extern HMODULE gspell_dll; ++#endif ++ ++#endif /* __GSPELL_INIT_H__ */ ++ ++/* ex:set ts=8 noet: */ +diff --git a/gspell/gspell-language.c b/gspell/gspell-language.c +index 42ecc95..b18c144 100644 +--- a/gspell/gspell-language.c ++++ b/gspell/gspell-language.c +@@ -21,6 +21,7 @@ + + #include "config.h" + #include "gspell-language.h" ++#include "gspell-init.h" + #include + #include + #include +@@ -62,44 +63,13 @@ G_DEFINE_BOXED_TYPE (GspellLanguage, + gspell_language_copy, + gspell_language_free) + +-#ifdef G_OS_WIN32 +- +-#ifdef DATADIR +-#undef DATADIR +-#endif +- +-#include +-static HMODULE hmodule; +- +-BOOL WINAPI +-DllMain (HINSTANCE hinstDLL, +- DWORD fdwReason, +- LPVOID lpvReserved); +- +-BOOL WINAPI +-DllMain (HINSTANCE hinstDLL, +- DWORD fdwReason, +- LPVOID lpvReserved) +-{ +- switch (fdwReason) +- { +- case DLL_PROCESS_ATTACH: +- hmodule = hinstDLL; +- break; +- } +- +- return TRUE; +-} +- +-#endif /* G_OS_WIN32 */ +- + static gchar * + get_iso_codes_prefix (void) + { + gchar *prefix = NULL; + + #ifdef G_OS_WIN32 +- prefix = g_win32_get_package_installation_directory_of_module ((gpointer) hmodule); ++ prefix = g_win32_get_package_installation_directory_of_module ((gpointer) gspell_dll); + #endif + + if (prefix == NULL) +-- +2.5.5 + diff --git a/mingw-w64-gspell/PKGBUILD b/mingw-w64-gspell/PKGBUILD index c1faf2058a..367ba9852f 100644 --- a/mingw-w64-gspell/PKGBUILD +++ b/mingw-w64-gspell/PKGBUILD @@ -18,12 +18,16 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-vala" "${MINGW_PACKAGE_PREFIX}-gobject-introspection") license=("GPL 2") url="https://www.gnome.org" -source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz) -sha256sums=('6a50257c871c318445881c115bdd11bb8da6672f7d5b99e96c2e7b5c00f077da') +source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz + 0001-Extern-the-gspell-HMODULE.patch) +sha256sums=('6a50257c871c318445881c115bdd11bb8da6672f7d5b99e96c2e7b5c00f077da' + '74158a733120ae8df4bf601b7e8f18f76640f8e6781fe2681b5b6c7a101c304f') prepare() { cd "${srcdir}"/${_realname}-${pkgver} + patch -Np1 -i "${srcdir}"/0001-Extern-the-gspell-HMODULE.patch + autoreconf -sf }