summaryrefslogtreecommitdiffstats
path: root/abs/extra/mkvtoolnix/PKGBUILD
blob: 2439562e46bdfa2e305a3a2e57ee1df76e85cf23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# $Id: PKGBUILD 163843 2012-07-21 11:04:01Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: xduugu <xduugu@gmx.com>

pkgbase=mkvtoolnix
pkgname=('mkvtoolnix-cli' 'mkvtoolnix-gtk')
pkgver=5.7.0
pkgrel=3
arch=('i686' 'x86_64')
license=('GPL')
url="http://www.bunkus.org/videotools/mkvtoolnix/index.html"
makedepends=('libmatroska' 'flac' 'libvorbis' 'file' 'wxgtk'
             'boost-libs' 'lzo2' 'xdg-utils' 'boost' 'ruby')
source=("http://www.bunkus.org/videotools/${pkgbase}/sources/${pkgbase}-${pkgver}.tar.bz2"
        'mm_io.patch')
md5sums=('99ea44be570412dadafe4ccaee0cfe6e'
         '293bd4551ef8529e9d4796c5a201b8fc')

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"

  patch -Np1 -i "${srcdir}/mm_io.patch"

  # Disable automagic curl dep used for online update checking
  sed -i -e '/curl/d' configure.in
  export CURL_CFLAGS="" CURL_LIBS=""

  export CFLAGS="${CFLAGS} -DBOOST_FILESYSTEM_VERSION=3"
  export CXXFLAGS="${CXXFLAGS} -DBOOST_FILESYSTEM_VERSION=3"

  autoreconf

  ./configure --prefix=/usr \
              --with-boost-libdir=/usr/lib \
              --disable-gui
  rake

  mv src/mkvinfo{,-cli}

  ./configure --prefix=/usr \
              --with-boost-libdir=/usr/lib
  rake
}

package_mkvtoolnix-cli() {
  pkgdesc="Set of tools to create, edit and inspect Matroska files - CLI version"
  depends=('libmatroska' 'expat' 'flac' 'libvorbis' 'file' 'boost-libs' 'lzo2')
  provides=('mkvtoolnix')
  conflicts=('mkvtoolnix')
  replaces=('mkvtoolnix')

  cd "${srcdir}/${pkgbase}-${pkgver}"

  rake DESTDIR="${pkgdir}" install
  rm -rf "${pkgdir}"/usr/bin/mkvinfo
  install -Dm755 src/mkvinfo-cli "${pkgdir}"/usr/bin/mkvinfo

  rm -rf "${pkgdir}"/usr/bin/mmg
  rm -rf "${pkgdir}"/usr/share/man/ja/man1/mmg.1
  rm -rf "${pkgdir}"/usr/share/man/man1/mmg.1
  rm -rf "${pkgdir}"/usr/share/man/nl/man1/mmg.1
  rm -rf "${pkgdir}"/usr/share/man/zh_CN/man1/mmg.1
  rm -rf "${pkgdir}"/usr/share/man/uk/man1/mmg.1
  rm -rf "${pkgdir}"/usr/share/applications
  rm -rf "${pkgdir}"/usr/share/icons
  rm -rf "${pkgdir}"/usr/share/mime
}

package_mkvtoolnix-gtk() {
  pkgdesc="Set of tools to create, edit and inspect Matroska files - wxGTK GUI"
  depends=("mkvtoolnix-cli=${pkgver}" 'wxgtk' 'xdg-utils')
  install=mkvtoolnix.install

  cd "${srcdir}/${pkgbase}-${pkgver}"

  rake DESTDIR="${pkgdir}" install
  rm -rf "${pkgdir}"/usr/bin/mkv*
  install -Dm755 src/mkvinfo "${pkgdir}"/usr/bin/mkvinfo-gtk
  sed -ri 's/^(Exec=mkvinfo)/\1-gtk/' "${pkgdir}"/usr/share/applications/mkvinfo.desktop

  rm -rf "${pkgdir}"/usr/share/doc
  rm -rf "${pkgdir}"/usr/share/locale
  rm -rf "${pkgdir}"/usr/share/man/ja/man1/mkv*
  rm -rf "${pkgdir}"/usr/share/man/man1/mkv*
  rm -rf "${pkgdir}"/usr/share/man/nl/man1/mkv*
  rm -rf "${pkgdir}"/usr/share/man/zh_CN/man1/mkv*
  rm -rf "${pkgdir}"/usr/share/man/uk/man1/mkv*
}