# Template file for 'gedit'
# keep major version in sync with gedit-plugins
pkgname=gedit
version=50.0
revision=1
_libgd_gitrev=3cccf99234288a6121b3945a25cd4ec3b7445c74
build_helper="gir"
build_style=meson
configure_args="-Dgtk_doc=false"
hostmakedepends="itstool pkg-config glib-devel gdk-pixbuf gettext
 gtk-update-icon-cache desktop-file-utils"
makedepends="gsettings-desktop-schemas-devel gspell-devel libgedit-gtksourceview-devel
 libpeas-devel libgedit-amtk-devel libgedit-tepl-devel"
depends="desktop-file-utils gsettings-desktop-schemas iso-codes"
short_desc="Text editor for GNOME"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://gedit-text-editor.org"
changelog="https://gitlab.gnome.org/World/gedit/gedit/-/raw/${version}/NEWS"
distfiles="https://gitlab.gnome.org/World/gedit/gedit/-/archive/${version}/gedit-${version}.tar.gz
 https://gitlab.gnome.org/GNOME/libgd/-/archive/${_libgd_gitrev}/libgd-${_libgd_gitrev}.tar.gz"
checksum="a00d0e85f9c6fd4ad9ba28ef07a3f4df1d37170ab8d925812446fea257d518ed
 bb1387edfd79a764241b60e1288fe1da7277137328d4b412333e2ca2cb817586"
skip_extraction="libgd-${_libgd_gitrev}.tar.gz"
shlib_provides="libgedit-50.so"

# gedit tarballs are no longer being produced for download.gnome.org.
# See: https://gitlab.gnome.org/World/gedit/gedit/-/issues/611
# The tarballs from gitlab don't automatically include git submodules.
# libgd is not versioned and is intended to be included in projects directly.
# This works around the issue by downloading the revision corresponding to
# the latest git head at the time of relesase.
post_extract() {
	vsrcextract -C subprojects/libgd "libgd-${_libgd_gitrev}.tar.gz"
}

gedit-devel_package() {
	depends="${sourcepkg}>=${version}_${revision} gtk+3-devel libglib-devel
	 libgedit-gtksourceview-devel libpeas-devel libgedit-amtk-devel libgedit-tepl-devel"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove usr/share/gedit/gir-1.0
	}
}
