From a58b49d3635c5016939d1aa0aefd2cd6da8e5556 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jeremy@system76.com>
Date: Sat, 22 Dec 2018 17:20:30 -0700
Subject: [PATCH] Fixes for mesa and gears recipes

---
 recipes/gears/recipe.sh |  4 ++--
 recipes/mesa/recipe.sh  | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/recipes/gears/recipe.sh b/recipes/gears/recipe.sh
index d5c268fe9..77f19a9b8 100644
--- a/recipes/gears/recipe.sh
+++ b/recipes/gears/recipe.sh
@@ -1,4 +1,4 @@
-BUILD_DEPENDS=(liborbital llvm mesa mesa_glu)
+BUILD_DEPENDS=(liborbital mesa mesa_glu zlib)
 
 function recipe_version {
     printf "1.0.0"
@@ -19,7 +19,7 @@ function recipe_prepare {
 function recipe_build {
     sysroot="$(realpath ../sysroot)"
     set -x
-    "${CXX}" -I "$sysroot/include" -L "$sysroot/lib" gears.c -o gears -lorbital $("${PKG_CONFIG}" --libs glu)
+    "${CXX}" -I "$sysroot/include" -L "$sysroot/lib" gears.c -o gears -lorbital $("${PKG_CONFIG}" --libs glu) -lglapi -lz -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
     set +x
     skip=1
 }
diff --git a/recipes/mesa/recipe.sh b/recipes/mesa/recipe.sh
index 347551bda..5c6806806 100644
--- a/recipes/mesa/recipe.sh
+++ b/recipes/mesa/recipe.sh
@@ -1,7 +1,7 @@
 GIT=https://gitlab.redox-os.org/redox-os/mesa.git
 GIT_UPSTREAM=git://anongit.freedesktop.org/mesa/mesa
 GIT_BRANCH=redox
-BUILD_DEPENDS=(expat llvm zlib)
+BUILD_DEPENDS=(expat zlib)
 
 function recipe_version {
     printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
@@ -19,8 +19,8 @@ function recipe_build {
     export CPPFLAGS="-I$sysroot/include -DHAVE_PTHREAD=1"
     export LDFLAGS="-L$sysroot/lib"
     export LIBS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
-    export LLVM_CONFIG="x86_64-unknown-redox-llvm-config"
-    #NOCONFIGURE=1 ./autogen.sh
+    #export LLVM_CONFIG="x86_64-unknown-redox-llvm-config"
+    NOCONFIGURE=1 ./autogen.sh
     ./configure \
         --host="${HOST}" \
         --prefix=/ \
@@ -31,7 +31,7 @@ function recipe_build {
         --disable-glx \
         --disable-gbm \
         --disable-llvm-shared-libs \
-        --enable-llvm \
+        --disable-llvm \
         --enable-gallium-osmesa \
         --with-gallium-drivers=swrast \
         --with-platforms=surfaceless
@@ -50,7 +50,7 @@ function recipe_clean {
 }
 
 function recipe_stage {
-    export LLVM_CONFIG="x86_64-unknown-redox-llvm-config"
+    #export LLVM_CONFIG="x86_64-unknown-redox-llvm-config"
     dest="$(realpath $1)"
     make DESTDIR="$dest" install
     rm -f "$dest/lib/"*.la
-- 
GitLab