summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 47cd732ae1c150ccc866a4ea37827c7097ba7ea9 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgbase=avidemux-git
pkgname=('avidemux-core-git'
         'avidemux-qt-git'
         'avidemux-cli-git'
         )
pkgver=2.6.13.160901.811311c
pkgrel=1
pkgdesc="A graphical/cli tool to edit video (filter/re-encode/split). (GIT version)"
arch=('i686' 'x86_64')
url='http://www.avidemux.org'
license=('GPL2')
makedepends=('git'
             'cmake'
             'subversion'
             'yasm'
             'aften'
             'dcaenc'
             'faac'
             'faad2'
             'fribidi'
             'jack2'
             'lame'
             'libdca'
             'libpulse'
             'libva'
             'libvpx'
             'libx264'
             'opencore-amr'
             'twolame'
             'xvidcore'
             'x265'
             'sqlite'
             'glu'
             'qt5-script'
             'qt5-tools'
             'libxv'
             'vapoursynth'
             )
source=('avidemux::git+https://github.com/mean00/avidemux2.git'
        'fix_verbose.patch'
        'fix_nvenc_check.patch'
        'add_settings_pluginui_message_error.patch'
        'ffmpeg-parallel-build-use-processorcount.patch'
        'opus_check.patch'
        'build-x264-x265-status-message-add-empty-lines.patch'
        )
sha1sums=('SKIP'
          '4b61f11627278578a180d4bdc3b6100544107f32'
          '19bcbe1c3aa6df8fdee2d10ecb9626b46de00175'
          '7f249fef96f44c235c62b7d5d86a6421d87251a1'
          '66da0d2f30e03c5b06df694a96fe82c0b47d1871'
          '3ed60a05b2900c90dfa4f8e4d230aedfec4e2d02'
          '15c343c81139ab84354effd60bda534082a8855b'
          )


pkgver() {
  cd avidemux
  _ver="$(cat cmake/avidemuxVersion.cmake | grep -m3 -e CPACK_PACKAGE_VERSION_MAJOR -e CPACK_PACKAGE_VERSION_MINOR -e CPACK_PACKAGE_VERSION_P | grep -o "[[:digit:]]*" | paste -sd'.')"
  echo -e "${_ver}.$(date -u +%g%m%d).$(git rev-parse --short HEAD | head -c 11)"
}

prepare() {
  mkdir -p build_core{,_plugins,_plugins_settings}
  mkdir -p build_qt{,_plugins}
  mkdir -p build_cli{,_plugins}

  #exit
  cd avidemux

  # http://avidemux.org/smif/index.php/topic,16301.0.html
  patch -p1 -i "${srcdir}/fix_verbose.patch"

  # http://avidemux.org/smif/index.php/topic,16451.0.html
  #patch --binary -p1 -i "${srcdir}/fix_nvenc_check.patch"

  # add SETTINGS to MESSAGE(FATAL_ERROR in avidemux_plugins/CMakeLists.txt
  patch -p1 -i "${srcdir}/add_settings_pluginui_message_error.patch"

  # http://avidemux.org/smif/index.php/topic,16351.0.html
  patch -p1 -i "${srcdir}/ffmpeg-parallel-build-use-processorcount.patch"

  patch --binary -p1 -i "${srcdir}/opus_check.patch"

  patch -p1 -i "${srcdir}/build-x264-x265-status-message-add-empty-lines.patch"
}

