[PATCH v1 2/2] Add QEMU 5 configuration files

Ryan Long ryan.long at oarcorp.com
Mon Aug 22 20:29:15 UTC 2022


---
 bare/config/devel/qemu-5.2.0-1.cfg      |  42 +++++++
 bare/config/devel/qemu-couverture.bset  |   2 +-
 bare/config/devel/qemu.bset             |   2 +-
 source-builder/config/qemu-5-1.cfg      |   9 ++
 source-builder/config/qemu-common-2.cfg | 145 ++++++++++++++++++++++++
 5 files changed, 198 insertions(+), 2 deletions(-)
 create mode 100644 bare/config/devel/qemu-5.2.0-1.cfg
 create mode 100644 source-builder/config/qemu-5-1.cfg
 create mode 100644 source-builder/config/qemu-common-2.cfg

diff --git a/bare/config/devel/qemu-5.2.0-1.cfg b/bare/config/devel/qemu-5.2.0-1.cfg
new file mode 100644
index 0000000..1c1cfeb
--- /dev/null
+++ b/bare/config/devel/qemu-5.2.0-1.cfg
@@ -0,0 +1,42 @@
+#
+# Qemu from git
+#
+
+%if %{release} == %{nil}
+ %define release 1
+%endif
+
+%include %{_configdir}/base.cfg
+
+%include %{_configdir}/bare-config.cfg
+
+#
+# Stable version. Qemu is fast moving.
+#
+%define qemu_version 5.2.0-rc1
+
+#
+# Use released sources.
+#
+%source set qemu https://download.qemu.org/qemu-%{qemu_version}.tar.xz
+%hash sha512 qemu-%{qemu_version}.tar.xz \
+        U0XJ6IEe/iwbq5LsuEbyZ9xu8qZ6wDo5VHNE3IEKEwJ+9zUscgnVKOyBEI28Hl6cqW2m9zBsaCrY94X1lvpN3g==
+
+#
+# Patches from Qemu's patchworks site.
+#
+%patch add qemu pw://patchwork.ozlabs.org/patch/406903/raw/Provide-the-missing-LIBUSB_LOG_LEVEL_-for-older-libusb-or-FreeBSD.-Providing-just-the-needed-value-as-a-defined..patch
+%hash sha256 Provide-the-missing-LIBUSB_LOG_LEVEL_-for-older-libusb-or-FreeBSD.-Providing-just-the-needed-value-as-a-defined..patch \
+         40399fcedb44b2c1bfa1a95af482f7f335f42d713967ed2f34980a7a940c3740
+
+#
+# Patches to build qemu sparc with Leon3 support
+#
+%patch add qemu https://gaisler.se/qemu/qemu-5.2.0-leon3.patch
+%hash sha512 qemu-5.2.0-leon3.patch \
+       cQju/ja5SAM+gsXEkzSteeR+7PjG9g2w+yUb4kg1eZoOSm2MmZDjA/auINVdRax8wgtIEWnzq5/hdY7/THnowg==
+
+#
+# The Qemu build instructions. We use 5.x.x Release 1.
+#
+%include %{_configdir}/qemu-5-1.cfg
diff --git a/bare/config/devel/qemu-couverture.bset b/bare/config/devel/qemu-couverture.bset
index fd5547c..60bec8e 100644
--- a/bare/config/devel/qemu-couverture.bset
+++ b/bare/config/devel/qemu-couverture.bset
@@ -22,5 +22,5 @@ devel/gettext-0.18.3.1-1
 devel/libffi-3.0.13-1
 devel/pixman-0.32.4-1
 devel/glib-2.48.2-1
-devel/dtc-1.6.0-1
+devel/dtc-1.6.1-1
 devel/qemu-couverture-git-1
diff --git a/bare/config/devel/qemu.bset b/bare/config/devel/qemu.bset
index a8b1ebf..3a9b0d5 100644
--- a/bare/config/devel/qemu.bset
+++ b/bare/config/devel/qemu.bset
@@ -21,4 +21,4 @@ devel/gettext-0.18.3.1-1
 devel/libffi-3.0.13-1
 devel/pixman-0.40.0-1
 devel/glib-2.48.2-1
