aboutsummaryrefslogtreecommitdiffstats
path: root/main/libwebsockets/APKBUILD
blob: 958eec968f67b0e52a279990a9998183939aa9c0 (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
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libwebsockets
pkgver=2.2.0
pkgrel=0
pkgdesc="C library for lightweight websocket clients and servers"
url="http://libwebsockets.org"
arch="all"
license="LGPL2.1"
makedepends="cmake zlib-dev libressl-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-test:_test"
source="$pkgname-$pkgver.tar.gz::https://github.com/warmcat/$pkgname/archive/v$pkgver.tar.gz
	fix-format-error.patch"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	mkdir -p "$builddir"/build
	cd "$builddir"/build

	cmake .. \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=TRUE \
		 || return 1
	make
}

package() {
	cd "$builddir"

	install -Dm644 LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE || return 1
	make -C build DESTDIR="$pkgdir" install || return 1
}

_test() {
	pkgdesc="$pkgdesc (test server)"

	mkdir -p "$subpkgdir"/usr
	mv "$pkgdir"/usr/share "$pkgdir"/usr/bin "$subpkgdir"/usr/
}

sha512sums="0a6525c496bd51660ad95fa2a98d3de9a42580c03c48c564bfe1a87664e34a30aba28fedefa322b310d07314a905420d874d232d3d077a5192143224247a686a  libwebsockets-2.2.0.tar.gz
47114b02a7271cf47e34f0b91e1226d49374b9657157e11815f536807451637a5499e86e4f4bb29d9fd7b7548308291933f7049eee6cf865d133c6a3a4b00b0b  fix-format-error.patch"