summaryrefslogtreecommitdiffstats
path: root/source/x/mesa/mesa-amber.build
blob: 01ea2e8807fb982ab76853f42a6a09f09a8cb660 (plain) (blame)
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
86
87
88
89
90
91
#!/bin/bash
# This script is not meant to be run directly:
if [ -z $AMBERVERS ]; then
  exit 1
fi


# Be sure this list is up-to-date:
DRI_DRIVERS="i915,i965,r100,r200,nouveau"

cd $TMP
rm -rf ${PKGNAM}-${AMBERVERS}

tar xvf $CWD/amber/${PKGNAM}-${AMBERVERS}.tar.?z || exit 1
cd ${PKGNAM}-$AMBERVERS || exit 1

# Let's kill the warning about operating on a dangling symlink:
rm -f src/gallium/state_trackers/d3d1x/w32api

# Make sure ownerships and permissions are sane:
chown -R root:root .
find . \
  \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  -exec chmod 755 {} \+ -o \
  \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  -exec chmod 644 {} \+

# Apply patches from git (and maybe elsewhere):
# Patches obtained by:
#   git checkout origin/17.2
#   git format-patch 93c2beafc0a7fa2f210b006d22aba61caa71f773 # 17.2.6 release
if /bin/ls $CWD/patches/*.patch 1> /dev/null 2> /dev/null ; then
  for patch in $CWD/patches/*.patch ; do
    patch -p1 --verbose < $patch || exit 1 ;
  done
fi

# Revert these patches from git (and maybe elsewhere):
if /bin/ls $CWD/patches-revert/*.patch 1> /dev/null 2> /dev/null ; then
  for patch in $CWD/patches-revert/*.patch ; do
    patch -p1 -R --verbose < $patch || exit 1 ;
  done
fi

# Configure, build, and install:
export CFLAGS="$SLKCFLAGS"
export CXXFLAGS="$SLKCFLAGS"
mkdir meson-build
cd meson-build
meson setup \
  --prefix=/usr \
  --libdir=lib${LIBDIRSUFFIX} \
  --libexecdir=/usr/libexec \
  --bindir=/usr/bin \
  --sbindir=/usr/sbin \
  --includedir=/usr/include \
  --datadir=/usr/share \
  --mandir=/usr/man \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --buildtype=release \
  -Dplatforms=x11,wayland \
  -Damber=true \
  -Ddri-drivers=$DRI_DRIVERS \
  -Dgallium-drivers='' \
  -Dvulkan-drivers='' \
  -Dosmesa=false \
  -Dglvnd=true \
  -Dllvm=enabled \
  -Dshared-llvm=enabled \
  -Dshared-glapi=enabled \
  -Degl=enabled \
  -Dgles1=enabled \
  -Dgles2=enabled \
  -Dopengl=true \
  -Dglx=dri \
  .. || exit 1
  "${NINJA:=ninja}" $NUMJOBS || exit 1
  DESTDIR=$PKG/cruft $NINJA install || exit 1
cd ..

# We will install only the DRI drivers:
mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/dri
rsync -lprvt $PKG/cruft/usr/lib${LIBDIRSUFFIX}/dri/ $PKG/usr/lib${LIBDIRSUFFIX}/dri/
rm -rf $PKG/cruft

rm -rf $PKG/usr/doc/$PKGNAM-$AMBERVERS
mkdir -p $PKG/usr/doc/$PKGNAM-amber-$AMBERVERS
cp -a \
  CODEOWNERS* README* docs/README* docs/license* docs/relnotes/${AMBERVERS}.* \
  $PKG/usr/doc/$PKGNAM-amber-$AMBERVERS