Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

aegisub-svn PKGBUILD

By: a guest on Nov 5th, 2011  |  syntax: Bash  |  size: 3.15 KB  |  views: 54  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pkgname=aegisub-svn
  2. pkgver=5819
  3. pkgrel=1
  4. pkgdesc="A general-purpose subtitle editor with ASS/SSA support"
  5. arch=('i686' 'x86_64')
  6. url="http://www.aegisub.net"
  7. license=('GPL' 'BSD')
  8. depends=('ffmpegsource2-svn' 'lua' 'wxgtk-2.9>=2.9.2' 'hunspell' 'libass' 'hicolor-icon-theme' 'desktop-file-utils')
  9. makedepends=('imagemagick>=6.6.2.10' 'subversion' 'intltool')
  10. provides=('aegisub')
  11. conflicts=('aegisub')
  12. source=('license.txt')
  13. options=(!strip)
  14. install=aegisub-svn.install
  15. md5sums=('3e13350007702bd7117e8f35bac376f1')
  16.  
  17. _svntrunk=http://svn.aegisub.org/trunk/aegisub/
  18. _svnmod=aegisub
  19.  
  20.  
  21. build() {
  22.   cd "$srcdir"
  23.  
  24.   if [ -d $_svnmod ]; then
  25.     cd $_svnmod && svn up
  26.   else
  27.     svn co $_svntrunk $_svnmod
  28.   fi
  29.  
  30.   if [ -d "$srcdir/$_svnmod-build" ]; then
  31.     rm -rf "$srcdir/$_svnmod-build"
  32.   fi
  33.  
  34.   cp -r "$srcdir/$_svnmod" "$srcdir/$_svnmod-build"
  35.  
  36.   cd "$srcdir/$_svnmod-build"
  37.  
  38.   # Fix audio_player_alsa.(h|cpp)
  39.   sed -e "/#include \"include\/aegisub\/audio_player.h\"/a #include \"include/aegisub/audio_provider.h\"" \
  40.       -i src/audio_player_alsa.h
  41.   sed -e 's/#include "options.h"/#include "main.h"/' \
  42.       -e 's/return "snd_pcm_/return (void*)"snd_pcm_/' \
  43.       -e 's/return "SND_PCM_STATE_DISCONNECTED";/return (void*)"SND_PCM_STATE_DISCONNECTED";/' \
  44.       -i src/audio_player_alsa.cpp
  45.   # Fix ass_exporter.h
  46.   sed -e "/#include <wx\/string.h>/a #include <algorithm>" \
  47.       -e "s/transform(filter_list_begin(), filter_list_end(),/std::transform(filter_list_begin(), filter_list_end(),/" \
  48.       -i src/ass_exporter.h
  49.   # Fix lua_dialog.cpp
  50.   sed -e "s/def = std::max(lua_tointeger(L, -1), def);/def = std::max((int)lua_tointeger(L, -1), def);/" \
  51.       -i src/auto4_lua_dialog.cpp
  52.   # Fix audio_display.cpp
  53.   sed -e "s/spectrum_quality = mid(0LL, spectrum_quality, 5LL);/spectrum_quality = mid(0LL, (long long)spectrum_quality, 5LL);/" \
  54.       -i src/audio_display.cpp
  55.   # Fix dialog_kara_timing.cpp
  56.   sed -e "s/std::max(source_sel_length, 1u)/std::max((unsigned int)source_sel_length, 1u)/" \
  57.       -e "s/std::max(destination_sel_length, 1u)/std::max((unsigned int)destination_sel_length, 1u)/" \
  58.       -i src/dialog_kara_timing_copy.cpp
  59.   # Fix command/command.h
  60.   sed -e "/#include <string>/a #include <vector>" \
  61.       -i src/command/command.h
  62.   # Fix hotkey_data_view_model.cpp
  63.   sed -e "/#include <set>/a #include <list>" \
  64.       -i src/hotkey_data_view_model.cpp
  65.  
  66.   ./autogen.sh --prefix=/usr \
  67.     --with-player-audio={oss} --without-{alsa,portaudio,openal,pulseaudio} \
  68.     --with-wxdir=/usr/include/wx-2.9 --with-wx-config=/usr/bin/wx-config-2.9
  69.  
  70.   make
  71. }
  72.  
  73. package() {
  74.   cd "${srcdir}/$_svnmod-build"
  75.   make DESTDIR="$pkgdir" install
  76.  
  77.   # menu icon and mimetype fix
  78.   sed -e 's/Icon=aegisub/Icon=\/usr\/share\/icons\/hicolor\/scalable\/apps\/aegisub.svg/' \
  79.       -e 's/application\/x-srt/application\/x-subrip/' \
  80.       -i "$pkgdir"/usr/share/applications/aegisub.desktop
  81.  
  82.   # install the BSD license, although it is ruled by GPL according to the wiki:
  83.   # (http://www.malakith.net/aegiwiki/Subtitling_software_comparison)
  84.   install -D -m644 "$srcdir"/license.txt \
  85.     "$pkgdir"/usr/share/licenses/$pkgname/license.txt
  86. }
  87.  
  88.