| 1 | defpkgbuild(freeglut, |
| 2 | #:pkgname, "freeglut", |
| 3 | #:pkgver, "3.4.0", |
| 4 | #:pkgrel, 2, |
| 5 | #:pkgdesc, "OpenGL Utility Toolkit for X11", |
| 6 | #:arch, [#:x86-64, #:aarch64], |
| 7 | #:url, "https://freeglut.sourceforge.net/", |
| 8 | #:license, "MIT", |
| 9 | #:depends, ["mesa-glx-legacy", "libx11", "libxi", "libxxf86vm"], |
| 10 | #:makedepends, ["mesa", "libice", "glu"], |
| 11 | #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/freeglut-3.4.0.tar.gz"], |
| 12 | #:sha256sums, ["3c0bcb915d9b180a97edaebd011b7a1de54583a838644dcd42bb0ea0c6f3eaec"], |
| 13 | #:build, fn() { |
| 14 | ; FreeGLUT 3.4 still uses unprototyped callbacks that change meaning in C23. |
| 15 | run("vinix-cmake", "freeglut-3.4.0", "build", "-DFREEGLUT_BUILD_STATIC_LIBS=OFF", |
| 16 | "-DFREEGLUT_BUILD_DEMOS=OFF", "-DFREEGLUT_REPLACE_GLUT=ON", "-DFREEGLUT_WAYLAND=OFF", |
| 17 | "-DCMAKE_C_STANDARD=17", "-DCMAKE_C_STANDARD_REQUIRED=ON") |
| 18 | run("cmake", "--build", "build", "--parallel", "2") |
| 19 | }, |
| 20 | #:check, fn() { |
| 21 | run("readelf", "-d", "build/lib/libglut.so.3") |
| 22 | }, |
| 23 | #:package, fn() { |
| 24 | run("env", string-append("DESTDIR=", pkgdir()), "cmake", "--install", "build") |
| 25 | run("test", "-s", string-append(pkgdir(), "/usr/lib/pkgconfig/glut.pc")) |
| 26 | run("ln", "-s", "glut.pc", string-append(pkgdir(), "/usr/lib/pkgconfig/freeglut.pc")) |
| 27 | run("install", "-Dm644", "freeglut-3.4.0/COPYING", string-append(pkgdir(), "/usr/share/licenses/freeglut/COPYING")) |
| 28 | run("find", string-append(pkgdir(), "/usr"), "-type", "d", "-exec", "chmod", "755", "{}", "+") |
| 29 | }) |
| 30 | |