gspell: add patch to fix the build
This commit is contained in:
138
mingw-w64-gspell/0001-Extern-the-gspell-HMODULE.patch
Normal file
138
mingw-w64-gspell/0001-Extern-the-gspell-HMODULE.patch
Normal file
@@ -0,0 +1,138 @@
|
||||
From 0ec8f5bfe9c51076094c5cf603484ba5e9d18ee2 Mon Sep 17 00:00:00 2001
|
||||
From: Ignacio Casal Quinteiro <icq@gnome.org>
|
||||
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 <glib.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#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 <icq@gnome.org>
|
||||
+ *
|
||||
+ * 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 <http://www.gnu.org/licenses/>.
|
||||
+ */
|
||||
+
|
||||
+#ifndef __GSPELL_INIT_H__
|
||||
+#define __GSPELL_INIT_H__
|
||||
+
|
||||
+#ifdef G_OS_WIN32
|
||||
+#define WIN32_LEAN_AND_MEAN
|
||||
+#include <windows.h>
|
||||
+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 <string.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <enchant.h>
|
||||
@@ -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 <shlobj.h>
|
||||
-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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user