about summary refs log tree commit diff
path: root/pkgs/applications/editors/gedit
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2023-07-05 03:07:20 +0200
committerJan Tojnar <jtojnar@gmail.com>2023-07-05 14:56:27 +0200
commit6bbcd65c4486d09395e37ce10fbbcb9b3f58c371 (patch)
treec2ddfd339769d2ba7b0c748d371d3580b79026ba /pkgs/applications/editors/gedit
parentca73307a6699e193caafc949d587e88b9bf55e83 (diff)
gedit: Move out of GNOME
It has been moved out of GNOME core in favour of gnome-text-editor.
And it is not much of a GNOME app anymore either, using custom gtksourceview fork.
Diffstat (limited to 'pkgs/applications/editors/gedit')
-rw-r--r--pkgs/applications/editors/gedit/correct-gir-lib-path.patch13
-rw-r--r--pkgs/applications/editors/gedit/default.nix99
2 files changed, 112 insertions, 0 deletions
diff --git a/pkgs/applications/editors/gedit/correct-gir-lib-path.patch b/pkgs/applications/editors/gedit/correct-gir-lib-path.patch
new file mode 100644
index 0000000000000..b3689e4206693
--- /dev/null
+++ b/pkgs/applications/editors/gedit/correct-gir-lib-path.patch
@@ -0,0 +1,13 @@
+diff --git a/gedit/meson.build b/gedit/meson.build
+index a8683e61a..fc48669f7 100644
+--- a/gedit/meson.build
++++ b/gedit/meson.build
+@@ -191,7 +191,7 @@ libgedit_shared_lib = shared_library(
+   c_args: libgedit_c_args,
+   link_args: libgedit_link_args,
+   install: true,
+-  install_dir: get_option('libdir') / 'gedit',
++  install_dir: get_option('prefix') / get_option('libdir') / 'gedit',
+ )
+ 
+ # GObject Introspection
diff --git a/pkgs/applications/editors/gedit/default.nix b/pkgs/applications/editors/gedit/default.nix
new file mode 100644
index 0000000000000..3d79656d25823
--- /dev/null
+++ b/pkgs/applications/editors/gedit/default.nix
@@ -0,0 +1,99 @@
+{ stdenv
+, lib
+, meson
+, fetchurl
+, python3
+, pkg-config
+, gtk3
+, gtk-mac-integration
+, glib
+, amtk
+, tepl
+, libpeas
+, libxml2
+, gtksourceview4
+, gsettings-desktop-schemas
+, wrapGAppsHook
+, gtk-doc
+, docbook-xsl-nons
+, ninja
+, libsoup
+, gnome
+, gspell
+, perl
+, itstool
+, desktop-file-utils
+, vala
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gedit";
+  version = "44.2";
+
+  outputs = [ "out" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gedit/${lib.versions.major version}/gedit-${version}.tar.xz";
+    sha256 = "O7sbN3XUwnfa9UqqtEsOuDpOsfCfA5GAAEHJ5WiT7BE=";
+  };
+
+  patches = [
+    # We patch gobject-introspection and meson to store absolute paths to libraries in typelibs
+    # but that requires the install_dir is an absolute path.
+    ./correct-gir-lib-path.patch
+  ];
+
+  nativeBuildInputs = [
+    desktop-file-utils
+    itstool
+    libxml2
+    meson
+    ninja
+    perl
+    pkg-config
+    python3
+    vala
+    wrapGAppsHook
+    gtk-doc
+    docbook-xsl-nons
+  ];
+
+  buildInputs = [
+    amtk
+    tepl
+    glib
+    gsettings-desktop-schemas
+    gspell
+    gtk3
+    gtksourceview4
+    libpeas
+    libsoup
+  ] ++ lib.optionals stdenv.isDarwin [
+    gtk-mac-integration
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/meson/post_install.py
+    chmod +x plugins/externaltools/scripts/gedit-tool-merge.pl
+    patchShebangs build-aux/meson/post_install.py
+    patchShebangs plugins/externaltools/scripts/gedit-tool-merge.pl
+  '';
+
+  # Reliably fails to generate gedit-file-browser-enum-types.h in time
+  enableParallelBuilding = false;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gedit";
+      attrPath = "gnome.gedit";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Apps/Gedit";
+    description = "Official text editor of the GNOME desktop environment";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}