defpkgbuild(xf86-video-fbdev, #:pkgname, "xf86-video-fbdev", #:pkgver, "0.5.1", #:pkgrel, 2, #:pkgdesc, "Vinix Xorg framebuffer driver", #:arch, [#:x86-64, #:aarch64], #:license, "MIT", #:url, "https://www.x.org/", #:depends, ["xorg-server"], #:makedepends, ["linux-headers", "xorgproto"], #:source, [ "https://xorg.freedesktop.org/archive/individual/driver/xf86-video-fbdev-0.5.1.tar.xz", "https://raw.githubusercontent.com/vlang/vinix/c34a6707e1d8d3a23d0b1bfe6e6dbb16290e4f75/patches/xf86-video-fbdev/jinx-working-patch.patch" ], #:sha256sums, [ "9c2bc0fb9af092804138e8d5cb5627cabf2919ef60f0d1544a95c4ac2047f387", "3b4460c13dc2b3216df24f2638a64d9b8e49ce88bd2c1a1fdd74c2ad72d9a9d4" ], #:prepare, fn() { run("patch", "--batch", "--fuzz=0", "-d", "xf86-video-fbdev-0.5.1", "-p1", "-i", "../jinx-working-patch.patch") }, #:build, fn() { root := get-environment-variable("VPAC_MAKEPKG_ROOT") modules := string-append(root, "/usr/lib/xorg/modules") run("env", "CPPFLAGS=-D__vinix__", string-append("LDFLAGS=-L", modules, " -Wl,-rpath-link,", modules), "vinix-configure", "xf86-video-fbdev-0.5.1/configure", "--disable-pciaccess") run("make", string-append("SYSROOT=", root), "moduledir=/usr/lib/xorg/modules") }, #:check, fn() { run("readelf", "-d", "src/.libs/fbdev_drv.so") }, #:package, fn() { run("make", "install", "moduledir=/usr/lib/xorg/modules", string-append("DESTDIR=", pkgdir())) run("find", pkgdir(), "-name", "*.la", "-delete") run("install", "-Dm644", "xf86-video-fbdev-0.5.1/COPYING", string-append(pkgdir(), "/usr/share/licenses/xf86-video-fbdev/COPYING")) run("find", string-append(pkgdir(), "/usr"), "-type", "d", "-exec", "chmod", "755", "{}", "+") })