linux-qubasis
linux oasis port as a qubes template
git clone https://9o.is/git/linux-qubasis.git
commit 7a1a606961647a1ea09553daf5c2637bf46eb0dd parent 05f47fe6a2a766abdbdb252d496eaafef97e1719 Author: Jul <jul@9o.is> Date: Fri, 28 Nov 2025 07:24:39 -0500 add wld Diffstat:
| M | .gitmodules | | | 4 | ++++ |
| M | pkg/gen.sh | | | 2 | ++ |
| M | pkg/genfn.sh | | | 24 | ++++++++++++++++++++++++ |
| M | pkg/libdrm/gen.sh | | | 14 | ++++---------- |
| M | pkg/wayland-protocols/gen.sh | | | 23 | ----------------------- |
| A | pkg/wld/gen.sh | | | 78 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
6 files changed, 112 insertions(+), 33 deletions(-)
diff --git a/.gitmodules b/.gitmodules @@ -122,6 +122,10 @@ path = pkg/wayland/src url = https://gitlab.freedesktop.org/wayland/wayland.git ignore = all +[submodule "wld"] + path = pkg/wld/src + url = https://github.com/michaelforney/wld + ignore = all [submodule "xen"] path = pkg/xen/src url = git://xenbits.xen.org/xen.git diff --git a/pkg/gen.sh b/pkg/gen.sh @@ -1,4 +1,5 @@ TARGET_ARCH=x86_64 +VIDEO_DRIVERS='intel nouveau amdgpu' var ar $TARGET_ARCH-linux-musl-ar var as $TARGET_ARCH-linux-musl-as @@ -57,6 +58,7 @@ pkg util-linux pkg vis pkg wayland-protocols pkg wayland +pkg wld pkg xen pkg xz pkg yajl diff --git a/pkg/genfn.sh b/pkg/genfn.sh @@ -431,3 +431,27 @@ fini_files() { GEN_OUTS="$GEN_OUTS $DIR/files" fi } + +waylandproto() { + _proto=$1 + shift 1 + + while [ $# -gt 1 ]; do + wayland_proto $2 $_proto + case $1 in + --client) bind type client-header;; + --server) bind type server-header;; + --code) + bind type public-code + cc $outdir/$2.o $outdir/$2 '||' ./pkg/wayland/headers + bind cflags $cflags -isystem $pkgdir/wayland/include + ;; + *) error unknown waylandproto flag $1 + esac + shift 2 + done +} + +has_video_driver() { + has $1 $VIDEO_DRIVERS +} diff --git a/pkg/libdrm/gen.sh b/pkg/libdrm/gen.sh @@ -1,13 +1,7 @@ -VIDEO_DRIVERS='intel nouveau amdgpu' #'intel nouveau amdgpu' - git libdrm-2.4.120 -has_driver() { - has $1 $VIDEO_DRIVERS -} - driver_flag() { - has_driver $1 && printf 1 || printf 0 + has_video_driver $1 && printf 1 || printf 0 } cflags " @@ -56,7 +50,7 @@ lib libdrm.a " xf86drmSL.c " -if has_driver intel; then +if has_video_driver intel; then lib libdrm_intel.a --src-prefix intel -isystem $pkgdir/libpciaccess/include \ -Wno-pedantic -Wno-missing-field-initializers " intel_bufmgr.c @@ -68,7 +62,7 @@ if has_driver intel; then " fi -if has_driver nouveau; then +if has_video_driver nouveau; then lib libdrm_nouveau.a --src-prefix nouveau -Wno-pedantic " abi16.c bufctx.c @@ -77,7 +71,7 @@ if has_driver nouveau; then " fi -if has_driver amdgpu; then +if has_video_driver amdgpu; then lib libdrm_amdgpu.a --src-prefix amdgpu -Wno-pedantic -Wno-attributes \ -D'AMDGPU_ASIC_ID_TABLE=\"%s/share/libdrm/amdgpu.ids\"' " amdgpu_asic_id.c diff --git a/pkg/wayland-protocols/gen.sh b/pkg/wayland-protocols/gen.sh @@ -1,9 +1,5 @@ git 1.31 -cflags -isystem $pkgdir/wayland/include - -dep wayland/headers - include --src-prefix $outdir " presentation-time-client-protocol.h xdg-shell-client-protocol.h @@ -18,25 +14,6 @@ include --src-prefix $outdir " text-input-unstable-v3-server-protocol.h " -waylandproto() { - _proto=$1 - shift 1 - - while [ $# -gt 1 ]; do - wayland_proto $2 $_proto - case $1 in - --client) bind type client-header;; - --server) bind type server-header;; - --code) - bind type public-code - cc $outdir/$2.o $outdir/$2 '||' $dir/deps - ;; - *) error unknown waylandproto flag $1 - esac - shift 2 - done -} - waylandproto stable/presentation-time/presentation-time.xml \ --client presentation-time-client-protocol.h \ --code presentation-time-protocol.c diff --git a/pkg/wld/gen.sh b/pkg/wld/gen.sh @@ -0,0 +1,78 @@ +git 3fe15e7 + +cflags " + -DWITH_WAYLAND_SHM + -DWITH_WAYLAND_DRM + -I$outdir + -isystem $pkgdir/fontconfig/include + -isystem $pkgdir/freetype/include + -isystem $pkgdir/libdrm/include + -isystem $pkgdir/linux-headers/include + -isystem $pkgdir/pixman/include + -isystem $pkgdir/wayland/include + -Wno-pedantic + -Wno-unused-parameter + -Wno-sign-compare + -Wno-old-style-declaration +" + +dep " + $outdir/protocol/wayland-drm-client-protocol.h + fontconfig/headers + freetype/headers + libdrm/headers + linux-headers/headers + pixman/headers + wayland/headers +" + +include --prefix wld " + drm.h + pixman.h + wayland.h + wld.h +" + +waylandproto protocol/wayland-drm.xml \ + --client protocol/wayland-drm-client-protocol.h \ + --server protocol/wayland-drm-server-protocol.h \ + --code wayland-drm-protocol.c + +srcs=" + buffer.c + buffered_surface.c + color.c + context.c + drm.c + dumb.c + font.c + renderer.c + surface.c + pixman.c + wayland.c + wayland-shm.c + wayland-drm.c + $outdir/wayland-drm-protocol.c.o +" + +libs=" + $pkgdir/fontconfig/libfontconfig.a.d + $pkgdir/freetype/libfreetype.a.d + $pkgdir/libdrm/libdrm.a + $pkgdir/pixman/libpixman.a + $pkgdir/wayland/libwayland-client.a.d +" + +if has_video_driver intel; then + cflags -DWITH_DRM_INTEL -isystem ./pkg/libdrm/src/intel + srcs="$srcs intel.c intel/batch.c" + libs="$libs $pkgdir/libdrm/libdrm_intel.a.d" +fi + +if has_video_driver nouveau; then + cflags -DWITH_DRM_NOUVEAU -isystem ./pkg/libdrm/src/nouveau + srcs="$srcs nouveau.c" + libs="$libs $pkgdir/libdrm/libdrm_nouveau.a" +fi + +lib libwld.a $srcs $libs