APKBUILD 2.85 KB
Newer Older
Rasmus Thomsen's avatar
Rasmus Thomsen committed
1
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
2
# Contributor: Valery Kartel <valery.kartel@gmail.com>
Rasmus Thomsen's avatar
Rasmus Thomsen committed
3
4
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
Carlo Landmeter's avatar
Carlo Landmeter committed
5
pkgname=glib
Rasmus Thomsen's avatar
Rasmus Thomsen committed
6
pkgver=2.64.1
Rasmus Thomsen's avatar
Rasmus Thomsen committed
7
pkgrel=0
Carlo Landmeter's avatar
Carlo Landmeter committed
8
pkgdesc="Common C routines used by Gtk+ and other libs"
TBK's avatar
TBK committed
9
url="https://developer.gnome.org/glib/"
10
arch="all"
Leo's avatar
Leo committed
11
license="LGPL-2.1-or-later"
12
triggers="$pkgname.trigger=/usr/share/glib-2.0/schemas:/usr/lib/gio/modules"
Leo's avatar
Leo committed
13
14
depends_dev="python3 gettext-dev bzip2-dev libxml2-utils libxslt
	docbook-xml docbook-xsl"
Rasmus Thomsen's avatar
Rasmus Thomsen committed
15
makedepends="$depends_dev pcre-dev meson zlib-dev libffi-dev util-linux-dev"
Rasmus Thomsen's avatar
Rasmus Thomsen committed
16
options="!check" # don't like to be run without first being installed
Leo's avatar
Leo committed
17
source="https://download.gnome.org/sources/glib/${pkgver%.*}/glib-$pkgver.tar.xz
Natanael Copa's avatar
Natanael Copa committed
18
	0001-gquark-fix-initialization-with-c-constructors.patch
19
	deprecated-no-warn.patch
Natanael Copa's avatar
Natanael Copa committed
20
	musl-libintl.patch
Ariadne Conill's avatar
Ariadne Conill committed
21
	mips-disable-memory-barrier.patch
22
	"
Natanael Copa's avatar
Natanael Copa committed
23
subpackages="$pkgname-dbg $pkgname-doc $pkgname-static $pkgname-dev $pkgname-lang"
Carlo Landmeter's avatar
Carlo Landmeter committed
24

Natanael Copa's avatar
Natanael Copa committed
25
# secfixes:
Leo's avatar
Leo committed
26
27
#   2.62.5-r0:
#     - CVE-2020-6750
Natanael Copa's avatar
Natanael Copa committed
28
#   2.60.4-r0:
Leo's avatar
Leo committed
29
#     - CVE-2019-12450
30

Natanael Copa's avatar
Natanael Copa committed
31
build() {
Natanael Copa's avatar
Natanael Copa committed
32
33
	meson \
		--default-library=both \
34
		--prefix=/usr \
Natanael Copa's avatar
Natanael Copa committed
35
		--sysconfdir=/etc \
36
		--mandir=/usr/share/man \
Natanael Copa's avatar
Natanael Copa committed
37
		--localstatedir=/var \
38
		--buildtype=plain \
Natanael Copa's avatar
Natanael Copa committed
39
40
41
42
		-Dman=true \
		. output
	ninja -C output

Rasmus Thomsen's avatar
Rasmus Thomsen committed
43
44
	# FIXME: meson adds -lintl first in Libs: in the .pc file but it needs to be
	#        last for static builds (e.g. qemu)
Natanael Copa's avatar
Natanael Copa committed
45
	sed -i -e '/^Libs:/s/-lintl \(.*\)/\1 -lintl/' output/meson-private/glib-2.0.pc
Natanael Copa's avatar
Natanael Copa committed
46
47
48
}

package() {
Natanael Copa's avatar
Natanael Copa committed
49
	DESTDIR="$pkgdir" ninja -C output install
Carlo Landmeter's avatar
Carlo Landmeter committed
50
51
}

52
53
dev() {
	default_dev
54
55
56
57
58
59
60
61
62
63
64
65
	mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/share
		find "$pkgdir"/usr/bin ! -name "glib-compile-schemas" -a \( \
		-name "gdbus-codegen" -o \
		-name "gobject-query" -o \
		-name "gresource" -o \
		-name "gtester*" -o \
		-name "glib-*" \) \
		-exec mv {} "$subpkgdir"/usr/bin \;
	mv "$pkgdir"/usr/share/gdb "$pkgdir"/usr/share/glib-2.0 \
		"$subpkgdir"/usr/share
}

Natanael Copa's avatar
Natanael Copa committed
66
67
68
69
70
71
72
static() {
	pkgdesc="glib static libraries"
	depends="gettext-static"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}

Rasmus Thomsen's avatar
Rasmus Thomsen committed
73
sha512sums="1cefe49a42233f24ac6bd09c134ceea7119f4f74f42204a731be56100a180eec69c8224674f0b08d1538ad0859896ed08260a6af0fed469c7d10b4508116a6bc  glib-2.64.1.tar.xz
74
32e5aca9a315fb985fafa0b4355e4498c1f877fc1f0b58ad4ac261fb9fbced9f026c7756a5f2af7d61ce756b55c8cd02811bb08df397040e93510056f073756b  0001-gquark-fix-initialization-with-c-constructors.patch
Natanael Copa's avatar
Natanael Copa committed
75
744239ea2afb47e15d5d0214c37d7c798edac53797ca3ac14d515aee4cc3999ef9716ba744c64c40198fb259edc922559f77c9051104a568fc8ee4fc790810b1  deprecated-no-warn.patch
Ariadne Conill's avatar
Ariadne Conill committed
76
6ec43e76bb973367bd99c5e2077113e86df2b120b3788aeeb4692a572392bba7227e8217b28a918e02ad82fcb8ca6d260c3221b84688774d86779755af51a847  musl-libintl.patch
Rasmus Thomsen's avatar
Rasmus Thomsen committed
77
f853ddb4ff8231e1df15323773af938323517b643b241fc635d05f7d6e103ff18417d203c65661c7dd0b5e44c5d74c71a497e82281c2bb4ed4e2fe9b9ed7140f  mips-disable-memory-barrier.patch"