File edk2-hikey960.spec of Package edk2-hikey

#
# spec file for package edk2-hikey960
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           edk2-hikey960
Version:        2.5~20180418T131015~7840f0aece
Release:        0
Summary:        Firmware required to run the HiKey960
Url:            https://github.com/96boards-hikey/edk2
License:        SUSE-Firmware
Group:          System/Boot
Source0:        edk2-%{version}.tar.xz
Source1:        OpenPlatformPkg-1.3.4.tar.xz
Patch1:         ovmf-pie.patch
Patch2:         edk2_genvtf_gcc8.patch
Patch3:         edk2_genvtf_gcc8.diff
Patch4:         gcc7.diff
#!BuildIgnore:  gcc-PIE
BuildRequires:  gcc7
BuildRequires:  gcc7-c++
BuildRequires:  libuuid-devel
BuildRequires:  python
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  aarch64

%description
Firmware required to run the HiKey960

%prep
%setup -q -n edk2-%{version} -a 1
#%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

ln -sf OpenPlatformPkg-1.3.4 OpenPlatformPkg
#pushd OpenPlatformPkg
#popd

# bsc#973038 Remove the packages we don't need to avoid any potential
# license issue. 
PKG_TO_REMOVE="AppPkg DuetPkg CorebootModulePkg CorebootPayloadPkg \
EmulatorPkg Nt32Pkg Omap35xxPkg QuarkPlatformPkg QuarkSocPkg \
StdLibPrivateInternalFiles UnixPkg Vlv2DeviceRefCodePkg Vlv2TbltDevicePkg"
rm -rf $PKG_TO_REMOVE

%build

BUILD_OPTIONS="-a AARCH64 -p OpenPlatformPkg/Platforms/Hisilicon/HiKey960/HiKey960.dsc -b RELEASE -t GCC5"
ARCH=AARCH64 make -C BaseTools BUILD_CC=gcc-7 BUILD_CXX=g++-7 BUILD_AS=gcc-7

. ./edksetup.sh

build $BUILD_OPTIONS

%install
install -D -m 0644 OpenPlatformPkg/Platforms/Hisilicon/HiKey960/Binary/lpm3.img %{buildroot}/boot/lpm3.img

%define outdir Build/HiKey960/RELEASE_GCC5

install -D -m 0644 %{outdir}/FV/BL33_AP_UEFI.fd %{buildroot}/boot/BL33_AP_UEFI.fd

%files
%defattr(-,root,root)
/boot/lpm3.img
/boot/BL33_AP_UEFI.fd

%changelog
openSUSE Build Service is sponsored by