summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fd7b73c6171587c8c89f2ce97c35cf1251ecea62 (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
# Contributor: Andrew Sun <adsun701 at gmail dot com>

pkgname=mingw-w64-libbaseencode
pkgver=1.0.11
pkgrel=1
pkgdesc="Library written in C for encoding and decoding data using base32 or base64 (RFC-4648) (mingw-w64)"
arch=('any')
url="https://github.com/paolostivanin/libbaseencode"
license=('GPL3')
makedepends=('mingw-w64-cmake')
depends=('mingw-w64-crt')
options=('!strip' '!buildflags' 'staticlibs')
source=("https://github.com/paolostivanin/libbaseencode/archive/v${pkgver}.tar.gz"
        "fix-dll-install.patch")
sha256sums=('645329236992ee85f05569475da2af0f0d81aaccd4aebc8d0b8603e54a320935'
            '8249f3fc0c7d66469b84339590eb68ed882a8ed1dc75cbaa62ef1b9e4a6b16aa')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

prepare() {
  cd "${srcdir}/libbaseencode-${pkgver}"
  patch -Np1 -i "${srcdir}/fix-dll-install.patch"
}

build() { 
  cd "${srcdir}/libbaseencode-${pkgver}"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/libbaseencode-${pkgver}/build-${_arch}"
    make DESTDIR="${pkgdir}" install
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}