From c24cbd37c6d967028dcb5ed93568b6da56eecda0 Mon Sep 17 00:00:00 2001 From: Jory Pratt Date: Wed, 12 Jun 2019 20:52:17 -0500 Subject: sys-boot/vboot-utils: fix libressl support, musl dep fix Closes: https://bugs.gentoo.org/678594 Closes: https://bugs.gentoo.org/687820 Package-Manager: Portage-2.3.67, Repoman-2.3.14 Signed-off-by: Jory Pratt --- .../files/vboot-utils-72_p20181229-libressl.patch | 11 +++ .../vboot-utils/vboot-utils-72_p20181229-r1.ebuild | 104 +++++++++++++++++++++ .../vboot-utils/vboot-utils-72_p20181229.ebuild | 102 -------------------- 3 files changed, 115 insertions(+), 102 deletions(-) create mode 100644 sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch create mode 100644 sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild delete mode 100644 sys-boot/vboot-utils/vboot-utils-72_p20181229.ebuild (limited to 'sys-boot') diff --git a/sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch b/sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch new file mode 100644 index 000000000000..6702a9f590bc --- /dev/null +++ b/sys-boot/vboot-utils/files/vboot-utils-72_p20181229-libressl.patch @@ -0,0 +1,11 @@ +--- a/host/include/openssl_compat.h 2019-01-03 17:32:20.000000000 -0500 ++++ b/host/include/openssl_compat.h 2019-02-23 13:40:27.521664838 -0500 +@@ -12,7 +12,7 @@ + + #include + +-#if OPENSSL_VERSION_NUMBER < 0x10100000L ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || LIBRESSL_VERSION_NUMBER < 0x2080000L + + static inline void RSA_get0_key(const RSA *rsa, const BIGNUM **n, + const BIGNUM **e, const BIGNUM **d) diff --git a/sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild b/sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild new file mode 100644 index 000000000000..a6628bdafb37 --- /dev/null +++ b/sys-boot/vboot-utils/vboot-utils-72_p20181229-r1.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils toolchain-funcs + +# This is the latest commit in the latest branch. +GIT_SHA1="a32c930e8c46424a3bba3c296fd78b3e60f50aeb" + +DESCRIPTION="Chrome OS verified boot tools" +HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ http://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot" +# Can't use gitiles directly until b/19710536 is fixed. +#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz" +SRC_URI="mirror://gentoo/${P}.tar.xz + https://dev.gentoo.org/~zmedico/dist/${P}.tar.xz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" +IUSE="libressl minimal static" + +LIB_DEPEND=" + dev-libs/libyaml:=[static-libs(+)] + app-arch/xz-utils:=[static-libs(+)]" +LIB_DEPEND_MINIMAL=" + !libressl? ( dev-libs/openssl:0=[static-libs(+)] ) + libressl? ( dev-libs/libressl:0=[static-libs(+)] ) + sys-apps/util-linux:=[static-libs(+)] + dev-libs/libzip:=[static-libs(+)]" +RDEPEND="!static? ( + ${LIB_DEPEND_MINIMAL//\[static-libs(+)]} + !minimal? ( ${LIB_DEPEND//\[static-libs(+)]} ) + )" +DEPEND="${RDEPEND} + static? ( + ${LIB_DEPEND_MINIMAL} + !minimal? ( ${LIB_DEPEND} ) + ) + app-crypt/trousers" + +S=${WORKDIR} + +src_prepare() { + eapply "${FILESDIR}"/${P}-libressl.patch + + default + sed -i \ + -e 's:${DESTDIR}/\(bin\|${LIBDIR}\):${DESTDIR}/usr/\1:g' \ + -e 's:${DESTDIR}/default:${DESTDIR}/etc/default:g' \ + -e 's:${TEST_INSTALL_DIR}/bin:${TEST_INSTALL_DIR}/usr/bin:' \ + -e '/cgpt -D 358400/d' \ + Makefile || die + sed -e 's:^BIN_DIR=${BUILD_DIR}/install_for_test/bin:BIN_DIR=${BUILD_DIR}/install_for_test/usr/bin:' \ + -i tests/common.sh || die + sed -e "s:/mnt/host/source/src/platform/vboot_reference:${S}:" \ + -i tests/futility/expect_output/* || die + if use libressl; then + sed -e '/OPENSSL_VERSION_NUMBER/d' \ + -i host/include/openssl_compat.h || die #674522 + fi +} + +_emake() { + local arch=$(tc-arch) + emake \ + V=1 \ + QEMU_ARCH= \ + ARCH=${arch} \ + HOST_ARCH=${arch} \ + LIBDIR="$(get_libdir)" \ + DEBUG_FLAGS= \ + WERROR= \ + MINIMAL=$(usev minimal) \ + STATIC=$(usev static) \ + $(usex elibc_musl HAVE_MUSL=1 "") \ + "$@" +} + +src_compile() { + tc-export CC AR CXX PKG_CONFIG + _emake TEST_BINS= all +} + +src_test() { + _emake runtests +} + +src_install() { + _emake DESTDIR="${ED}" install + + insinto /usr/share/vboot/devkeys + doins tests/devkeys/* + + insinto /usr/include/vboot + doins host/include/* \ + firmware/include/gpt.h \ + firmware/include/tlcl.h \ + firmware/include/tss_constants.h + + dolib.a build/libvboot_host.a + + dodoc README +} diff --git a/sys-boot/vboot-utils/vboot-utils-72_p20181229.ebuild b/sys-boot/vboot-utils/vboot-utils-72_p20181229.ebuild deleted file mode 100644 index 273d3ec48ff2..000000000000 --- a/sys-boot/vboot-utils/vboot-utils-72_p20181229.ebuild +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit eutils toolchain-funcs - -# This is the latest commit in the latest branch. -GIT_SHA1="a32c930e8c46424a3bba3c296fd78b3e60f50aeb" - -DESCRIPTION="Chrome OS verified boot tools" -HOMEPAGE="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/ http://dev.chromium.org/chromium-os/chromiumos-design-docs/verified-boot" -# Can't use gitiles directly until b/19710536 is fixed. -#SRC_URI="https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+archive/${GIT_SHA1}.tar.gz -> ${P}.tar.gz" -SRC_URI="mirror://gentoo/${P}.tar.xz - https://dev.gentoo.org/~zmedico/dist/${P}.tar.xz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86" -IUSE="libressl minimal static" - -LIB_DEPEND=" - dev-libs/libyaml:=[static-libs(+)] - app-arch/xz-utils:=[static-libs(+)]" -LIB_DEPEND_MINIMAL=" - !libressl? ( dev-libs/openssl:0=[static-libs(+)] ) - libressl? ( dev-libs/libressl:0=[static-libs(+)] ) - sys-apps/util-linux:=[static-libs(+)] - dev-libs/libzip:=[static-libs(+)]" -RDEPEND="!static? ( - ${LIB_DEPEND_MINIMAL//\[static-libs(+)]} - !minimal? ( ${LIB_DEPEND//\[static-libs(+)]} ) - )" -DEPEND="${RDEPEND} - static? ( - ${LIB_DEPEND_MINIMAL} - !minimal? ( ${LIB_DEPEND} ) - ) - app-crypt/trousers" - -S=${WORKDIR} - -src_prepare() { - default - sed -i \ - -e 's:${DESTDIR}/\(bin\|${LIBDIR}\):${DESTDIR}/usr/\1:g' \ - -e 's:${DESTDIR}/default:${DESTDIR}/etc/default:g' \ - -e 's:${TEST_INSTALL_DIR}/bin:${TEST_INSTALL_DIR}/usr/bin:' \ - -e '/cgpt -D 358400/d' \ - Makefile || die - sed -e 's:^BIN_DIR=${BUILD_DIR}/install_for_test/bin:BIN_DIR=${BUILD_DIR}/install_for_test/usr/bin:' \ - -i tests/common.sh || die - sed -e "s:/mnt/host/source/src/platform/vboot_reference:${S}:" \ - -i tests/futility/expect_output/* || die - if use libressl; then - sed -e '/OPENSSL_VERSION_NUMBER/d' \ - -i host/include/openssl_compat.h || die #674522 - fi -} - -_emake() { - local arch=$(tc-arch) - emake \ - V=1 \ - QEMU_ARCH= \ - ARCH=${arch} \ - HOST_ARCH=${arch} \ - LIBDIR="$(get_libdir)" \ - DEBUG_FLAGS= \ - WERROR= \ - MINIMAL=$(usev minimal) \ - STATIC=$(usev static) \ - $(usex elibc_musl HAVE_MUSL=1 "") \ - "$@" -} - -src_compile() { - tc-export CC AR CXX PKG_CONFIG - _emake TEST_BINS= all -} - -src_test() { - _emake runtests -} - -src_install() { - _emake DESTDIR="${ED}" install - - insinto /usr/share/vboot/devkeys - doins tests/devkeys/* - - insinto /usr/include/vboot - doins host/include/* \ - firmware/include/gpt.h \ - firmware/include/tlcl.h \ - firmware/include/tss_constants.h - - dolib.a build/libvboot_host.a - - dodoc README -} -- cgit v1.2.3-65-gdbad