Name gc
Description A garbage collector for C and C++
Version 8.2.12-1
Package Base gc
Homepage https://www.hboehm.info/gc/
Maintainers ['Daniel Isenmann <daniel [at] archlinux.org>', 'Frederik Schwan <freswa@archlinux.org>']
Contributors ['dorphell <dorphell@gmx.net>']
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/gc
Sources ['git+https://github.com/ivmai/bdwgc.git#tag=v8.2.12', 'https://www.hboehm.info/gc/license.txt']
Dependencies ['gcc-libs']
Optional-Dependencies []
Build-Dependencies ['git']
Provides []
Builddate 05-02-2026 18:19:06
Architecture x86_64
Distro-Version
Licenses ['LicenseRef-GC', 'MIT']
Hash f81f6053b8986150529ad125827f00cc8f7652f827cea34fe3f0e97ce078434e
# Maintainer: Daniel Isenmann <daniel [at] archlinux.org>
# Contributor: dorphell <dorphell@gmx.net>

pkgname=gc
pkgver=8.2.12
pkgrel=1
pkgdesc="A garbage collector for C and C++"
arch=('x86_64')
url="https://www.hboehm.info/gc/"
license=(
  'LicenseRef-GC'
  'MIT'
)
depends=(
  libstdc++
)
makedepends=(
  git
)
source=(
  git+https://github.com/ivmai/bdwgc.git#tag=v${pkgver}
  https://www.hboehm.info/gc/license.txt
)
sha512sums=('b03a954e9b006523c9e7d0f48d0c948b2abe361578b8983bf7f64121cca94f091f4876b9a1d38e2e99d20655ce4b4adf09ea51d73ecd321c37f77fae74eb2a77'
            '73b381858db41cb757be67fa00778cb177fa147c892ae1e83d7d31b489c576ffe6c7339b688c41550c896aef1b8af5bfa3e58d1bb9902cc9640a8b837498a9b2')

prepare() {
  cd bdwgc
  ./autogen.sh
}

build() {
  cd bdwgc
  ./configure --prefix=/usr --enable-cplusplus --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd bdwgc
  make check
}

package() {
  cd bdwgc
  make DESTDIR="${pkgdir}" install
  sed 's|GC_MALLOC 1L|gc 3|g' doc/gc.man | install -Dm644 /dev/stdin "${pkgdir}/usr/share/man/man3/gc.3"
  install -Dm644 ../license.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}