aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-20 05:10:41 +0900
committerOphestra <cat@gensokyo.uk>2026-05-20 05:10:41 +0900
commit1a9974ffdc63e9deb24e4c83f4b4ce566311360f (patch)
tree97f9b4686a77f1006c2abe08281592d1d326d314 /internal
parent1a2699b4867b7a736eedd973d69659ef468a994a (diff)
internal/rosa/package: migrate qemu
This has many dependencies. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
-rw-r--r--internal/rosa/package/qemu/disable-mcast-test.patch22
-rw-r--r--internal/rosa/package/qemu/package.az80
-rw-r--r--internal/rosa/qemu.go109
-rw-r--r--internal/rosa/state_native.go7
4 files changed, 102 insertions, 116 deletions
diff --git a/internal/rosa/package/qemu/disable-mcast-test.patch b/internal/rosa/package/qemu/disable-mcast-test.patch
new file mode 100644
index 00000000..2308436c
--- /dev/null
+++ b/internal/rosa/package/qemu/disable-mcast-test.patch
@@ -0,0 +1,22 @@
+diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c
+index b731af0ad9..b5cbed4801 100644
+--- a/tests/qtest/netdev-socket.c
++++ b/tests/qtest/netdev-socket.c
+@@ -401,7 +401,7 @@ static void test_dgram_inet(void)
+ qtest_quit(qts0);
+ }
+
+-#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
++#if 0
+ static void test_dgram_mcast(void)
+ {
+ QTestState *qts;
+@@ -513,7 +513,7 @@ int main(int argc, char **argv)
+ if (has_ipv4) {
+ qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
+ qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
+-#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
++#if 0
+ qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
+ #endif
+ }
diff --git a/internal/rosa/package/qemu/package.az b/internal/rosa/package/qemu/package.az
new file mode 100644
index 00000000..0e2ac662
--- /dev/null
+++ b/internal/rosa/package/qemu/package.az
@@ -0,0 +1,80 @@
+package qemu {
+ description = "a generic and open source machine emulator and virtualizer";
+ website = "https://www.qemu.org";
+ anitya = 13607;
+
+ version* = "11.0.0";
+ source = remoteTar {
+ url = "https://download.qemu.org/qemu-"+version+".tar.bz2";
+ checksum = "C64gdi_Tkdg2fTwD9ERxtWGcf8vNn_6UvczW0c-x0KW1NZtd3NbEOIrlDhYGn15n";
+ compress = bzip2;
+ };
+ patches = [ "disable-mcast-test.patch" ];
+
+ // configure script uses source as scratch space
+ writable = true;
+ chmod = true;
+
+ early = `
+# tests expect /var/tmp/ to be available
+mkdir -p /var/tmp/
+
+# https://gitlab.com/qemu-project/qemu/-/issues/3145
+sed -i \
+ 's,Input/output error,I/O error,g' \
+ tests/qemu-iotests/[0-9][0-9][0-9]* \
+ tests/qemu-iotests/tests/copy-before-write \
+ tests/qemu-iotests/tests/file-io-error.out
+cat << EOF > tests/qemu-iotests/150
+#!/bin/sh
+_notrun 'appears to spuriously fail on zfs'
+EOF
+`;
+
+ exec = make {
+ configure = {
+ "disable-download";
+ "disable-docs";
+
+ "static";
+ "target-list-exclude": join {
+ elems = [
+ // fails to load firmware
+ "ppc-linux-user",
+ "ppc64-linux-user",
+ "ppc64le-linux-user",
+ "ppc-softmmu",
+ "ppc64-softmmu",
+ ];
+ sep = ",";
+ };
+ };
+ };
+
+ inputs = [
+ bash,
+ python,
+ python-setuptools,
+ python-wheel,
+ ninja,
+ pkg-config,
+ diffutils,
+
+ openssl,
+ xz,
+
+ flex,
+ bison,
+ m4,
+
+ glib,
+ zstd,
+ dtc,
+ kernel-headers,
+ ];
+
+ runtime = [
+ glib,
+ zstd,
+ ];
+}
diff --git a/internal/rosa/qemu.go b/internal/rosa/qemu.go
deleted file mode 100644
index fa7bac02..00000000
--- a/internal/rosa/qemu.go
+++ /dev/null
@@ -1,109 +0,0 @@
-package rosa
-
-import "hakurei.app/internal/pkg"
-
-func (t Toolchain) newQEMU() (pkg.Artifact, string) {
- const (
- version = "11.0.0"
- checksum = "C64gdi_Tkdg2fTwD9ERxtWGcf8vNn_6UvczW0c-x0KW1NZtd3NbEOIrlDhYGn15n"
- )
- return t.NewPackage("qemu", version, newTar(
- "https://download.qemu.org/qemu-"+version+".tar.bz2",
- checksum,
- pkg.TarBzip2,
- ), &PackageAttr{
- Patches: []KV{
- {"disable-mcast-test", `diff --git a/tests/qtest/netdev-socket.c b/tests/qtest/netdev-socket.c
-index b731af0ad9..b5cbed4801 100644
---- a/tests/qtest/netdev-socket.c
-+++ b/tests/qtest/netdev-socket.c
-@@ -401,7 +401,7 @@ static void test_dgram_inet(void)
- qtest_quit(qts0);
- }
-
--#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
-+#if 0
- static void test_dgram_mcast(void)
- {
- QTestState *qts;
-@@ -513,7 +513,7 @@ int main(int argc, char **argv)
- if (has_ipv4) {
- qtest_add_func("/netdev/stream/inet/ipv4", test_stream_inet_ipv4);
- qtest_add_func("/netdev/dgram/inet", test_dgram_inet);
--#if !defined(_WIN32) && !defined(CONFIG_DARWIN)
-+#if 0
- qtest_add_func("/netdev/dgram/mcast", test_dgram_mcast);
- #endif
- }
-`},
- },
-
- // configure script uses source as scratch space
- Writable: true,
- Chmod: true,
-
- ScriptEarly: `
-# tests expect /var/tmp/ to be available
-mkdir -p /var/tmp/
-
-# https://gitlab.com/qemu-project/qemu/-/issues/3145
-sed -i \
- 's,Input/output error,I/O error,g' \
- tests/qemu-iotests/[0-9][0-9][0-9]* \
- tests/qemu-iotests/tests/copy-before-write \
- tests/qemu-iotests/tests/file-io-error.out
-cat << EOF > tests/qemu-iotests/150
-#!/bin/sh
-_notrun 'appears to spuriously fail on zfs'
-EOF
-`,
- }, &MakeHelper{
- Configure: []KV{
- {"disable-download"},
- {"disable-docs"},
-
- {"static"},
- {"target-list-exclude", "" +
- // fails to load firmware
- "ppc-linux-user," +
- "ppc64-linux-user," +
- "ppc64le-linux-user," +
- "ppc-softmmu," +
- "ppc64-softmmu"},
- },
- },
- Bash,
- Python,
- PythonSetuptools,
- PythonWheel,
- Ninja,
- PkgConfig,
- Diffutils,
-
- OpenSSL,
- XZ,
-
- Flex,
- Bison,
- M4,
-
- GLib,
- Zstd,
- DTC,
- KernelHeaders,
- ), version
-}
-func init() {
- native.mustRegister(Toolchain.newQEMU, &Metadata{
- Name: "qemu",
- Description: "a generic and open source machine emulator and virtualizer",
- Website: "https://www.qemu.org/",
-
- Dependencies: P{
- GLib,
- Zstd,
- },
-
- ID: 13607,
- })
-}
diff --git a/internal/rosa/state_native.go b/internal/rosa/state_native.go
index a092e79e..fec5d58a 100644
--- a/internal/rosa/state_native.go
+++ b/internal/rosa/state_native.go
@@ -13,17 +13,14 @@ var (
Bzip2 = H("bzip2")
Coreutils = H("coreutils")
DBus = H("dbus")
- DTC = H("dtc")
Diffutils = H("diffutils")
Findutils = H("findutils")
- Flex = H("flex")
FontUtil = H("font-util")
Freetype = H("freetype")
Fuse = H("fuse")
GLib = H("glib")
Gawk = H("gawk")
GenInitCPIO = H("gen_init_cpio")
- Gettext = H("gettext")
Go = H("go")
Gzip = H("gzip")
Hakurei = H("hakurei")
@@ -43,7 +40,6 @@ var (
Libmd = H("libmd")
Libpciaccess = H("libpciaccess")
Libseccomp = H("libseccomp")
- Libtasn1 = H("libtasn1")
Libtirpc = H("libtirpc")
Libtool = H("libtool")
LibxcbRenderUtil = H("libxcb-render-util")
@@ -61,13 +57,10 @@ var (
NSSCACert = H("nss-cacert")
Ncurses = H("ncurses")
Nettle = H("nettle")
- OpenSSL = H("openssl")
Patch = H("patch")
Pixman = H("pixman")
PkgConfig = H("pkg-config")
PythonPyTest = H("python-pytest")
- PythonSetuptools = H("python-setuptools")
- PythonWheel = H("python-wheel")
QEMU = H("qemu")
Sed = H("sed")
SquashfsTools = H("squashfs-tools")