Guest User

mkvtoolnix

a guest
Sep 21st, 2015
614
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # $Id: PKGBUILD 246729 2015-09-20 07:01:02Z giovanni $
  2. # Maintainer: Giovanni Scafora <giovanni@archlinux.org>
  3. # Contributor: xduugu <xduugu@gmx.com>
  4.  
  5. pkgbase=mkvtoolnix
  6. pkgname=('mkvtoolnix-cli' 'mkvtoolnix-qt')
  7. pkgver=8.4.0
  8. pkgrel=2
  9. arch=('i686' 'x86_64')
  10. license=('GPL')
  11. url="http://www.bunkus.org/videotools/mkvtoolnix/index.html"
  12. makedepends=('libmatroska' 'flac' 'libvorbis' 'file' 'qt5-base'
  13.              'boost-libs' 'lzo' 'xdg-utils' 'boost' 'ruby')
  14. source=("http://www.bunkus.org/videotools/${pkgbase}/sources/${pkgbase}-${pkgver}.tar.xz")
  15. md5sums=('773eb42b7887bd20c4ce65cdf667976b')
  16.  
  17. prepare() {
  18.   cd "${srcdir}/${pkgbase}-${pkgver}"
  19.  
  20.   # Disable automagic curl dep used for online update checking
  21.   #sed -i -e '/curl/d' configure.in
  22.   export CURL_CFLAGS="" CURL_LIBS=""
  23.  
  24.   export CFLAGS="${CFLAGS} -DBOOST_FILESYSTEM_VERSION=3"
  25.   export CXXFLAGS="${CXXFLAGS} -DBOOST_FILESYSTEM_VERSION=3"
  26.  
  27.   # Sets number of threads for a parallel build
  28.   export DRAKETHREADS=`nproc`
  29.  
  30.   autoreconf -vfi
  31. }
  32.  
  33. build() {
  34.   cd "${srcdir}/${pkgbase}-${pkgver}"
  35.  
  36.   # XXX: Temporary define to build against boost 1.58
  37.   # https://github.com/mbunkus/mkvtoolnix/issues/1172
  38.   CXXFLAGS+=' -DBOOST_CODECVT_DO_LENGTH_CONST=const'
  39.  
  40.   ./configure --prefix=/usr \
  41.               --with-boost-libdir=/usr/lib \
  42.               --without-curl \
  43.               --disable-gui
  44.   ./drake
  45.  
  46.   mv src/mkvinfo{,-cli}
  47.  
  48.   ./configure --prefix=/usr \
  49.               --with-boost-libdir=/usr/lib \
  50.               --without-curl
  51.  
  52.   ./drake
  53.  
  54.   mv src/mkvinfo{,-qt}
  55.   mv src/mkvinfo{-cli,}
  56. }
  57.  
  58. package_mkvtoolnix-cli() {
  59.   pkgdesc="Set of tools to create, edit and inspect Matroska files - CLI version"
  60.   depends=('libmatroska' 'expat' 'flac' 'libvorbis' 'file' 'boost-libs' 'lzo')
  61.   provides=('mkvtoolnix')
  62.   conflicts=('mkvtoolnix')
  63.   replaces=('mkvtoolnix')
  64.  
  65.   cd "${srcdir}/${pkgbase}-${pkgver}"
  66.  
  67.   ./drake DESTDIR="${pkgdir}" install
  68.  
  69.   cd "${pkgdir}"
  70.  
  71.   find -name mkvtoolnix-gui.png -delete
  72.   find usr/share/man -name 'mkvtoolnix-gui.1*' -delete
  73.   rm -f usr/bin/mkvtoolnix-gui
  74.   rm -rf usr/share/applications
  75.   rm -rf usr/share/icons
  76.   rm -rf usr/share/mime
  77. }
  78.  
  79. package_mkvtoolnix-qt() {
  80.   pkgdesc="Set of tools to create, edit and inspect Matroska files - Qt GUI"
  81.   depends=("mkvtoolnix-cli=${pkgver}" 'qt5-base' 'xdg-utils' 'desktop-file-utils')
  82.   provides=('mkvtoolnix-gtk')
  83.   conflicts=('mkvtoolnix-gtk')
  84.   replaces=('mkvtoolnix-gtk')
  85.   install=mkvtoolnix.install
  86.  
  87.   cd "${srcdir}/${pkgbase}-${pkgver}"
  88.  
  89.   ./drake DESTDIR="${pkgdir}" install
  90.   install -Dm755 src/mkvinfo-qt "${pkgdir}"/usr/bin/
  91.  
  92.   cd "${pkgdir}"
  93.  
  94.   sed -i "s/Exec=mkvinfo/Exec=mkvinfo-qt/" usr/share/applications/mkvinfo.desktop
  95.  
  96.   rm -rf usr/bin/mkv{extract,info,merge,propedit}
  97.   rm -rf usr/share/locale
  98.   find usr/share/man -name 'mkvextract.1*' -delete
  99.   find usr/share/man -name 'mkvinfo.1*' -delete
  100.   find usr/share/man -name 'mkvmerge.1*' -delete
  101.   find usr/share/man -name 'mkvpropedit.1*' -delete
  102. }
RAW Paste Data