about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gspell
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gspell')
-rw-r--r--nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/gspell/default.nix79
2 files changed, 108 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch b/nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch
new file mode 100644
index 000000000000..6200dca189f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch
@@ -0,0 +1,29 @@
+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
+@@ -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/nixpkgs/pkgs/development/libraries/gspell/default.nix b/nixpkgs/pkgs/development/libraries/gspell/default.nix
new file mode 100644
index 000000000000..c4d15352020a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gspell/default.nix
@@ -0,0 +1,79 @@
+{ stdenv
+, lib
+, buildPackages
+, fetchurl
+, pkg-config
+, libxml2
+, autoreconfHook
+, gtk-doc
+, glib
+, gtk3
+, enchant2
+, icu
+, vala
+, gobject-introspection
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gspell";
+  version = "1.12.2";
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "tOmTvYJ+TOtqdwsbXolQ/OO+nIsrDL6yL9+ZKAjdITk=";
+  };
+
+  patches = [
+    # Extracted from: https://github.com/Homebrew/homebrew-core/blob/2a27fb86b08afc7ae6dff79cf64aafb8ecc93275/Formula/gspell.rb#L125-L149
+    # Dropped the GTK_MAC_* changes since gtk-mac-integration is not needed since 1.12.1
+    ./0001-Darwin-build-fix.patch
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    vala
+    gobject-introspection
+    libxml2
+    autoreconfHook
+    gtk-doc
+    glib
+  ];
+
+  buildInputs = [
+    gtk3
+    icu
+    vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN)
+  ];
+
+  propagatedBuildInputs = [
+    # required for pkg-config
+    enchant2
+  ];
+
+  configureFlags = [
+    "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources"
+    "GLIB_MKENUMS=${lib.getDev buildPackages.glib}/bin/glib-mkenums"
+    "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen"
+    "--enable-introspection=yes"
+    "--enable-vala=yes"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "A spell-checking library for GTK applications";
+    homepage = "https://wiki.gnome.org/Projects/gspell";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}