Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/syslinux/
Date: Tue, 26 May 2020 22:31:19
Message-Id: 1590532258.8b83425b9634ddc92cbf3f8492d5d6faa4ba5868.slyfox@gentoo
1 commit: 8b83425b9634ddc92cbf3f8492d5d6faa4ba5868
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 26 22:30:58 2020 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Tue May 26 22:30:58 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b83425b
7
8 sys-boot/syslinux: respect user's AR, OBJCOPY, RANLIB, bug #721902
9
10 Reported-by: Agostino Sarubbo
11 Closes: https://bugs.gentoo.org/721902
12 Package-Manager: Portage-2.3.100, Repoman-2.3.22
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild | 119 +++++++++++++++++++++++++
16 1 file changed, 119 insertions(+)
17
18 diff --git a/sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild b/sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild
19 new file mode 100644
20 index 00000000000..415672bbf77
21 --- /dev/null
22 +++ b/sys-boot/syslinux/syslinux-6.04_pre1-r2.ebuild
23 @@ -0,0 +1,119 @@
24 +# Copyright 1999-2020 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +
29 +inherit eutils toolchain-funcs
30 +
31 +DESCRIPTION="SYSLINUX, PXELINUX, ISOLINUX, EXTLINUX and MEMDISK bootloaders"
32 +HOMEPAGE="https://www.syslinux.org/"
33 +# Final releases in 6.xx/$PV.tar.* (literal "xx")
34 +# Testing releases in Testing/$PV/$PV.tar.*
35 +SRC_URI_DIR=${PV:0:1}.xx
36 +SRC_URI_TESTING=Testing/${PV:0:4}
37 +[[ ${PV/_alpha} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
38 +[[ ${PV/_beta} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
39 +[[ ${PV/_pre} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
40 +[[ ${PV/_rc} != $PV ]] && SRC_URI_DIR=$SRC_URI_TESTING
41 +SRC_URI="https://www.kernel.org/pub/linux/utils/boot/syslinux/${SRC_URI_DIR}/${P/_/-}.tar.xz"
42 +
43 +LICENSE="GPL-2"
44 +SLOT="0"
45 +KEYWORDS="-* ~amd64 ~x86"
46 +IUSE="custom-cflags"
47 +
48 +RDEPEND="sys-fs/mtools
49 + dev-perl/Crypt-PasswdMD5
50 + dev-perl/Digest-SHA1"
51 +DEPEND="${RDEPEND}
52 + dev-lang/nasm
53 + >=sys-boot/gnu-efi-3.0u
54 + virtual/os-headers"
55 +
56 +S=${WORKDIR}/${P/_/-}
57 +
58 +# This ebuild is a departure from the old way of rebuilding everything in syslinux
59 +# This departure is necessary since hpa doesn't support the rebuilding of anything other
60 +# than the installers.
61 +
62 +# These are executables which come precompiled and are run by the boot loader
63 +QA_PREBUILT="usr/share/${PN}/*.c32"
64 +
65 +# removed all the unpack/patching stuff since we aren't rebuilding the core stuff anymore
66 +
67 +PATCHES=(
68 + "${FILESDIR}"/${PN}-6.03-sysmacros.patch #579928
69 + "${FILESDIR}"/${P}-singleloadsegment.patch #662678
70 + "${FILESDIR}"/${P}-fcommon.patch #705730
71 +)
72 +
73 +src_prepare() {
74 + default
75 +
76 + rm -f gethostip #bug 137081
77 +
78 + # Don't prestrip or override user LDFLAGS, bug #305783
79 + local SYSLINUX_MAKEFILES="extlinux/Makefile linux/Makefile mtools/Makefile \
80 + sample/Makefile utils/Makefile"
81 + sed -i ${SYSLINUX_MAKEFILES} -e '/^LDFLAGS/d' || die "sed failed"
82 +
83 + if use custom-cflags; then
84 + sed -i ${SYSLINUX_MAKEFILES} \
85 + -e 's|-g -Os||g' \
86 + -e 's|-Os||g' \
87 + -e 's|CFLAGS[[:space:]]\+=|CFLAGS +=|g' \
88 + || die "sed custom-cflags failed"
89 + else
90 + QA_FLAGS_IGNORED="
91 + /sbin/extlinux
92 + /usr/bin/memdiskfind
93 + /usr/bin/gethostip
94 + /usr/bin/isohybrid
95 + /usr/bin/syslinux
96 + "
97 + fi
98 + case ${ARCH} in
99 + amd64) loaderarch="efi64" ;;
100 + x86) loaderarch="efi32" ;;
101 + *) ewarn "Unsupported architecture, building installers only." ;;
102 + esac
103 +
104 + # building with ld.gold causes problems, bug #563364
105 + if tc-ld-is-gold; then
106 + ewarn "Building syslinux with the gold linker may cause problems, see bug #563364"
107 + if [[ -z "${I_KNOW_WHAT_I_AM_DOING}" ]]; then
108 + tc-ld-disable-gold
109 + ewarn "set I_KNOW_WHAT_I_AM_DOING=1 to override this."
110 + else
111 + ewarn "Continuing anyway as requested."
112 + fi
113 + fi
114 +
115 + tc-export AR CC LD OBJCOPY RANLIB
116 +}
117 +
118 +_emake() {
119 + emake \
120 + AR="${AR}" \
121 + CC="${CC}" \
122 + LD="${LD}" \
123 + OBJCOPY="${OBJCOPY}" \
124 + RANLIB="${RANLIB}" \
125 + "$@"
126 +}
127 +
128 +src_compile() {
129 + # build system abuses the LDFLAGS variable to pass arguments to ld
130 + unset LDFLAGS
131 + if [[ ! -z ${loaderarch} ]]; then
132 + _emake ${loaderarch}
133 + fi
134 + _emake ${loaderarch} installer
135 +}
136 +
137 +src_install() {
138 + # parallel install fails sometimes
139 + einfo "loaderarch=${loaderarch}"
140 + _emake -j1 INSTALLROOT="${D}" MANDIR=/usr/share/man bios ${loaderarch} install
141 + dodoc README NEWS doc/*.txt
142 +}