build() {
  msg2 "Build Core Libs"
  cd "${srcdir}/build_core"
  cmake ../avidemux/avidemux_core \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DFAKEROOT="${srcdir}/fakeroot" \
    -DAVIDEMUX_SOURCE_DIR="${srcdir}/avidemux"
  make
  make DESTDIR="${srcdir}/fakeroot" install

  msg2 "Build Core Plugins"
  cd "${srcdir}/build_core_plugins"
  cmake ../avidemux/avidemux_plugins \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DPLUGIN_UI=COMMON \
    -DFAKEROOT="${srcdir}/fakeroot"
  make
  make DESTDIR="${srcdir}/fakeroot" install

  msg2 "Build Qt GUI"
  cd "${srcdir}/build_qt"
  cmake ../avidemux/avidemux/qt4 \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_QT5=ON \
    -DFAKEROOT="${srcdir}/fakeroot"
  make
  make DESTDIR="${srcdir}/fakeroot" install

  msg2 "Build Qt GUI Plugins"
  cd ${srcdir}/build_qt_plugins
  cmake ../avidemux/avidemux_plugins \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DENABLE_QT5=ON \
    -DPLUGIN_UI=QT4 \
    -DFAKEROOT="${srcdir}/fakeroot"
  make
  make DESTDIR="${srcdir}/fakeroot" install

  msg2 "Build CLI frontend"
  cd "${srcdir}/build_cli"
  cmake ../avidemux/avidemux/cli \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DFAKEROOT="${srcdir}/fakeroot"
  make
  make DESTDIR="${srcdir}/fakeroot" install

  msg2 "Build CLI plugins"
  cd "${srcdir}/build_cli_plugins"
  cmake ../avidemux/avidemux_plugins \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DPLUGIN_UI=CLI \
    -DFAKEROOT="${srcdir}/fakeroot"
  make
  make DESTDIR="${srcdir}/fakeroot" install

  msg2 "Build Settings"
  cd "${srcdir}/build_core_plugins_settings"
  cmake ../avidemux/avidemux_plugins \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr  \
    -DPLUGIN_UI=SETTINGS \
    -DFAKEROOT="${srcdir}/fakeroot"
  make
  make DESTDIR="${srcdir}/fakeroot" install
}

package_avidemux-core-git() {
  pkgdesc="Core libs for Avidemux. (GIT version)"
  depends=('aften'
           'dcaenc'
           'faac'
           'faad2'
           'fribidi'
           'jack2'
           'lame'
           'libdca'
           'libpulse'
           'libva'
           'libvpx'
           'opencore-amr'
           'twolame'
           'xvidcore'
           'sqlite'
           'libx264'
           'x265'
           )
  optdepends=('avidemux-qt-git: a Qt GUI for Avidemux'
              'avidemux-cli-git: a CLI frontend for Avidemux'
              'wine: AVSload (Load Avisynth scripts on Avidemux)'
              'vapoursynth: vsProxy (Load Vapoursynth scripts on Avidemux'
              )
  provides=("avidemux-core-git=${pkgver}" 'avidemux-core')
  conflicts=('avidemux-core')

  make -C build_core DESTDIR="${pkgdir}" install
  make -C build_core_plugins DESTDIR="${pkgdir}" install
  make -C build_core_plugins_settings DESTDIR="${pkgdir}" install

  install -Dm755 fakeroot/usr/lib/ADM_plugins6/videoEncoders/libADM_ve_x264_other.so "${pkgdir}/usr/lib/ADM_plugins6/videoEncoders/libADM_ve_x264_other.so"
  install -Dm755 fakeroot/usr/lib/ADM_plugins6/videoEncoders/libADM_ve_x265_other.so "${pkgdir}/usr/lib/ADM_plugins6/videoEncoders/libADM_ve_x265_other.so"
}

package_avidemux-qt-git() {
  pkgdesc="Qt GUI for Avidemux. (GIT version)"
  depends=("avidemux-core-git=${pkgver}"
           'qt5-script'
           'libxv'
           'glu'
           'desktop-file-utils'
           )
  provides=('avidemux-qt')
  conflicts=('avidemux-qt4'
             'avidemux-qt5'
             'avidemux-qt'
             )

  make -C build_qt DESTDIR="${pkgdir}" install
  make -C build_qt_plugins DESTDIR="${pkgdir}" install

  install -Dm644 avidemux/avidemux2.desktop "${pkgdir}/usr/share/applications/avidemux-qt.desktop"
  sed -e 's|Icon=avidemux|Icon=avidemux-qt|g' \
      -e 's|Exec=avidemux2_gtk|Exec=avidemux3_qt5|g' \
      -e 's|Name=avidemux2|Name=Avidemux Qt|' \
      -i "${pkgdir}/usr/share/applications/avidemux-qt.desktop"
  install -Dm644 avidemux/avidemux_icon.png "${pkgdir}/usr/share/pixmaps/avidemux-qt.png"
}

package_avidemux-cli-git() {
  pkgdesc="CLI frontend for Avidemux. (GIT version)"
  depends=("avidemux-core-git=${pkgver}")
  provides=('avidemux-cli')
  conflicts=('avidemux-cli')

  make -C build_cli DESTDIR="${pkgdir}" install
  make -C build_cli_plugins DESTDIR="${pkgdir}" install

  rm -fr "${pkgdir}/usr/lib/ADM_plugins6/videoEncoders"
}