gspell: Enable building on Darwin

This commit is contained in:
OPNA2608 2021-06-13 22:04:27 +02:00
parent 301a1bd82d
commit 967beef69f
2 changed files with 50 additions and 1 deletions

View file

@ -0,0 +1,37 @@
From 2d6dd1c286eb57fbf968510318cafc94888b98de Mon Sep 17 00:00:00 2001
From: OPNA2608 <christoph.neidahl@gmail.com>
Date: Sun, 13 Jun 2021 21:56:03 +0200
Subject: [PATCH] Darwin build fix
---
gspell/Makefile.am | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/gspell/Makefile.am b/gspell/Makefile.am
index 69ee421..7c58973 100644
--- a/gspell/Makefile.am
+++ b/gspell/Makefile.am
@@ -95,6 +95,7 @@ nodist_libgspell_core_la_SOURCES = \
$(BUILT_SOURCES)
libgspell_core_la_LIBADD = \
+ $(GTK_MAC_LIBS) \
$(CODE_COVERAGE_LIBS)
libgspell_core_la_CFLAGS = \
@@ -161,6 +162,12 @@ gspell_private_headers += \
gspell_private_c_files += \
gspell-osx.c
+libgspell_core_la_CFLAGS += \
+ -xobjective-c
+
+libgspell_core_la_LDFLAGS += \
+ -framework Cocoa
+
endif # OS_OSX
if HAVE_INTROSPECTION
--
2.29.3

View file

@ -2,6 +2,8 @@
, fetchurl
, pkg-config
, libxml2
, autoreconfHook
, gtk-doc
, glib
, gtk3
, enchant2
@ -9,6 +11,7 @@
, vala
, gobject-introspection
, gnome
, gtk-mac-integration
}:
stdenv.mkDerivation rec {
@ -23,17 +26,26 @@ stdenv.mkDerivation rec {
sha256 = "1pdb4gbjrs8mk6r0ipw5vxyvzav1wvkjq46kiq53r3nyznfpdfyw";
};
patches = [
# Extracted from: https://github.com/Homebrew/homebrew-core/blob/2a27fb86b08afc7ae6dff79cf64aafb8ecc93275/Formula/gspell.rb#L125-L149
./0001-Darwin-build-fix.patch
];
nativeBuildInputs = [
pkg-config
vala
gobject-introspection
libxml2
autoreconfHook
gtk-doc
];
buildInputs = [
glib
gtk3
icu
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
gtk-mac-integration
];
propagatedBuildInputs = [
@ -53,6 +65,6 @@ stdenv.mkDerivation rec {
homepage = "https://wiki.gnome.org/Projects/gspell";
license = licenses.lgpl21Plus;
maintainers = teams.gnome.members;
platforms = platforms.linux;
platforms = platforms.unix;
};
}