termux-packages/packages/ovmf/build.sh
2021-05-29 16:00:11 +03:00

50 lines
1.8 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://www.tianocore.org/
TERMUX_PKG_DESCRIPTION="Open Virtual Machine Firmware"
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=20210421.18.g15ee7b7689
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=(https://www.kraxel.org/repos/jenkins/edk2/edk2.git-aarch64-0-${TERMUX_PKG_VERSION}.noarch.rpm
https://www.kraxel.org/repos/jenkins/edk2/edk2.git-arm-0-${TERMUX_PKG_VERSION}.noarch.rpm
https://www.kraxel.org/repos/jenkins/edk2/edk2.git-ovmf-ia32-0-${TERMUX_PKG_VERSION}.noarch.rpm
https://www.kraxel.org/repos/jenkins/edk2/edk2.git-ovmf-x64-0-${TERMUX_PKG_VERSION}.noarch.rpm)
TERMUX_PKG_SHA256=(f8666aeb0edc5ce05991df47be2511b42edc4e0288dc9096f05e64dbd3778767
b7ae09af4d887c1ee949814b1f9f7b1b61cf84040a7e9302f20c0cf6b0ba5f38
1008d9536f89ac484d8b703914f35e1181be9ffd1a65578fdc5f9dd2f613a750
db231a5026ac0d9b82c97920c509f06176b1fd73158158f26157487781bac62c)
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_make_install() {
termux_download \
${TERMUX_PKG_SRCURL[0]} \
${TERMUX_PKG_CACHEDIR}/edk2-aarch64.rpm \
${TERMUX_PKG_SHA256[0]}
termux_download \
${TERMUX_PKG_SRCURL[1]} \
${TERMUX_PKG_CACHEDIR}/edk2-arm.rpm \
${TERMUX_PKG_SHA256[1]}
termux_download \
${TERMUX_PKG_SRCURL[2]} \
${TERMUX_PKG_CACHEDIR}/edk2-i686.rpm \
${TERMUX_PKG_SHA256[2]}
termux_download \
${TERMUX_PKG_SRCURL[3]} \
${TERMUX_PKG_CACHEDIR}/edk2-x86_64.rpm \
${TERMUX_PKG_SHA256[3]}
local i
for i in aarch64 arm i686 x86_64; do
bsdtar xf ${TERMUX_PKG_CACHEDIR}/edk2-${i}.rpm -C $TERMUX_PREFIX/../
done
for i in $TERMUX_PREFIX/share/qemu/firmware/*.json; do
sed -i "s@/usr@$TERMUX_PREFIX@g" $i
done
}
termux_step_install_license() {
install -Dm600 $TERMUX_PKG_BUILDER_DIR/License.txt \
$TERMUX_PREFIX/share/doc/ovmf/LICENSE.txt
}