summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: af38641594a43e614e67125db3aa7894a7481f52 (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
# Maintainer: Carsten Haitzler <raster@rasterman.com>

_pkgname=efl
pkgname=($_pkgname-git-asan)
pkgver=1.24.99.65805.g27630114ef
pkgrel=1
pkgdesc="Enlightenment Foundation Libraries - Development version - Asan debug build"
arch=('i686' 'x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url="http://www.enlightenment.org"
license=('BSD' 'LGPL2.1' 'GPL2' 'MIT' 'custom')
depends=('curl' 'fontconfig' 'fribidi' 'harfbuzz'
         'gst-plugins-base-libs' 'lua' 'libgl' 'libinput'
         'libpulse' 'libsndfile' 'libspectre' 'libraw' 'librsvg' 'libwebp'
         'libxcomposite' 'libxcursor' 'libxinerama' 'libxkbcommon' 'libxrandr'
         'libxss' 'libunwind' 'mesa' 'poppler' 'openjpeg2' 'libjpeg-turbo'
         'libpng' 'libtiff' 'giflib' 'lz4' 'zlib' 'systemd-libs' 'openssl'
         'glibc' 'libutil-linux' 'dbus'
         'shared-mime-info' 'mailcap' 'ttf-font' 'scim'
         'wayland' 'wayland-protocols' 'libxkbcommon-x11'
         'pulseaudio')
makedepends=('git' 'meson' 'ninja' 'pkgconf' 'gcc' 'binutils' 'fakeroot' 'procps-ng' 'ccache')
optdepends=('gst-plugins-base: Video and thumbnail codecs'
            'gst-plugins-good: Video and thumbnail codecs'
            'gst-plugins-bad: Video and thumbnail codecs'
            'gst-plugins-ugly: Video and thumbnail codecs'
            'gst-libav: Video and thumbnails with ffmpeg/libav'
            'libreoffice: Office document thumbnails')
provides=("$_pkgname=$pkgver" $_pkgname-git=$pkgver elementary{,-git}=$pkgver "evas_generic_loaders=$pkgver")
conflicts=("$_pkgname" $_pkgname-git elementary{,-git} elementary_test{,-git} evas_generic_loaders{,-git})
options=('!strip' 'ccache')
source=("git+https://git.enlightenment.org/core/$_pkgname.git")
sha256sums=('SKIP')

pkgver() {
  cd $_pkgname

  local v_ver=$(grep version meson.build | head -1 | sed s/version//g | tr ":'," "   " | awk '{print $1}')

  printf "%s.%s.g%s" "$v_ver" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd $_pkgname

  export ASAN_OPTIONS="detect_leaks=0:abort_on_error=1::new_delete_type_mismatch=0"

  MEM=`free -m | head -2 | tail -1 | awk '{printf("%s", $7);}'`
  if test "$MEM" -lt 300; then MEM=300; fi
  J=`expr $MEM / 300`
  CPUS=`echo /sys/devices/system/cpu/cpu[0-9]* | wc -w`
  if test "$J" -gt $CPUS; then J=$CPUS; fi
  if test "$J" -lt 1; then J=1; fi
  echo "Free Mem: $MEM M, using $J threads for build"

  unset CPPFLAGS
  export CFLAGS="-O0 -g3"
  export CXXFLAGS="-O0 -g3"
  rm -rf build
  meson --prefix=/usr \
    -Db_sanitize=address \
    -Dfb=true \
    -Ddrm=true \
    -Dwl=true \
    -Dnetwork-backend=connman \
    -Dbindings= \
    -Dbuild-examples=false \
    -Dbuild-tests=false \
    . build
  ninja -j $J -C build
}

package() {
  cd $_pkgname

  DESTDIR="$pkgdir" ninja -C build install

  install -Dm644 -t "$pkgdir/usr/share/doc/$_pkgname/" ChangeLog NEWS README
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" AUTHORS COMPLIANCE COPYING COPYING.images licenses/COPYING.{BSD,SMALL}
}