From 59d5e80f4899181d87bb6e2c0e69e4513b5a88ed Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Tue, 13 May 2014 15:37:41 +0200
Subject: [PATCH] hexchat: split perl/python plugins into subpkgs; remove
 useless header.

---
 srcpkgs/hexchat-perl     |  1 +
 srcpkgs/hexchat-python   |  1 +
 srcpkgs/hexchat/template | 36 ++++++++++++++++++++++++++++++------
 3 files changed, 32 insertions(+), 6 deletions(-)
 create mode 120000 srcpkgs/hexchat-perl
 create mode 120000 srcpkgs/hexchat-python

diff --git a/srcpkgs/hexchat-perl b/srcpkgs/hexchat-perl
new file mode 120000
index 0000000000..6cf68e662f
--- /dev/null
+++ b/srcpkgs/hexchat-perl
@@ -0,0 +1 @@
+hexchat
\ No newline at end of file
diff --git a/srcpkgs/hexchat-python b/srcpkgs/hexchat-python
new file mode 120000
index 0000000000..6cf68e662f
--- /dev/null
+++ b/srcpkgs/hexchat-python
@@ -0,0 +1 @@
+hexchat
\ No newline at end of file
diff --git a/srcpkgs/hexchat/template b/srcpkgs/hexchat/template
index 924fa4a0bc..f5cc829cbc 100644
--- a/srcpkgs/hexchat/template
+++ b/srcpkgs/hexchat/template
@@ -1,21 +1,22 @@
 # Template file for 'hexchat'
 pkgname=hexchat
 version=2.9.6.1
-revision=1
+revision=2
 lib32disabled=yes
 build_style=gnu-configure
-hostmakedepends="pkg-config gdk-pixbuf-devel "
+hostmakedepends="pkg-config gdk-pixbuf-devel"
 makedepends="gtk+-devel openssl-devel dbus-glib-devel perl python-devel 
-        libnotify-devel libcanberra-devel libxml2-devel"
-configure_args=" --sysconfdir=/etc --enable-openssl --enable-dbus
-	--disable-textfe --enable-ipv6 --enable-shm --enable-spell=static"
+ libnotify-devel libcanberra-devel libxml2-devel pciutils-devel
+ desktop-file-utils"
+depends="desktop-file-utils"
+configure_args=" --enable-openssl --enable-dbus
+ --disable-textfe --enable-ipv6 --enable-shm --enable-spell=static"
 short_desc="A GTK+ based IRC client successor of Xchat"
 maintainer="Carlo Dormeletti <carlo.dormeletti@email.it>"
 homepage="http://hexchat.github.io/"
 license="GPL"
 distfiles="http://dl.hexchat.net/hexchat/${pkgname}-${version}.tar.xz"
 checksum=6267ff3c4d0aec8a808365b384115a769d5001d99dbb10403634667c43966470
-make_build_args="LDFLAGS=-lgmodule-2.0"
 
 pre_configure() {
 	local perlflags=
@@ -27,3 +28,26 @@ pre_configure() {
 		sed -i "s#PERL_LDFLAGS=#\0$perlflags#" configure
 	fi
 }
+post_install() {
+	# Remove useless files.
+	rm -rf ${DESTDIR}/usr/include
+}
+
+hexchat-perl_package() {
+	replaces="${sourcepkg}<2.9.6.1_2"
+	short_desc+=" - perl plugin"
+	depends="${sourcepkg}-${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/hexchat/plugins/perl.so
+	}
+}
+
+hexchat-python_package() {
+	replaces="${sourcepkg}<2.9.6.1_2"
+	short_desc+=" - python plugin"
+	depends="${sourcepkg}-${version}_${revision}"
+	pkg_install() {
+		vmove usr/lib/hexchat/plugins/python.so
+	}
+}
+