]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
ci: Build RPMs on MinGW
authorAndrea Bolognani <abologna@redhat.com>
Thu, 2 Nov 2023 10:16:20 +0000 (11:16 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 23 Nov 2023 17:32:03 +0000 (18:32 +0100)
Now that the spec file supports selectively disabling the native,
mingw32 and mingw64 parts, we can add coverage for the MinGW RPM
builds.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
.gitlab-ci.yml
ci/jobs.sh

index 7dcd07a5c91555654964f0217f8066bcc7734cfd..8bad761b3298df5fdb22ce80b1dfa5a183cd37f5 100644 (file)
@@ -57,10 +57,15 @@ include:
     key: "$CI_JOB_NAME"
   script:
     - source ci/jobs.sh
-    - run_build
-    - if test "$CROSS" = "i686" ;
+    - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
       then
-        run_test;
+        run_rpmbuild;
+      else
+        run_build;
+        if test "$CROSS" = "i686";
+        then
+          run_test;
+        fi;
       fi
 
 .cross_build_job_prebuilt_env:
index ba522258a14db837d20017d5620621f5870497f0..b9e0494338c7b02cdbdce4e144eddc46102dd24e 100644 (file)
@@ -72,10 +72,31 @@ run_potfile() {
 
 run_rpmbuild() {
     run_dist
+
+    # The spec file supports three types of builds: native, mingw32
+    # and mingw64. By default they're all enabled, but each of the
+    # containers in which our CI jobs are executed is only set up for
+    # one of them, so we have to explicitly disable the other two.
+    case "$CROSS" in
+    mingw32)
+        build1="native"
+        build2="mingw64"
+        ;;
+    mingw64)
+        build1="native"
+        build2="mingw32"
+        ;;
+    *)
+        build1="mingw32"
+        build2="mingw64"
+        ;;
+    esac
+
     run_cmd rpmbuild \
                 --clean \
                 --nodeps \
-                --define "_without_mingw 1" \
+                --define "_without_$build1 1" \
+                --define "_without_$build2 1" \
                 -ta build/meson-dist/libvirt-*.tar.xz
 }