summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7c2808fac3c620a44df64aa49092a8d007596942 (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
# Maintainer: Matt Parnell/ilikenwf <parwok@gmail.com>
pkgname="hardened-malloc-git"
pkgver=654+2250130
pkgdesc="Hardened allocator designed for modern systems."
url="https://github.com/GrapheneOS/hardened_malloc"
license=("MIT")
makedepends=("git")
conflicts=("hardened_malloc")
provides=("hardened_malloc")
arch=("x86_64")
pkgrel=1
source=('hardened_malloc::git+https://github.com/GrapheneOS/hardened_malloc#branch=main'
		'preload.sh')
sha256sums=('SKIP'
            'e6dbce7ac1d689fafbc94ffb17d8c4ae5271dd3580421828d35aac2c067b652d')

# compress the modules or not
_compress="y"

# don't compress the package - we're just going to uncompress during install in a moment
PKGEXT='.pkg.tar'

pkgver() {
	cd "${srcdir}/hardened_malloc"	
	printf "%s+%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd "${srcdir}/hardened_malloc"
	
	CFLAGS="" make
}

package() {
	cd "${srcdir}/hardened_malloc"
	
	mkdir -p "$pkgdir/usr/lib"
	mkdir -p "$pkgdir/usr/bin"
	
	install -D -m755 "out/libhardened_malloc.so" "$pkgdir/usr/lib"
	install -D -m755 "$srcdir/preload.sh" "$pkgdir/usr/bin/hardened-malloc-preload"
	install -D -m755 "calculate_waste.py" "$pkgdir/usr/bin/hardened-malloc-calculate-waste.py"
	
	msg "Done."
}