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

PKGBUILD

By: a guest on Jun 18th, 2013  |  syntax: None  |  size: 1.50 KB  |  views: 5  |  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=mingw-w64-openjpeg
  2. pkgver=1.5.1
  3. pkgrel=2
  4. pkgdesc="An open source JPEG 2000 codec (mingw-w64)"
  5. arch=(any)
  6. url="http://www.openjpeg.org"
  7. license=("BSD")
  8. makedepends=(mingw-w64-gcc mingw-w64-pkg-config)
  9. depends=(mingw-w64-crt
  10. mingw-w64-lcms2
  11. mingw-w64-libtiff
  12. mingw-w64-libpng)
  13. options=(!libtool !strip !buildflags)
  14. source=("http://openjpeg.googlecode.com/files/openjpeg-${pkgver}.tar.gz"
  15.         'cdecl.patch')
  16. md5sums=('b5f74cec2688fb918331bb014061be6f'
  17.          'e788f9bf0ba2e09a4ec8ec025f0b787c')
  18.  
  19. _architectures="i686-w64-mingw32 x86_64-w64-mingw32"
  20.  
  21. prepare() {
  22.   cd "$srcdir/openjpeg-$pkgver"
  23.  
  24.   patch -Np1 < ../cdecl.patch
  25. }
  26.  
  27. build() {
  28.   cd "$srcdir/openjpeg-$pkgver"
  29.   rm -rf thirdparty
  30.   for _arch in ${_architectures}; do
  31.     unset LDFLAGS
  32.     mkdir -p "${srcdir}/${pkgname}-${pkgver}-build-${_arch}"
  33.     cd "${srcdir}/${pkgname}-${pkgver}-build-${_arch}"
  34.     ${srcdir}/${pkgname#mingw-w64-}-${pkgver}/configure \
  35.       --prefix=/usr/${_arch} \
  36.       --build=$CHOST \
  37.       --host=${_arch} \
  38.       --enable-jpwl
  39.     make
  40.   done
  41. }
  42.  
  43. package() {
  44.   for _arch in ${_architectures}; do
  45.     cd "${srcdir}/${pkgname}-${pkgver}-build-${_arch}"
  46.     make DESTDIR="$pkgdir" install
  47.     find "$pkgdir/usr/${_arch}" -name '*.exe' | xargs -rtl1 rm
  48.     find "$pkgdir/usr/${_arch}" -name '*.dll' | xargs -rtl1 ${_arch}-strip --strip-unneeded
  49.     find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs -rtl1 ${_arch}-strip -g
  50.     rm -r "$pkgdir/usr/${_arch}/share"
  51.   done
  52. }