summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9d06f0ee183db4d6aa5fd295c55c67669284b4b2 (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
# # Maintainer: Cassandra Watergate (saltedcoffii) <cassandrajwatergate@gmail.com>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: dorphell <dorphell@gmx.net>

_pkgname=libunrar
pkgname=lib32-$_pkgname
pkgver=6.2.10
pkgrel=1
pkgdesc='Library and header file for applications that use libunrar (32-bit)'
arch=(x86_64)
depends=('lib32-gcc-libs' 'libunrar')
url='https://www.rarlab.com/rar_add.htm'
license=(custom)
source=(https://www.rarlab.com/rar/unrarsrc-$pkgver.tar.gz)
sha256sums=('55fe6ebd5e48d6655bfda3fd19b55438ca05e13c7e69772420caad9fdb68ef42')

prepare() {
  sed -e '/CXXFLAGS=/d' -e '/LDFLAGS=/d' -i unrar/makefile # Use system build flags
  sed -e 's:$(DESTDIR)/lib:$(DESTDIR)/lib32:g' -i unrar/makefile # Use the 32-bit lib prefix
}

build() {
  mv unrar lib32-libunrar
  export LDFLAGS+=' -pthread'
  export CXXFLAGS+=' -m32' LDFLAGS+=' -m32'
  make -C lib32-libunrar lib
}

package() {
  cd lib32-libunrar
  install -Dm755 libunrar.{so,a} -t "$pkgdir"/usr/lib32/
  #install -Dm644 dll.hpp -t "$pkgdir"/usr/include/unrar/ # Header file already provided by libunrar
  # install license
  install -Dm644 license.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}