SUMMARY="A text-based IRC client"
DESCRIPTION="Irssi is an IRC client written in the C programming language.\
It uses a text-mode user interface. Numerous Perl scripts have been \
made available for Irssi to customise how it looks and operates. Plugins \
are available which add encryption and protocols such as ICQ and XMPP."
HOMEPAGE="https://irssi.org/"
COPYRIGHT="1999-2019 Timo Sirainen
	Valentin Batz (senneth, vb)
	Wouter Coekaerts (coekie)
	Jochen Eisinger (c0ffee)
	Geert Hauwaerts (Geert)
	Jilles Tjoelker (jilles)
	Alexander Færøy (ahf)
	Jase Thew (bazerka)
	dequis (dx)
	Ailin Nemui (Nei)
	Giuseppe (TheLemonMan, lemonboy)
	Emanuele Giaquinta (exg)
	David Leadbeater (dg, dgl)
	vjt
	Joel Eriksson
	Heikki Orsila
	Mark Trumbull
	Francesco Fracassi
	Toby Peterson
	Soren Jacobsen
	Kuang-che Wu
	Joost Vunderink (Garion)
	Wang WenRui
	Jean-Yves Lefort (decadix)
	Joel Eriksson
	Maarten van der Zwaart
	Noah Levitt
	Krzysztof Kowalik (Borys)
	Peder Stray
	mls
	nix
	Marcin Kowalczyk (Qrczak)
	Petr Baudis
	Bjoern Krombholz (fuchs)
	aldem-irssi
	BC-bd
	Juerd
	Han
	pv2b
	Tommi Komulainen (tommik)
	mike
	zinx
	yathen
	paul
	Leszek Matok
	tygrys
	manoj
	cph
	ganesh
	Jakub Jankowski (shasta)
	vanilla
	Tinuk
	Mark Glines
	Kjetil Ødegaard
	Chris Moore
	ComradeP
	Lauri Nurmi
	Mikko Rauhala
	loafier
	Nicolas Collignon
	Daniel Koning
	Yi-Hsuan Hsin
	Jon Mayo
	Johan Kiviniemi
	JasonX
	Lukas Mai (mauke)
	Ismael Luceno
	Thomas Karpiniec
	Svante Kvarnström
	Tom Feist (shabble)
	Sebastian Thorarensen (Sebban)
	Hans Nielsen
	Jari Matilainen (vague)
	Thibault B (isundil)
	kyak
	Vesa Pirila (Lohhari)
	Haw Loeung
	François Revol (mmuman)
	blha303
	Guillaume Brogi (guiniol)
	Adam
	Robert C Jensen
	Paul Johnson
	KindOne
	Fabian Kurz
	Todd Pratt
	xavierog"
LICENSE="GNU GPL v2
	OpenSSL GPL2 exception"
REVISION="1"
SOURCE_URI="https://github.com/irssi/irssi/releases/download/$portVersion/irssi-$portVersion.tar.gz"
CHECKSUM_SHA256="29cbb746d7e57591d8fcf799406fb28cb7c2d734bc4288cbb8b4c4e05cf99c25"

ARCHITECTURES="all ?x86_gcc2 ?x86"

GLOBAL_WRITABLE_FILES="
	settings/irssi.conf keep-old
	"

PROVIDES="
	irssi = $portVersion
	cmd:irssi = $portVersion
	"
REQUIRES="
	haiku
	lib:libglib_2.0
	lib:libiconv
	lib:libintl
	lib:libncursesw
	lib:libperl
	lib:libssl
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libglib_2.0
	devel:libncursesw
	devel:libssl
	"
BUILD_PREREQUIRES="
	cmd:autoreconf
	cmd:gcc
	cmd:ld
	cmd:libtoolize
	cmd:make
	cmd:perl
	cmd:pkg_config
	"

defineDebugInfoPackage irssi\
	"$binDir"/irssi

BUILD()
{
	autoreconf -fi
	# remove unichar typedef in SupportDefs.h
	cp /system/develop/headers/os/support/SupportDefs.h .
	sed -i 's/unichar/unichar2/' SupportDefs.h
	export CPPFLAGS="-include `pwd`/SupportDefs.h"
	runConfigure ./configure --with-perl=module --with-socks \
		--with-proxy --enable-true-color
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/irssi/modules/lib*.la
}
