1DOLLY 72TOOLCHAIN mesa-build3REQUIRES HOST runtime@04REQUIRES HOST display@05REQUIRES HOST input@06REQUIRES HOST http@07REQUIRES HOST dso@08REQUIRES HOST sockets@09REQUIRES HOST threads@01011# A build stage over gtk-build: Mesa's OpenGL through EGL's surfaceless12# platform, drawing with softpipe in the program itself (mesa-dolly.patch; its13# parsers are made on the host, prepare-mesa.sh). Static libraries in /usr/lib.14FROM /v0.1.5/demos/gtk/Dollyfile-gtk-build dd68287712c458dcbed6e5002b7ebc29b9388cc5661c6f5a4b9297919c66340d1516REQUIRES TOOL   ar17REQUIRES TOOL   c++18REQUIRES TOOL   cc19REQUIRES TOOL   cp20REQUIRES TOOL   gzip21REQUIRES TOOL   meson22REQUIRES TOOL   mkdir23REQUIRES TOOL   pkg-config24REQUIRES TOOL   python325REQUIRES TOOL   tar2627# The Python modules Mesa's build runs, pure Python as published.28SOURCE /v0.1.5/dist/static/ghostty-gtk/mako-1.4.3-py3-none-any.whl 723296007c870bfd6b3f0c3230dba7198096e5269297ebf5e4eff9e7ffa39d4f /tmp/mesa/mako.whl29SOURCE /v0.1.5/dist/static/ghostty-gtk/packaging-26.3-py3-none-any.whl d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c /tmp/mesa/packaging.whl30SOURCE /v0.1.5/dist/static/ghostty-gtk/markupsafe-3.0.3.tar.gz 722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698 /tmp/mesa/markupsafe.tar.gz31SOURCE /v0.1.5/dist/static/ghostty-gtk/pyyaml-6.0.3.tar.gz d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f /tmp/mesa/pyyaml.tar.gz32SLOP CWD /tmp/mesa gzip -dc markupsafe.tar.gz | tar -xf -33SLOP CWD /tmp/mesa gzip -dc pyyaml.tar.gz | tar -xf -34SLOP CWD /tmp/mesa python3 -c "import shutil, sysconfig, zipfile; site = sysconfig.get_paths()['purelib']; [zipfile.ZipFile(wheel).extractall(site) for wheel in ('mako.whl', 'packaging.whl')]; shutil.copytree('markupsafe-3.0.3/src/markupsafe', site + '/markupsafe'); shutil.copytree('pyyaml-6.0.3/lib/yaml', site + '/yaml')"35SLOP python3 -c 'import mako, markupsafe, packaging, yaml'3637SOURCE /v0.1.5/dist/static/ghostty-gtk/mesa.tar.gz 5aea83f47775edd9ed4b01b6d898b0560f0f1566bf8e595ded2c63f8aa17adfa /tmp/mesa/mesa.tar.gz38SLOP CWD /tmp/mesa gzip -dc mesa.tar.gz | tar -xf - -C /39SLOP CWD /tmp/mesa meson setup build mesa --wrap-mode=nodownload --prefix=/usr --libdir=lib --buildtype=release \40  -Ddefault_library=static -Dplatforms= -Dglx=disabled -Dgallium-drivers=softpipe -Dvulkan-drivers= \41  -Degl=enabled -Dunversion-libgallium=true -Dgbm=disabled -Dgles1=disabled -Dgles2=disabled -Dopengl=true -Dllvm=disabled \42  -Dshared-glapi=disabled -Dzstd=disabled -Dexpat=disabled -Dvalgrind=disabled -Dlibunwind=disabled \43  -Dlmsensors=disabled -Dbuild-tests=false -Dtools= -Dxlib-lease=disabled -Dglvnd=disabled \44  -Dmicrosoft-clc=disabled -Dgallium-rusticl=false -Dvideo-codecs= -Dshader-cache=disabled \45  -Dxmlconfig=disabled -Dperfetto=false -Dsysprof=false -Dgallium-va=disabled -Ddraw-use-llvm=false \46  -Dsse2=false -Dspirv-tools=disabled -Dteflon=false \47  -Dc_args=-D_GNU_SOURCE -Dcpp_args=-D_GNU_SOURCE48SLOP meson compile -C /tmp/mesa/build && meson install --no-rebuild -C /tmp/mesa/build4950# A program draws with softpipe through EGL without a display, as Ghostty's51# renderer does: a renderbuffer cleared and read back. Mesa is partly C++: a52# program is linked with it by c++, as Ghostty is.53FILE /tmp/mesa/egl-check.c54    #define GL_GLEXT_PROTOTYPES55    #include <EGL/egl.h>56    #include <EGL/eglext.h>57    #include <GL/gl.h>58    #include <GL/glext.h>59    #include <string.h>60    #define GL(name) __typeof__(&name) name##_ = (__typeof__(&name))eglGetProcAddress(#name)61    int main(void) {62      EGLDisplay display = eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, NULL);63      const EGLint attributes[] = {EGL_SURFACE_TYPE, 0, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_NONE};64      EGLConfig config;65      EGLint configs;66      if (!eglInitialize(display, NULL, NULL) || !eglChooseConfig(display, attributes, &config, 1, &configs) ||67          configs != 1 || !eglBindAPI(EGL_OPENGL_API)) return 1;68      EGLContext context = eglCreateContext(display, config, EGL_NO_CONTEXT, NULL);69      if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, context)) return 2;70      GL(glGetString);71      GL(glGenFramebuffers);72      GL(glBindFramebuffer);73      GL(glGenRenderbuffers);74      GL(glBindRenderbuffer);75      GL(glRenderbufferStorage);76      GL(glFramebufferRenderbuffer);77      GL(glClearColor);78      GL(glClear);79      GL(glReadPixels);80      if (!strstr((const char *)glGetString_(GL_RENDERER), "softpipe")) return 3;81      GLuint framebuffer, renderbuffer;82      glGenFramebuffers_(1, &framebuffer);83      glBindFramebuffer_(GL_FRAMEBUFFER, framebuffer);84      glGenRenderbuffers_(1, &renderbuffer);85      glBindRenderbuffer_(GL_RENDERBUFFER, renderbuffer);86      glRenderbufferStorage_(GL_RENDERBUFFER, GL_RGBA8, 4, 4);87      glFramebufferRenderbuffer_(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbuffer);88      glClearColor_(1, 0.5f, 0, 1);89      glClear_(GL_COLOR_BUFFER_BIT);90      unsigned char pixel[4];91      glReadPixels_(1, 1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);92      return pixel[0] == 255 && pixel[1] >= 127 && pixel[1] <= 128 && pixel[2] == 0 ? 0 : 4;93    }94SLOP cc -O1 -pthread -c /tmp/mesa/egl-check.c -o /tmp/mesa/egl-check.o && \95  c++ -pthread /tmp/mesa/egl-check.o -o /tmp/mesa/egl-check -lEGL -lgallium_dri -lz -lm && \96  /tmp/mesa/egl-check9798SLOP mkdir -p /usr/share/licenses/mesa99SLOP cp /tmp/mesa/mesa/docs/license.rst /usr/share/licenses/mesa/license.rst100FOLDER /usr/lib/pkgconfig101FOLDER /usr/include102FOLDER /usr/lib103FOLDER /usr/share/licenses104ENTRY /bin/foreground -i /bin/slop105