summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 4a8a1385971f47d7057fc9e21a5b8297508ab19c (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
# Maintainer: Pellegrino Prevete <pellegrinoprevete@gmail.com>
# Contributor: Brent Carmer <bcarmer@gmail.com>

_pkg="gmp4"
_variant="static"
pkgname="${_pkg}-${_variant}"
pkgver=4.3.2
pkgrel=1
pkgdesc="Legacy version of gmp. Provides libgmp4.a"
arch=('x86_64' 'i686')
url="http://gmplib.org/"
makedepends=('gcc')
license=('LGPL3')
depends=('gcc-libs' 'sh' 'gmp')
options=('!libtool')
source=(https://gmplib.org/download/archive/gmp-${pkgver}/gmp-${pkgver}.tar.xz)
sha256sums=('f69eff1bc3d15d4e59011d587c57462a8d3d32cf2378d32d30d008a42a863325')
sha512sums=('d2ddecc7d0bcfd158f65dfdc4650b9c7092abce52835887ed896cc79870036329ea6bef3f8337a5807bbb4321676366914832ae6a7874a0e54da0203591d03d1')

_configure_opts=(--prefix=/usr
                 --enable-static
                 --disable-shared
                 --libdir=/usr/lib
                 --includedir=/usr/lib/gmp
                 --enable-cxx
                 FLAGS=-fPIC
                 CPPFLAGS=-DPIC
                 LDFLAGS="-static")

build() {
  cd "gmp-${pkgver}"
  export PKG_CONFIG_PATH='/usr/lib/pkgconfig'
  ./configure ${_configure_opts[@]}
  make
}

package() {
  cd gmp-${pkgver}

  make DESTDIR="${pkgdir}" install

  #remove files that conflict with 'gmp' and 'lib32-gmp'
  rm -rf "${pkgdir}"/usr/share
  rm -rf "${pkgdir}"/usr/lib/gmp
  rm -rf "${pkgdir}"/usr/include
  mv "${pkgdir}/usr/lib/libgmp.a" "${pkgdir}/usr/lib/libgmp4.a"
  mv "${pkgdir}/usr/lib/libgmpxx.a" "${pkgdir}/usr/lib/libgmpxx4.a"
}