SUMMARY="A tool to unpack installers created by Inno Setup"
DESCRIPTION="Inno Setup is a tool to create installers for Microsoft Windows \
applications. innoextract allows to extract such installers under non-Windows \
systems without running the actual installer using wine. innoextract currently\
 supports installers created by Inno Setup 1.2.10 to 5.6.0.
In addition to standard Inno Setup installers, innoextract also supports some \
modified Inno Setup variants including Martijn Laan's My Inno Setup Extensions\
 3.0.6.1 as well as GOG.com's Inno Setup-based game installers."
HOMEPAGE="https://constexpr.org/innoextract/"
COPYRIGHT="2011-2019 Daniel Scharrer"
LICENSE="Zlib"
REVISION="1"
SOURCE_URI="http://constexpr.org/innoextract/files/innoextract-$portVersion.tar.gz"
CHECKSUM_SHA256="5e78f6295119eeda08a54dcac75306a1a4a40d0cb812ff3cd405e9862c285269"

ARCHITECTURES="all !x86_gcc2 ?x86"
SECONDARY_ARCHITECTURES="x86"

commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	innoextract$secondaryArchSuffix = $portVersion
	cmd:innoextract$commandSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libboost_filesystem$secondaryArchSuffix
	lib:libboost_iostreams$secondaryArchSuffix
	lib:libboost_program_options$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:liblzma$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libboost_filesystem$secondaryArchSuffix
	devel:libboost_iostreams$secondaryArchSuffix
	devel:libboost_program_options$secondaryArchSuffix
	devel:libiconv$secondaryArchSuffix
	devel:liblzma$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	export CXXFLAGS="-D_BSD_SOURCE"
	cmake . $cmakeDirArgs \
		-DCMAKE_INSTALL_BINDIR=$commandBinDir
	make $jobArgs
}

INSTALL()
{
	make install
}
