# HG changeset patch # User David Demelier # Date 1553199300 -3600 # Node ID 99bc133dd404c25e1a5c9ed9f2d98a420a0455d2 # Parent 16aaf65523ded8d4c7c2355cbfe2885a9cb3db6d graphics/mesa: initial import, closes #1281 diff -r 16aaf65523de -r 99bc133dd404 graphics/mesa/mesa.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graphics/mesa/mesa.sh Thu Mar 21 21:15:00 2019 +0100 @@ -0,0 +1,99 @@ +#!/bin/sh +# +# Copyright (c) 2019 David Demelier +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +PKGNAME=mesa +PKGVERSION=18.3.5 +PKGREVISION=1 +PKGLICENSE="CUSTOM" +PKGSUMMARY="opensource OpenGL implementation" +PKGDOWNLOAD="https://mesa.freedesktop.org/archive/$PKGNAME-$PKGVERSION.tar.xz" +PKGDEPENDS="" +PKGOPTIONS="DRM LLVM WAYLAND X" + +: ${CC:=gcc} +: ${CFLAGS:=-O2} +: ${CXX:=g++} +: ${CXXFLAGS:=-O2} +: ${LDFLAGS:=} +: ${DRM:=yes} +: ${LLVM:=yes} +: ${WAYLAND:=yes} +: ${X:=yes} + +with_platforms="" +with_gallium_drivers="r300,r600,virgl,svga,swrast" +with_vulkan_drivers="intel" + +if [ "$DRM" = "yes" ]; then + with_platforms="drm,$platforms" +fi + +if [ "$LLVM" = "yes" ]; then + PKGDEPENDS="dev/llvm:build $PKGDEPENDS" + with_llvm="-D llvm=true" + with_gallium_drivers="radeonsi,$with_gallium_drivers" + with_vulkan_drivers="amd,$with_vulkan_drivers" +else + with_llvm="-D llvm=false" +fi + +if [ "$WAYLAND" = "yes" ]; then + with_platforms="wayland,$with_platforms" +fi + +if [ "$X" = "yes" ]; then + with_platforms="x11,$with_platforms" + with_dri="-D dri3=true" + with_glx="-D glx=dri" +else + with_dri="-D dri3=false" + with_glx="-D glx=disabled" +fi + +build() +{ + rm -rf $PKGNAME-$PKGVERSION + tar xvaf $PKGNAME-$PKGVERSION.tar.xz + pushd $PKGNAME-$PKGVERSION + + # https://git.alpinelinux.org/aports/plain/main/mesa/musl-fix-includes.patch + patch -p1 < ../musl.patch + CC="$CC" \ + CFLAGS="$CFLAGS" \ + CXX="$CXX" \ + CXXFLAGS="$CXXFLAGS" \ + LDFLAGS="$LDFLAGS" \ + meson \ + --prefix /usr \ + --buildtype release \ + --default-library shared \ + -D egl=true \ + -D bpm=true \ + -D platforms=$with_platforms \ + -D gallium-drivers=$with_gallium_drivers \ + -D vulkan-drivers=$with_vulkan_drivers \ + $with_llvm \ + $with_dri \ + $with_glx \ + . build + ninja -C build + DESTDIR=$DESTDIR ninja -C build install + + popd + rm -rf $PKGNAME-$PKGVERSION +} + diff -r 16aaf65523de -r 99bc133dd404 graphics/mesa/musl.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graphics/mesa/musl.patch Thu Mar 21 21:15:00 2019 +0100 @@ -0,0 +1,21 @@ +--- a/src/util/rand_xor.c ++++ b/src/util/rand_xor.c +@@ -24,6 +24,8 @@ + + #if defined(__linux__) + #include ++#include ++#include + #include + #include + #else +--- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig ++++ ./src/gallium/winsys/svga/drm/vmw_screen.h +@@ -34,7 +34,7 @@ + #ifndef VMW_SCREEN_H_ + #define VMW_SCREEN_H_ + +- ++#include + #include "pipe/p_compiler.h" + #include "pipe/p_state.h"