# Template file for 'atomicparsley'.
pkgname=atomicparsley
version=0.9.0
revision=2
hostmakedepends="unzip"
short_desc="Lightweight program for manipulating MPEG-4 metadata"
maintainer="svenper <svenper@users.noreply.github.com>"
license="GPL-2"
homepage="http://atomicparsley.sourceforge.net"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/AtomicParsley-source-${version}.zip"
checksum=de83f219f95e6fe59099b277e3ced86f0430ad9468e845783092821dff15a72e
wrksrc=AtomicParsley-source-${version}

CXXFLAGS="-Wno-write-strings"

pre_build() {
	sed -ri 's/(char\*.*strrchr.*)/const \1/g' AtomicParsley.cpp
	sed -ri 's/(char\* suffix = NULL;)/const \1/g' AtomicParsley.cpp
	sed -ri 's/(^[[:space:]]*g\+\+)/\1 \$CXXFLAGS/g' build
	sed -ri 's/(^[[:space:]])*g\+\+/"\1\$CXX"/g' build
	sed -ri 's/(-o.*(obj_files.*){8})/\$LDFLAGS \1/g' build
}

do_build() {
	CXX="${CXX:-g++}" LD="$CXX" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ./build
}

do_install() {
	vbin AtomicParsley
	vlicense COPYING
}
