fix OpenBlas and edk2 so they build from containerized env (#2689)

* fix OpenBlas and edk2 so they build from containerized env

* address PR comments

Co-authored-by: nicolas guibourge <nicolasg@microsoft.com>
This commit is contained in:
nicolas guibourge 2022-04-11 10:27:28 -07:00 committed by GitHub
parent 1ac2d5eb18
commit ed6ba712d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 3 deletions

View File

@ -11,7 +11,13 @@ Distribution: Mariner
%global softfloat_version 20180726-gitb64af41
# Enable this to skip secureboot enrollment, if problems pop up
%if %{with_check}
# keep enroll for testing (non containeried build env)
%global skip_enroll 0
%else
# skip enroll when building that blocks containerized build
%global skip_enroll 1
%endif
%define qosb_testing 0
@ -48,11 +54,11 @@ Name: edk2
# to use YYYMMDD to avoid needing to bump package epoch
# due to previous 'git' Version:
Version: %{edk2_stable_date}01stable
Release: 2%{?dist}
Release: 3%{?dist}
Summary: EFI Development Kit II
License: BSD-2-Clause-Patent
URL: http://www.tianocore.org/edk2/
URL: https://github.com/tianocore/tianocore.github.io/wiki/EDK-II/
Source0: https://github.com/tianocore/edk2/archive/%{edk2_stable_str}.tar.gz#/%{edk2_stable_str}.tar.gz
Source1: openssl-%{openssl_version}-hobbled.tar.xz
@ -595,6 +601,10 @@ install qemu-ovmf-secureboot-%{qosb_version}/ovmf-vars-generator %{buildroot}%{_
%changelog
* Thu Apr 07 2022 Nicolas Guibourge <nicolasg@microsoft.com> - 20200801stable-3
- Skip enroll that blocks building from containerized environment.
- License verified.
* Tue Jul 06 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 20200801stable-2
- Initial CBL-Mariner import from Fedora 33 (license: MIT).
- Turn off cross-compilation.

View File

@ -0,0 +1,14 @@
diff -ru OpenBLAS-0.3.9-orig/Makefile OpenBLAS-0.3.9/Makefile
--- OpenBLAS-0.3.9-orig/Makefile 2020-03-01 15:10:20.000000000 -0800
+++ OpenBLAS-0.3.9/Makefile 2022-04-06 08:28:58.458123065 -0700
@@ -1,4 +1,10 @@
TOPDIR = .
+
+# parallelize the build
+MAKE_NB_JOBS = 8
+# don't build Fortran (hence don't perform tests)
+NO_FORTRAN = 1
+
include ./Makefile.system
BLASDIRS = interface driver/level2 driver/level3 driver/others

View File

@ -15,7 +15,7 @@
Name: openblas
Version: 0.3.9
Release: 4%{?dist}
Release: 5%{?dist}
Summary: An optimized BLAS library based on GotoBLAS2
License: BSD
Vendor: Microsoft Corporation
@ -34,6 +34,9 @@ Patch3: openblas-0.3.7-tests.patch
# Fix C++ compatibility (BZ #1820131)
Patch4: https://github.com/xianyi/OpenBLAS/commit/ee2e758278b5d82b7242f505ea694f082ef65879.patch
# keep this patch to build from a containerized environment
Patch5: No-Fortran-Build.patch
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-gfortran
@ -230,6 +233,7 @@ cd OpenBLAS-%{version}
%endif
%patch3 -p1 -b .tests
%patch4 -p1 -b .cplusplus
%patch5 -p1
# Fix source permissions
find -name \*.f -exec chmod 644 {} \;
@ -653,6 +657,10 @@ rm -rf %{buildroot}%{_libdir}/pkgconfig
%endif
%changelog
* Tue Apr 05 2022 Nicolas Guibourge <nicolasg@microsoft.com> - 0.3.9-5
- Do not build Fortran.
- License verified.
* Fri Oct 15 2021 Pawel Winogrodzki <pawelwi@microsoft.com> - 0.3.9-4
- Initial CBL-Mariner import from Fedora 32 (license: MIT).