From 967beef69ff02a50d82df2ded75e46348fe14de9 Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 13 Jun 2021 22:04:27 +0200 Subject: [PATCH] gspell: Enable building on Darwin --- .../gspell/0001-Darwin-build-fix.patch | 37 +++++++++++++++++++ pkgs/development/libraries/gspell/default.nix | 14 ++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch diff --git a/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch b/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch new file mode 100644 index 00000000000..b2e71fe3aed --- /dev/null +++ b/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch @@ -0,0 +1,37 @@ +From 2d6dd1c286eb57fbf968510318cafc94888b98de Mon Sep 17 00:00:00 2001 +From: OPNA2608 +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 + diff --git a/pkgs/development/libraries/gspell/default.nix b/pkgs/development/libraries/gspell/default.nix index f591246eaf8..be45a48090f 100644 --- a/pkgs/development/libraries/gspell/default.nix +++ b/pkgs/development/libraries/gspell/default.nix @@ -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; }; }