### this file is sourced not run
PKGVER=0.0.19
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=qucs-$PKGVER.tar.gz
MD5SUM=321b22b88099c6c8ac42ee8b7ab637a8
SRC_URL=http://downloads.sourceforge.net/qucs/$TARBALL
BUNDLE=

# because we can't build docs, we use docs from qucs-0.0.18
DOC_TARBALL=qucs-doc-0.0.18.tar.bz2
DOC_MD5SUM=c9bd622b2e5bb418aba59a9b0e4654f7
DOC_SRC_URL=http://distro.ibiblio.org/fatdog/source/710/$DOC_TARBALL

SLACKREQ='qt4-common adms'
SLACKDESC="qucs: qucs $PKGVER (Circuit Simulator)  
qucs:  
qucs: Qucs is an integrated circuit simulator which means you are able to 
qucs: setup a circuit with a graphical user interface (GUI) and simulate the 
qucs: large-signal, small-signal and noise behaviour of the circuit. After 
qucs: that simulation has finished you can view the simulation results on a 
qucs: presentation page or window.  
qucs: 
qucs: http://qucs.sourceforge.net/ 
qucs: 
qucs: 
"
SLACKSUG='freehdl iverilog'

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	TARBALL=$DOC_TARBALL SRC_URL=$DOC_SRC_URL MD5SUM=$DOC_MD5SUM &&
	pkg_check $SRC_DIR $TARBALL $MD5SUM &&
	cp $SRC_DIR/$TARBALL tmp
}

### default pkg_package
### build
pkg_build() {
	export PATH="$PATH:/opt/qt4/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt4/lib64"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt4/lib64/pkgconfig"
	export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:/opt/qt4/include"
	export QT4_PATH="/opt/qt4/bin"
	export QT4_LD_LIBRARY_PATH="/opt/qt4/lib64"
	export QT4_PKG_CONFIG_PATH="/opt/qt4/lib64/pkgconfig"
	export QT4_CPLUS_INCLUDE_PATH="/opt/qt4/include" 
	
	export QTDIR=/opt/qt4
	export LDFLAGS="$LDFLAGS -L/opt/qt4/lib64"

	# version 0.0.19 can't build docs, we don't have the tools
	CONFFLAGS="$CONFFLAGS --disable-doc" 
	pkg_build_autoconf &&
	pkg_build_slackdesc &&

	# version 0.0.18 comes with prebuilt docs, so we use that
	tar -xf /tmp/$DOC_TARBALL -C /usr/share/qucs/docs --strip-components=1
}