-devel/qemu-git-1
+devel/qemu-5.2.0-1
diff --git a/source-builder/config/qemu-5-1.cfg b/source-builder/config/qemu-5-1.cfg
new file mode 100644
index 0000000..7ca58b8
--- /dev/null
+++ b/source-builder/config/qemu-5-1.cfg
@@ -0,0 +1,9 @@
+#
+# QEMU 5 Version 1.
+#
+# This configuration file configure's, make's and install's QEMU.
+#
+
+%define qemu_disables --disable-nettle
+
+%include %{_configdir}/qemu-common-2.cfg
diff --git a/source-builder/config/qemu-common-2.cfg b/source-builder/config/qemu-common-2.cfg
new file mode 100644
index 0000000..1dbaf05
--- /dev/null
+++ b/source-builder/config/qemu-common-2.cfg
@@ -0,0 +1,145 @@
+#
+# QEMU Common Version 1.
+#
+# This configuration file configure's, make's and install's QEMU.
+#
+
+%if %{release} == %{nil}
+%define release 1
+%endif
+
+#
+# Select Snapshot Macro Maps
+#
+%select qemu-snapshot
+
+#
+# The description.
+#
+Name:      qemu-%{qemu_version}-%{_host}-%{release}
+Summary:   Qemu is a simulator of various processors.
+Version:   %{qemu_version}
+Release:   %{release}
+URL: 	   http://www.qemu.org/
+
+#
+# Source
+#
+%source set qemu http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2
+
+
+#
+# QEMU Disable component list.
+#
+# We are not interested in the VM use case for qemu and most of that
+# functionality carries host platform baggage which complicates building on a
+# range of host platforms.
+#
+# You can specialise before including this config file.
+#
+#
+%define qemu_std_disables --disable-werror
+%define qemu_std_disables %{qemu_std_disables} --disable-tools
+%define qemu_std_disables %{qemu_std_disables} --disable-pie
+%define qemu_std_disables %{qemu_std_disables} --disable-vnc
+%define qemu_std_disables %{qemu_std_disables} --disable-sdl
+%define qemu_std_disables %{qemu_std_disables} --disable-gtk
+%define qemu_std_disables %{qemu_std_disables} --disable-opengl
+%define qemu_std_disables %{qemu_std_disables} --disable-netmap
+%ifn %{defined qemu_disables}
+ %define qemu_disables %{nil}
+%endif
+%define qemu_disables %{qemu_std_disables} %{qemu_disables}
+
+#
+# QEMU Targets to build.
+#
+%if %{!defined qemu_archs} && %{!defined with_qemu_archs}
+ %define qemu_target_list %{nil}
+%else
+ %if %{defined with_qemu_archs}
+  %define qemu_target_list --target-list=%{with_qemu_archs}
+ %else
+  %define qemu_target_list --target-list=%{qemu_archs}
+ %endif
+%endif
+
+#
+# Clear the path to SB, meson does not like the python pkg-config
+#
+%define _extra_path %{nil}
+
+#
+# Prepare the source code.
+#
+%prep
+  build_top=$(pwd)
+
+  source_dir_qemu="qemu-%{qemu_version}"
+  %source setup qemu -q -n qemu-%{qemu_version}
+  %patch setup qemu -p1
+
+  cd ${build_top}
+
+%build
+  build_top=$(pwd)
+
+  %{build_directory}
+
+  mkdir -p ${build_dir}
+  cd ${build_dir}
+
+  %if %{pkgconfig check vdeplug}
+    VDE_CONFIG="--enable-vde"
+    VDE_CFLAGS="%{pkgconfig cflags vdeplug}"
+    VDE_LDFLAGS="%{pkgconfig ldflags vdeplug} %{pkgconfig libs vdeplug}"
+  %endif
+
+  %{host_build_flags}
+
+  if test "%{_build}" != "%{_host}" ; then
+    CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-"
+  fi
+
+  SYSROOT=$SB_TMPPREFIX
+
+  STAGED_GLIB="-I${SB_TMPPREFIX}/include/glib-2.0 -I${SB_TMPPREFIX}/lib/glib-2.0/include"
+  STAGED_PIXMAN=" -I${SB_TMPPREFIX}/include/pixman-1"
+  STAGED_INCLUDES="${STAGED_GLIB} ${STAGED_PIXMAN}"
+
+  CC="${CC} ${STAGED_INCLUDES}"
+  CXX="${CXX} ${STAGED_INCLUDES}"
+
+  #
+  # Hack warning: MSYS2 does not seem to convert the path to
+  #               a shell path from Windows so we keep them
+  #               separate and handle it in the pkgconfig tool.
+  #
+  PKG_CONFIG_DEFAULT_PATH=${PKG_CONFIG_PATH} \
+  PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \
+  PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \
+  %{_ld_library_path}=$SYSROOT/lib \
+  LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib -L$SYSROOT/lib ${VDE_LDFLAGS}" \
+  CFLAGS="${CFLAGS} ${VDE_CFLAGS}" \
+  ../${source_dir_qemu}/configure \
+    --prefix=%{_prefix} \
+    ${CROSS_PREFIX_OPTION} \
+    --make=%{__make} \
+    %{qemu_target_list} \
+    ${VDE_CONFIG} \
+    %{qemu_disables}
+
+  %{_ld_library_path}=$SYSROOT/lib \
+  %{__make} %{?_smp_mflags} all
+
+  cd ${build_top}
+
+%install
+  build_top=$(pwd)
+
+  %{__rmdir} $SB_BUILD_ROOT
+
+  cd ${build_dir}
+  %{_ld_library_path}=$SYSROOT/lib \
+  %{__make} DESTDIR=$SB_BUILD_ROOT install
+  cd ${build_top}
-- 
2.30.2



More information about the devel mailing list