Mercurial > vanilla
comparison graphics/mesa/mesa.sh @ 688:d13cafd27a68
graphics/mesa: improve user options
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 01 Aug 2019 21:00:00 +0200 |
parents | 25cecc6dca48 |
children | 439aade5bee6 |
comparison
equal
deleted
inserted
replaced
687:1477b925acaf | 688:d13cafd27a68 |
---|---|
20 PKGREVISION=1 | 20 PKGREVISION=1 |
21 PKGLICENSE="CUSTOM" | 21 PKGLICENSE="CUSTOM" |
22 PKGSUMMARY="opensource OpenGL implementation" | 22 PKGSUMMARY="opensource OpenGL implementation" |
23 PKGDOWNLOAD="https://mesa.freedesktop.org/archive/$PKGNAME-$PKGVERSION.tar.xz" | 23 PKGDOWNLOAD="https://mesa.freedesktop.org/archive/$PKGNAME-$PKGVERSION.tar.xz" |
24 PKGDEPENDS="dev/meson:build" | 24 PKGDEPENDS="dev/meson:build" |
25 PKGOPTIONS="DRM LLVM WAYLAND X" | 25 PKGOPTIONS="DRM EGL GALLIUM GLVND LLVM PLATFORMS SELINUX VULKAN WAYLAND X" |
26 | 26 |
27 : ${CC:=clang} | 27 : ${CC:=clang} |
28 : ${CFLAGS:=-O2} | 28 : ${CFLAGS:=-O2} |
29 : ${CXX:=clang++} | 29 : ${CXX:=clang++} |
30 : ${CXXFLAGS:=-O2} | 30 : ${CXXFLAGS:=-O2} |
31 : ${LDFLAGS:=} | 31 : ${LDFLAGS:=} |
32 : ${DRM:=yes} | 32 : ${DRM:=yes} |
33 : ${EGL:=yes} | |
34 : ${GALLIUM:=radeonsi r300 r600 virgl svga swrast} # drivers list or "no" | |
35 : ${GLVND:=yes} | |
33 : ${LLVM:=yes} | 36 : ${LLVM:=yes} |
37 : ${SELINUX:=no} | |
38 : ${VULKAN:=intel amd} # drivers list or "no" | |
34 : ${WAYLAND:=yes} | 39 : ${WAYLAND:=yes} |
35 : ${X:=yes} | 40 : ${X:=yes} |
36 | 41 |
42 # Convert user options separated by spaces to comma. | |
37 with_platforms="" | 43 with_platforms="" |
38 with_gallium_drivers="r300,r600,virgl,svga,swrast" | 44 with_gallium_drivers="" |
39 with_vulkan_drivers="intel" | 45 with_vulkan_drivers="" |
40 | 46 |
41 if [ "$DRM" = "yes" ]; then | 47 if [ "$DRM" = "yes" ]; then |
42 with_platforms="drm,$platforms" | 48 PKGDEPENDS="graphics/libdrm $PKGDEPENDS" |
49 with_platforms="drm" | |
50 fi | |
51 | |
52 if [ "$EGL" = "yes" ]; then | |
53 with_egl="-D egl=true" | |
54 else | |
55 with_egl="-D egl=false" | |
56 fi | |
57 | |
58 if [ "$GALLIUM" != "no" ]; then | |
59 with_gallium_drivers=$(echo $GALLIUM | sed -e "s/ /,/") | |
60 fi | |
61 | |
62 if [ "$GLVND" = "yes" ]; then | |
63 with_glvnd="-D glvnd=true" | |
64 else | |
65 with_glvnd="-D glvnd=false" | |
43 fi | 66 fi |
44 | 67 |
45 if [ "$LLVM" = "yes" ]; then | 68 if [ "$LLVM" = "yes" ]; then |
46 PKGDEPENDS="dev/llvm:build $PKGDEPENDS" | 69 PKGDEPENDS="dev/llvm $PKGDEPENDS" |
47 with_llvm="-D llvm=true" | 70 with_llvm="-D llvm=true" |
48 with_gallium_drivers="radeonsi,$with_gallium_drivers" | |
49 with_vulkan_drivers="amd,$with_vulkan_drivers" | |
50 else | 71 else |
51 with_llvm="-D llvm=false" | 72 with_llvm="-D llvm=false" |
52 fi | 73 fi |
53 | 74 |
75 if [ "$VULKAN" != "no" ]; then | |
76 with_vulkan_drivers=$(echo $VULKAN | sed -e "s/ /,/") | |
77 fi | |
78 | |
54 if [ "$WAYLAND" = "yes" ]; then | 79 if [ "$WAYLAND" = "yes" ]; then |
80 PKGDEPENDS="graphics/wayland graphics/wayland-protocols $PKGDEPENDS" | |
55 with_platforms="wayland,$with_platforms" | 81 with_platforms="wayland,$with_platforms" |
56 fi | 82 fi |
57 | 83 |
58 if [ "$X" = "yes" ]; then | 84 if [ "$X" = "yes" ]; then |
85 PKGDEPENDS="x11/libx11 | |
86 x11/libxdamage | |
87 x11/libxext | |
88 x11/libxrandr | |
89 x11/libxshmfence | |
90 x11/libxxf86vm | |
91 $PKGDEPENDS" | |
59 with_platforms="x11,$with_platforms" | 92 with_platforms="x11,$with_platforms" |
60 with_dri="-D dri3=true" | 93 with_dri="-D dri3=true" |
61 with_glx="-D glx=dri" | 94 with_glx="-D glx=dri" |
62 else | 95 else |
63 with_dri="-D dri3=false" | 96 with_dri="-D dri3=false" |
81 meson \ | 114 meson \ |
82 --prefix / \ | 115 --prefix / \ |
83 --buildtype release \ | 116 --buildtype release \ |
84 --default-library shared \ | 117 --default-library shared \ |
85 -D libdir=lib \ | 118 -D libdir=lib \ |
86 -D egl=true \ | |
87 -D bpm=true \ | 119 -D bpm=true \ |
88 -D platforms=$with_platforms \ | 120 -D platforms=$with_platforms \ |
89 -D gallium-drivers=$with_gallium_drivers \ | 121 -D gallium-drivers=$with_gallium_drivers \ |
90 -D vulkan-drivers=$with_vulkan_drivers \ | 122 -D vulkan-drivers=$with_vulkan_drivers \ |
123 $with_dri \ | |
124 $with_egl \ | |
125 $with_glvnd \ | |
126 $with_glx \ | |
91 $with_llvm \ | 127 $with_llvm \ |
92 $with_dri \ | |
93 $with_glx \ | |
94 . build | 128 . build |
95 ninja -C build | 129 ninja -C build |
96 DESTDIR=$DESTDIR ninja -C build install | 130 DESTDIR=$DESTDIR ninja -C build install |
97 | 131 |
98 cd .. | 132 cd .. |
99 rm -rf $PKGNAME-$PKGVERSION | 133 rm -rf $PKGNAME-$PKGVERSION |
100 } | 134 } |
101 |