Gentoo Archives: gentoo-commits

From: Alfredo Tupone <tupone@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/gnat-gpl/
Date: Sun, 27 Feb 2022 08:19:14
Message-Id: 1645949925.43a23abf9991a3df50f521acd49ebba60ff60c88.tupone@gentoo
1 commit: 43a23abf9991a3df50f521acd49ebba60ff60c88
2 Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 27 08:18:45 2022 +0000
4 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 27 08:18:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43a23abf
7
8 dev-lang/gnat-gpl: gcc slot from 10 is only the major
9
10 Closes: https://bugs.gentoo.org/833779
11 Package-Manager: Portage-3.0.30, Repoman-3.0.3
12 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
13
14 dev-lang/gnat-gpl/gnat-gpl-2021-r2.ebuild | 146 ++++++++++++++++++++++++++++++
15 1 file changed, 146 insertions(+)
16
17 diff --git a/dev-lang/gnat-gpl/gnat-gpl-2021-r2.ebuild b/dev-lang/gnat-gpl/gnat-gpl-2021-r2.ebuild
18 new file mode 100644
19 index 000000000000..1ac2e777e3ed
20 --- /dev/null
21 +++ b/dev-lang/gnat-gpl/gnat-gpl-2021-r2.ebuild
22 @@ -0,0 +1,146 @@
23 +# Copyright 1999-2022 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +PATCH_GCC_VER=10.3.0
29 +PATCH_VER="3"
30 +
31 +TOOLCHAIN_GCC_PV=10.3.1
32 +
33 +REL=10
34 +MYP=gcc-${REL}-${PV}-20210519-19A74-src
35 +GNATDIR=gnat-${PV}-20210519-19A70-src
36 +INTFDIR=gcc-interface-${REL}-${PV}-20210519-19A75-src
37 +
38 +BTSTRP_X86=gnat-gpl-2014-x86-linux-bin
39 +BTSTRP_AMD64=gnat-gpl-2014-x86_64-linux-bin
40 +BASE_URI=https://community.download.adacore.com/v1
41 +# we provide own tarball below
42 +GCC_TARBALL_SRC_URI="
43 + ${BASE_URI}/005d2b2eff627177986d2517eb31e1959bec6f3a?filename=${GNATDIR}.tar.gz
44 + -> ${GNATDIR}.tar.gz
45 + ${BASE_URI}/44cd393be0b468cc253bf2cf9cf7804c993e7b5b?filename=${MYP}.tar.gz
46 + -> ${MYP}.tar.gz
47 + ${BASE_URI}/8ace7d06e469d36d726cc8badb0ed78411e727f3?filename=${INTFDIR}.tar.gz
48 + -> ${INTFDIR}.tar.gz
49 + bootstrap? (
50 + amd64? (
51 + ${BASE_URI}/6eb6eef6bb897e4c743a519bfebe0b1d6fc409c6?filename=${BTSTRP_AMD64}.tar.gz&rand=1193
52 + -> ${BTSTRP_AMD64}.tar.gz
53 + )
54 + x86? (
55 + ${BASE_URI}/c5e9e6fdff5cb77ed90cf8c62536653e27c0bed6?filename=${BTSTRP_X86}.tar.gz&rand=436
56 + -> ${BTSTRP_X86}.tar.gz
57 + )
58 + )"
59 +
60 +inherit toolchain-funcs toolchain
61 +
62 +DESCRIPTION="GNAT Ada Compiler - GPL version"
63 +HOMEPAGE="http://libre.adacore.com/"
64 +
65 +LICENSE+=" GPL-2 GPL-3"
66 +KEYWORDS="~amd64 ~x86"
67 +IUSE="+ada +bootstrap"
68 +RESTRICT="test"
69 +
70 +RDEPEND="!~sys-devel/gcc-${GCCMAJOR}"
71 +BDEPEND=sys-devel/binutils
72 +
73 +S="${WORKDIR}"/${MYP}
74 +
75 +src_unpack() {
76 + if ! use bootstrap && [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
77 + eerror "You need a gcc compiler that provides the Ada Compiler:"
78 + eerror "1) use gcc-config to select the right compiler or"
79 + eerror "2) set the bootstrap use flag"
80 + die "ada compiler not available"
81 + fi
82 +
83 + toolchain_src_unpack
84 +}
85 +
86 +src_prepare() {
87 + if use amd64; then
88 + BTSTRP=${BTSTRP_AMD64}
89 + else
90 + BTSTRP=${BTSTRP_X86}
91 + fi
92 +
93 + if use bootstrap; then
94 + GCC="${WORKDIR}"/${BTSTRP}/bin/gcc
95 + else
96 + GCC=${ADA:-$(tc-getCC)}
97 + fi
98 +
99 + gnatbase=$(basename ${GCC})
100 + gnatpath=$(dirname ${GCC})
101 +
102 + GNATMAKE=${gnatbase/gcc/gnatmake}
103 + if [[ ${gnatpath} != "." ]] ; then
104 + GNATMAKE="${gnatpath}/${GNATMAKE}"
105 + fi
106 + if use bootstrap; then
107 + rm "${WORKDIR}"/${BTSTRP}/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld \
108 + || die
109 + ln -s /usr/bin/$CHOST-ld \
110 + "${WORKDIR}"/${BTSTRP}/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/ld \
111 + || die
112 + rm "${WORKDIR}"/${BTSTRP}/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/as \
113 + || die
114 + ln -s /usr/bin/$CHOST-as \
115 + "${WORKDIR}"/${BTSTRP}/libexec/gcc/x86_64-pc-linux-gnu/4.7.4/as \
116 + || die
117 + fi
118 +
119 + CC=${GCC}
120 + CXX="${gnatbase/gcc/g++}"
121 + GNATBIND="${gnatbase/gcc/gnatbind}"
122 + GNATLINK="${gnatbase/gcc/gnatlink}"
123 + GNATLS="${gnatbase/gcc/gnatls}"
124 + if [[ ${gnatpath} != "." ]] ; then
125 + CXX="${gnatpath}/${CXX}"
126 + GNATBIND="${gnatpath}/${GNATBIND}"
127 + GNATLINK="${gnatpath}/${GNATLINK}"
128 + GNATLS="${gnatpath}/${GNATLS}"
129 + fi
130 + mkdir bin || die
131 + ln -s $(which ${GCC}) bin/gcc || die
132 + ln -s $(which ${CXX}) bin/g++ || die
133 + ln -s $(which ${GNATMAKE}) bin/gnatmake || die
134 + ln -s $(which ${GNATBIND}) bin/gnatbind || die
135 + ln -s $(which ${GNATLINK}) bin/gnatlink || die
136 + ln -s $(which ${GNATLS}) bin/gnatls || die
137 +
138 + cd ..
139 + mv ${GNATDIR}/src/ada ${MYP}/gcc/ || die
140 + mv ${INTFDIR} ${MYP}/gcc/ada/gcc-interface || die
141 + eapply "${FILESDIR}"/${P}-gentoo.patch
142 + cd -
143 + sed -i \
144 + -e 's:-fcf-protection":":' \
145 + libiberty/configure \
146 + lto-plugin/configure || die
147 + sed -i \
148 + -e 's:$(P) ::g' \
149 + gcc/ada/gcc-interface/Makefile.in \
150 + || die "sed failed"
151 + toolchain_src_prepare
152 +}
153 +
154 +src_configure() {
155 + export PATH=${PWD}/bin:${PATH}
156 + downgrade_arch_flags "$(gcc-version)"
157 + toolchain_src_configure
158 +}
159 +
160 +pkg_postinst() {
161 + toolchain_pkg_postinst
162 + einfo "This provide the GNAT compiler with gcc for ada/c/c++ and more"
163 + einfo "The compiler binary is ${CTARGET}-gcc-${TOOLCHAIN_GCC_PV}"
164 + einfo "Even if the c/c++ compilers are using almost the same patched"
165 + einfo "source as the sys-devel/gcc package its use is not extensively"
166 + einfo "tested, and not supported for updating your system, except for ada"
167 + einfo "related packages"
168 +}