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

# source: james
TARBALL=HandBrake-$PKGVER-source.tar.bz2
MD5SUM=45b77785ba8be0d95bd01c2e08199776
SRC_URL=https://github.com/HandBrake/HandBrake/releases/download/$PKGVER/$TARBALL
BUNDLE=

DEPS_TARBALL=HandBrake-$PKGVER-external-deps.tar
DEPS_MD5SUM=35c88343a41629a0dcc26f87504f73c8
DEPS_URL=http://distro.ibiblio.org/fatdog/source/900/$DEPS_TARBALL

SLACKREQ='gtk3 ffmpeg libx264 libx265 gstreamer2 libjansson'
SLACKDESC="handbrake: handbrake $PKGVER (Trasncoder, ripper)  
handbrake:  
handbrake: HandBrake is an open-source video transcoder available for 
handbrake: Linux, Mac, and Windows. HandBrake works with most common 
handbrake: video files and formats, including ones created by consumer 
handbrake: and professional video cameras, mobile devices such as phones 
handbrake: and tablets, game and computer screen recordings, and DVD and 
handbrake: Blu-ray discs. HandBrake leverages tools such as Libav, x264, 
handbrake: and x265 to create new MP4 or MKV video files from these 
handbrake: Sources.
handbrake: https://handbrake.fr/
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	TARBALL=$DEPS_TARBALL MD5SUM=$DEPS_MD5SUM SRC_URL=$DEPS_URL &&
	pkg_prepare_default	
}

### default pkg_package
### build
pkg_build() {	
	cd /tmp/HandBrake* &&
	mv ../download/ .  &&	
	./configure --prefix=/usr \
	    --enable-x265  \
		--disable-numa \
		--disable-update-checks \
		--force --verbose \
	&&
	cd build        &&
	make $MAKEFLAGS &&
	make install	&&
	pkg_build_slackdesc 	
}
