summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 57e4ece14384c7709b4c63046e03960159845b61 (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
# Maintainer: Vlad M. <vlad@archlinux.net>
# COntributor: beatgammit

pkgname=servo-git
_pkgname=servo
pkgver=41026.e66ab111a6f
pkgrel=1
pkgdesc="Parallel Browser Project: web browser written in Rust"
arch=('i686' 'x86_64')
url="https://github.com/servo/servo"
license=('MPL')
depends=('freetype2' 'mesa' 'libxrandr' 'libxi' 'libgl' 'glu' 'fontconfig' 'ttf-font' 'bzip2' 'libxcursor' 'libxmu' 'xcb-util' 'python-dbus' 'gst-plugins-bad')
install="$pkgname.install"
makedepends=('git' 'curl' 'python2' 'python2-virtualenv' 'gperf' 'depot-tools-git' 'cmake' 'rustup' 'clang' 'autoconf2.13' 'llvm' 'python2-distlib')
provides=("$_pkgname")
conflicts=("$_pkgname")
_branch=servo
source=(
'git+https://github.com/servo/servo.git'
)
md5sums=('SKIP')

pkgver() {
  cd "$_branch"
  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

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

  ./mach build --release
}

package() {
  servopath=$_branch/target/release
  install -Dm755 "$servopath/servo" "$pkgdir/opt/servo/servo"

  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

  mkdir -p "$pkgdir/opt/servo/resources"
  cp -r $_branch/resources/* "$pkgdir/opt/servo/resources"

  mkdir -p "$pkgdir/etc/profile.d" 
  echo 'export PATH=$PATH:/opt/servo' > "$pkgdir/etc/profile.d/${_pkgname}.sh"
  echo 'setenv PATH ${PATH}:/opt/servo' > "$pkgdir/etc/profile.d/${_pkgname}.csh"
  chmod 755 "$pkgdir/etc/profile.d/${_pkgname}".{csh,sh}
}