# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

#Ebuild based on bgo-overlay and imaging overlays

EAPI=7

inherit autotools

DESCRIPTION="ETL is a multi-platform class and template library"
HOMEPAGE="https://www.synfig.org/"

MY_PN="synfig"
MY_PV=${PV}
MY_P=${MY_PN}-${MY_PV}

SRC_URI="https://github.com/${MY_PN}/${MY_PN}/archive/v${MY_PV}.tar.gz -> ${MY_P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="virtual/pkgconfig"

S=${WORKDIR}/${MY_P}/${PN}
B=${WORKDIR}/${MY_P}/${PN}_build

src_prepare() {
	sed -i.bck 's|etlincludedir=$includedir/ETL|etlincludedir=$includedir|' "${S}"/configure.ac
	eautoreconf
	eapply_user
	mkdir ${B}
}

src_configure() {
	cd ${B}; ECONF_SOURCE=${S} econf
}

src_compile() {
	cd ${B}; emake
}

src_install() {
	cd ${B}; emake DESTDIR="${D}" install
	dodoc ${S}/{AUTHORS,NEWS,README}
}