summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0c4c87a3ae45850f2d2da75089fd64a1ba9972dd (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Maintainer: Jiachen YANG <farseerfc@gmail.com>
# Contributor: Vlad M. <vlad@archlinux.net>
# Contributor: beatgammit

_install_libs=false

pkgname=servo-git
pkgver=r44209.052278d058
pkgrel=1
pkgdesc='Parallel Browser Project: web browser written in Rust'
arch=(x86_64 i686)
url=https://github.com/servo/servo
license=(MPL)
depends=(bzip2
         fontconfig
         freetype2
         glu
         gst-plugins-bad
         libgl
         libxcursor
         libxi
         libxmu
         libxrandr
         mesa
         python-dbus
         ttf-font
         xcb-util)
install="$pkgname.install"
makedepends=(autoconf2.13
             clang
             cmake
             curl
             depot-tools-git
             git
             gperf
             llvm
             python
             python-distlib
             python-virtualenv
             rust-nightly)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
backup=("etc/profile.d/${pkgname%-git}".{csh,sh})
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
	cd "$pkgname"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd "$pkgname"
	echo 'export PATH=$PATH:/opt/servo' > "${pkgname%-git}.sh"
	echo 'setenv PATH ${PATH}:/opt/servo' > "${pkgname%-git}.csh"
}

build() {
	cd "$pkgname"
	# fixes build error
	# possibly _FORTIFY_SOURCE? https://bugs.archlinux.org/task/34759
	#unset CPPFLAGS
	./mach build --release
}

package() {
	servopath=$pkgname/target/release
	install -Dm0755 -t "$pkgdir/opt/servo/" "$servopath/servo"
	if [ "$_install_libs" = true ] ; then
		mkdir -p "$pkgdir/usr/lib"
		find "$servopath/deps" -name "*-*.so" -exec basename {} \; | sort | uniq | while read _f; do
			_file=$(find "$servopath/deps" -name "$_f" -print | head -n 1)
			if [ -z "$_file" ]; then
				echo "Skipping: $_f"
				continue
			fi
			install -Dm644 "$_file" "$pkgdir/usr/lib"
		done
	fi
	mkdir -p "$pkgdir/opt/servo/resources"
	cp -r $pkgname/resources/* "$pkgdir/opt/servo/resources"
	cd "$pkgname"
	install -Dm0755 -t "$pkgdir/etc/profile.d/" "${pkgname%-git}".{csh,sh}
}