public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Amy Liffey" <amynka@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/fpc/
Date: Fri, 25 Aug 2017 11:46:16 +0000 (UTC)	[thread overview]
Message-ID: <1503661504.09a601f2701211a6ef4a6556ff12b1e3d33e7d51.amynka@gentoo> (raw)

commit:     09a601f2701211a6ef4a6556ff12b1e3d33e7d51
Author:     Horea Christian <horea.christ <AT> yandex <DOT> com>
AuthorDate: Mon Aug 21 15:24:59 2017 +0000
Commit:     Amy Liffey <amynka <AT> gentoo <DOT> org>
CommitDate: Fri Aug 25 11:45:04 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09a601f2

dev-lang/fpc: added new revision which is usable under prefix

Package-Manager: Portage-2.3.8, Repoman-2.3.3

 dev-lang/fpc/fpc-3.0.2-r1.ebuild | 165 +++++++++++++++++++++++++++++++++++++++
 dev-lang/fpc/metadata.xml        |   4 +-
 2 files changed, 167 insertions(+), 2 deletions(-)

diff --git a/dev-lang/fpc/fpc-3.0.2-r1.ebuild b/dev-lang/fpc/fpc-3.0.2-r1.ebuild
new file mode 100644
index 00000000000..38a17395ed7
--- /dev/null
+++ b/dev-lang/fpc/fpc-3.0.2-r1.ebuild
@@ -0,0 +1,165 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit prefix toolchain-funcs
+
+HOMEPAGE="https://www.freepascal.org/"
+DESCRIPTION="Free Pascal Compiler"
+SRC_URI="mirror://sourceforge/freepascal/fpcbuild-${PV}.tar.gz
+	mirror://sourceforge/freepascal/fpc-${PV}.source.tar.gz
+	amd64? ( mirror://sourceforge/freepascal/${P}.x86_64-linux.tar )
+	x86? ( mirror://sourceforge/freepascal/${P}.i386-linux.tar )
+	doc? ( mirror://sourceforge/freepascal/Documentation/${PV}/doc-html.tar.gz -> ${P}-doc-html.tar.gz )"
+
+SLOT="0"
+LICENSE="GPL-2 LGPL-2.1-with-linking-exception"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc ide source"
+
+RDEPEND="ide? ( !dev-lang/fpc-ide )"
+
+RESTRICT="strip" #269221
+
+S=${WORKDIR}/fpcbuild-${PV}/fpcsrc
+
+pkg_pretend() {
+	if [[ ${MERGE_TYPE} != binary ]]; then
+		# Bug 475210
+		if $(tc-getLD) --version | grep -q "GNU gold"; then
+			eerror "fpc does not function correctly when built with the gold linker."
+			eerror "Please select the bfd linker with binutils-config."
+			die "GNU gold detected"
+		fi
+	fi
+}
+
+src_unpack() {
+	case ${ARCH} in
+		amd64)	FPC_ARCH="x86_64"    PV_BIN=${PV} ;;
+		x86)	FPC_ARCH="i386"      PV_BIN=${PV} ;;
+		*)	die "This ebuild doesn't support ${ARCH}." ;;
+	esac
+
+	unpack ${A}
+
+	tar -xf ${PN}-${PV_BIN}.${FPC_ARCH}-linux/binary.${FPC_ARCH}-linux.tar || die "Unpacking binary.${FPC_ARCH}-linux.tar failed!"
+	tar -xzf base.${FPC_ARCH}-linux.tar.gz || die "Unpacking base.${FPC_ARCH}-linux.tar.gz failed!"
+}
+
+src_prepare() {
+	find "${WORKDIR}" -name Makefile -exec sed -i -e 's/ -Xs / /g' {} + || die
+
+	# let the pkg manager compress man files
+	sed -i '/find man.* gzip /d' "${WORKDIR}"/fpcbuild-${PV}/install/man/Makefile || die
+
+	# make the compiled binary check for fpc.cfg under the prefixed /etc/ path
+	hprefixify "${WORKDIR}"/fpcbuild-${PV}/fpcsrc/compiler/options.pas
+}
+
+set_pp() {
+	case ${ARCH} in
+		amd64)	FPC_ARCH="x64" FPC_PARCH="x86_64" ;;
+		x86)	FPC_ARCH="386" FPC_PARCH="i386" ;;
+		*)	die "This ebuild doesn't support ${ARCH}." ;;
+	esac
+
+	case ${1} in
+		bootstrap)	pp="${WORKDIR}"/lib/fpc/${PV_BIN}/ppc${FPC_ARCH} ;;
+		new) 	pp="${S}"/compiler/ppc${FPC_ARCH} ;;
+		*)	die "set_pp: unknown argument: ${1}" ;;
+	esac
+}
+
+src_compile() {
+	local pp
+
+	# Using the bootstrap compiler.
+	set_pp bootstrap
+
+	emake -j1 PP="${pp}" compiler_cycle AS="$(tc-getAS)"
+
+	# Save new compiler from cleaning...
+	cp "${S}"/compiler/ppc${FPC_ARCH} "${S}"/ppc${FPC_ARCH}.new || die
+
+	# ...rebuild with current version...
+	emake -j1 PP="${S}"/ppc${FPC_ARCH}.new AS="$(tc-getAS)" compiler_cycle
+
+	# ..and clean up afterwards
+	rm "${S}"/ppc${FPC_ARCH}.new || die
+
+	# Using the new compiler.
+	set_pp new
+
+	emake -j1 PP="${pp}" AS="$(tc-getAS)" rtl_clean
+
+	emake -j1 PP="${pp}" AS="$(tc-getAS)" rtl packages_all utils
+
+	if use ide ; then
+		cd "${S}"/ide || die
+		emake -j1 PP="${pp}" AS="$(tc-getAS)"
+	fi
+}
+
+src_install() {
+	local pp
+	set_pp new
+
+	#fpcbuild-3.0.0/utils/fpcm/fpcmake
+	#${WORKDIR}/${PN}build-${PV}/utils/fpcm/fpcmake"
+	#fpcbuild-3.0.0/fpcsrc/utils/fpcm/bin/x86_64-linux/fpcmake
+	set -- PP="${pp}" FPCMAKE="${S}/utils/fpcm/bin/${FPC_PARCH}-linux/fpcmake" \
+		INSTALL_PREFIX="${ED}"/usr \
+		INSTALL_DOCDIR="${ED}"/usr/share/doc/${PF} \
+		INSTALL_MANDIR="${ED}"/usr/share/man \
+		INSTALL_SOURCEDIR="${ED}"/usr/lib/fpc/${PV}/source
+
+	emake -j1 "$@" compiler_install rtl_install packages_install utils_install
+
+	dosym ../lib/fpc/${PV}/ppc${FPC_ARCH} /usr/bin/ppc${FPC_ARCH}
+
+	cd "${S}"/../install/doc || die
+	emake -j1 "$@" installdoc
+
+	cd "${S}"/../install/man || die
+	emake -j1 "$@" installman
+
+	if use doc ; then
+		cd "${S}"/../../doc || die
+		dodoc -r *
+	fi
+
+	if use ide ; then
+		cd "${S}"/ide || die
+		emake -j1 "$@" install
+	fi
+
+	if use source ; then
+		cd "${S}" || die
+		shift
+		emake -j1 PP="${ED}"/usr/bin/ppc${FPC_ARCH} "$@" sourceinstall
+		find "${ED}"/usr/lib/fpc/${PV}/source -name '*.o' -exec rm {} \;
+	fi
+
+	"${ED}"/usr/lib/fpc/${PV}/samplecfg "${ED}"/usr/lib/fpc/${PV} "${ED}"/etc || die
+
+	# set correct (prefixed) path for e.g. unit files
+	sed -i "s:${ED}:${EPREFIX}:g" "${ED}"/etc/fpc.cfg || die
+
+	if use ide ; then
+		sed -e "s:${ED}::g" \
+			-i "${ED}"/etc/fppkg.cfg \
+			-i "${ED}"/etc/fppkg/* \
+			-i "${ED}"/usr/lib/fpc/${PV}/ide/text/fp*.cfg \
+			|| die
+	fi
+
+	rm -r "${ED}"/usr/lib/fpc/lexyacc || die
+}
+
+pkg_postinst() {
+	if [[ -z ${REPLACING_VERSIONS} ]] && use ide; then
+		einfo "To read the documentation in the fpc IDE, enable the doc USE flag"
+	fi
+}

diff --git a/dev-lang/fpc/metadata.xml b/dev-lang/fpc/metadata.xml
index 515fcf55caa..f42de96b8d5 100644
--- a/dev-lang/fpc/metadata.xml
+++ b/dev-lang/fpc/metadata.xml
@@ -2,8 +2,8 @@
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<maintainer type="person">
-                <email>amynka@gentoo.org</email>
-        </maintainer>
+		<email>amynka@gentoo.org</email>
+	</maintainer>
 	<use>
 		<flag name="ide">Build and install the Free Pascal Compiler IDE</flag>
 	</use>


             reply	other threads:[~2017-08-25 11:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 11:46 Amy Liffey [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-10-23 12:57 [gentoo-commits] repo/gentoo:master commit in: dev-lang/fpc/ Jakov Smolić
2021-10-23 12:43 Jakov Smolić
2021-10-17  1:04 Sam James
2021-10-16  7:11 Agostino Sarubbo
2021-10-16  7:10 Agostino Sarubbo
2021-07-25  1:13 Sam James
2021-07-25  1:10 Sam James
2021-06-30 21:56 Ionen Wolkens
2021-06-22 20:44 David Seifert
2020-12-02  0:32 Aaron Bauman
2019-12-15 12:48 Agostino Sarubbo
2019-12-15 12:44 Agostino Sarubbo
2018-03-17  6:45 Matt Turner
2018-01-21 14:05 Amy Liffey
2017-08-15 11:38 Amy Liffey
2017-08-11 12:45 Amy Liffey
2017-04-02 14:24 Amy Liffey
2016-03-14 12:35 Amy Winston
2016-03-14 12:35 Amy Winston
2016-02-25 13:59 Justin Lecher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503661504.09a601f2701211a6ef4a6556ff12b1e3d33e7d51.amynka@gentoo \
    --to=amynka@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox