diff --git a/.github/scripts/netbsd/install-pkg.sh b/.github/scripts/netbsd/install-pkg.sh new file mode 100755 index 0000000000..19cb9b56ac --- /dev/null +++ b/.github/scripts/netbsd/install-pkg.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +set -e + +. .github/scripts/util.sh + +export PATH="$PATH:/usr/sbin:/sbin:/usr/local/sbin" + +pkg_add -v pkgin +pkgin update + +echo "--> install extra dependencies" +pkgin -y install \ + bash git pkgconf autoconf automake libtool xorgproto meson pixman xtrans \ + libxkbfile libxcvt libpciaccess font-util libepoll-shim libepoxy nettle \ + xkbcomp xcb-util libXcursor libXScrnSaver spice-protocol fontconfig \ + mkfontscale python311 gmake curl + +FILESET_URL=https://cdn.netbsd.org/pub/NetBSD/NetBSD-10.0/amd64/binary/sets + +for i in xbase xetc xfont xcomp xserver ; do + echo "downloading $FILESET_URL/$i.tar.xz --> /$i.tar.xz" + curl $FILESET_URL/$i.tar.xz -o /$i.tar.xz + echo "unpacking /$i.tar.xz" + tar --unlink -xJf /$i.tar.xz -C / +done + +mkdir -p $X11_BUILD_DIR +cd $X11_BUILD_DIR + +export X11_INSTALL_PREFIX=/usr/pkg + +build_ac xorg-macros $(fdo_mirror xorg-macros) refs/tags/util-macros-1.20.2 +build_ac libxcb-wm $(fdo_mirror libxcb-wm) refs/tags/xcb-util-wm-0.4.2 diff --git a/.github/scripts/netbsd/run-xserver-build.sh b/.github/scripts/netbsd/run-xserver-build.sh new file mode 100755 index 0000000000..91184a388b --- /dev/null +++ b/.github/scripts/netbsd/run-xserver-build.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -e + +./.github/scripts/netbsd/install-pkg.sh + +echo "--> running xserver build ...." +export MESON_BUILDDIR=_build + +rm -rf "$MESON_BUILDDIR" +meson setup "$MESON_BUILDDIR" $MESON_ARGS +meson configure "$MESON_BUILDDIR" +meson compile -v -C "$MESON_BUILDDIR" $jobcount $ninja_args +# tests not working yet +# meson test -C "$MESON_BUILDDIR" --print-errorlogs $MESON_TEST_ARGS +meson install --no-rebuild -C "$MESON_BUILDDIR" $MESON_INSTALL_ARGS +# making trouble w/ git tree copied into the VM +# meson dist -C "$MESON_BUILDDIR" $MESON_DIST_ARGS diff --git a/.github/scripts/util.sh b/.github/scripts/util.sh index 7721888611..e91d5dd968 100644 --- a/.github/scripts/util.sh +++ b/.github/scripts/util.sh @@ -1,6 +1,8 @@ . .github/scripts/conf.sh +[ "$X11_INSTALL_PREFIX" ] || X11_INSTALL_PREFIX="$X11_PREFIX" + SOURCE_DIR=`pwd` clone_source() { @@ -41,13 +43,14 @@ build_ac() { shift shift shift || true + mkdir -p $X11_PREFIX if [ -f $X11_PREFIX/$pkgname.DONE ]; then echo "package $pkgname already built" else clone_source "$pkgname" "$url" "$ref" ( cd $pkgname - ./autogen.sh --prefix=$X11_PREFIX + ./autogen.sh --prefix=$X11_INSTALL_PREFIX make -j${FDO_CI_CONCURRENT:-4} install ) touch $X11_PREFIX/$pkgname.DONE diff --git a/.github/workflows/build-xserver.yml b/.github/workflows/build-xserver.yml index 3ab4c2ba7b..554c227261 100644 --- a/.github/workflows/build-xserver.yml +++ b/.github/workflows/build-xserver.yml @@ -260,6 +260,20 @@ jobs: release: "6.4.2" run: ./.github/scripts/DragonFlyBSD/run-xserver-build.sh + xserver-build-netbsd: + runs-on: ubuntu-latest + env: + MESON_ARGS: -Dwerror=true -Dxephyr=true -Dxorg=true -Dxvfb=true -Dxnest=true -Dxfbdev=false + steps: + - uses: actions/checkout@v4 + - uses: vmactions/netbsd-vm@v1 + id: vm + with: + envs: 'MESON_ARGS' + usesh: true + release: '10.1' + run: ./.github/scripts/netbsd/run-xserver-build.sh + release: name: Release pushed tag runs-on: ubuntu-latest @@ -271,6 +285,7 @@ jobs: - xserver-build-macos - xserver-build-freebsd - xserver-build-dragonflybsd + - xserver-build-netbsd steps: - name: Checkout uses: actions/checkout@v4