public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-runtime/
Date: Fri, 29 Dec 2017 11:45:45 +0000 (UTC)	[thread overview]
Message-ID: <1514547907.e579457fd49eef426c8cc4d6170cf83b9a42328f.slyfox@gentoo> (raw)

commit:     e579457fd49eef426c8cc4d6170cf83b9a42328f
Author:     Marty E. Plummer <hanetzer <AT> protonmail <DOT> com>
AuthorDate: Fri Dec 29 05:52:43 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 11:45:07 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e579457f

dev-util/mingw64-runtime: prefixify build

Currently building a mingw-w64 toolchain inside of gentoo prefix with
crossdev will fail, due to installing files outside of the prefix. Added
${EPREFIX} where apropriate fixed this issue.

Tested in a prefix with toolchain x86_64-w64-mingw32, and tested on bare
gentoo with x86_64-w64-mingw32 & i686-w64-mingw32.

Package-Manager: Portage-2.3.19, Repoman-2.3.6
Closes: https://github.com/gentoo/gentoo/pull/6675

 .../mingw64-runtime-5.0.3-r1.ebuild                | 112 +++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/dev-util/mingw64-runtime/mingw64-runtime-5.0.3-r1.ebuild b/dev-util/mingw64-runtime/mingw64-runtime-5.0.3-r1.ebuild
new file mode 100644
index 00000000000..1b9f05639b8
--- /dev/null
+++ b/dev-util/mingw64-runtime/mingw64-runtime-5.0.3-r1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+	if [[ ${CATEGORY} == cross-* ]] ; then
+		export CTARGET=${CATEGORY#cross-}
+	fi
+fi
+
+WANT_AUTOMAKE="1.15"
+
+inherit autotools flag-o-matic eutils
+
+DESCRIPTION="Free Win64 runtime and import library definitions"
+HOMEPAGE="http://mingw-w64.sourceforge.net/"
+SRC_URI="mirror://sourceforge/mingw-w64/mingw-w64/mingw-w64-release/mingw-w64-v${PV}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="crosscompile_opts_headers-only idl libraries tools"
+RESTRICT="strip"
+
+S="${WORKDIR}/mingw-w64-v${PV}"
+
+PATCHES=(
+	"${FILESDIR}/${P}-build.patch"
+)
+
+is_crosscompile() {
+	[[ ${CHOST} != ${CTARGET} ]]
+}
+just_headers() {
+	use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]]
+}
+crt_with() {
+	just_headers && echo --without-$1 || echo --with-$1
+}
+crt_use_enable() {
+	just_headers && echo --without-$2 || use_enable "$@"
+}
+crt_use_with() {
+	just_headers && echo --without-$2 || use_with "$@"
+}
+
+pkg_setup() {
+	if [[ ${CBUILD} == ${CHOST} ]] && [[ ${CHOST} == ${CTARGET} ]] ; then
+		die "Invalid configuration"
+	fi
+}
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	CHOST=${CTARGET} strip-unsupported-flags
+
+	if ! just_headers; then
+		mkdir "${WORKDIR}/headers"
+		pushd "${WORKDIR}/headers" > /dev/null
+		CHOST=${CTARGET} "${S}/configure" \
+			--prefix="${T}/tmproot" \
+			--with-headers \
+			--without-crt \
+			|| die
+		popd > /dev/null
+		append-cppflags "-I${T}/tmproot/include"
+	fi
+
+	CHOST=${CTARGET} econf \
+		--prefix="${EPREFIX}"/usr/${CTARGET} \
+		--includedir="${EPREFIX}"/usr/${CTARGET}/usr/include \
+		--libdir="${EPREFIX}"/usr/${CTARGET}/usr/lib \
+		--with-headers \
+		--enable-sdk \
+		$(crt_with crt) \
+		$(crt_use_enable idl idl) \
+		$(crt_use_with libraries libraries) \
+		$(crt_use_with tools tools) \
+		$(
+			$(tc-getCPP ${CTARGET}) ${CPPFLAGS} -dM - < /dev/null | grep -q __MINGW64__ \
+				&& echo --disable-lib32 --enable-lib64 \
+				|| echo --enable-lib32 --disable-lib64
+		)
+}
+
+src_compile() {
+	if ! just_headers; then
+		emake -C "${WORKDIR}/headers" install
+	fi
+	default
+}
+
+src_install() {
+	default
+
+	if is_crosscompile ; then
+		# gcc is configured to look at specific hard-coded paths for mingw #419601
+		dosym usr /usr/${CTARGET}/mingw
+		dosym usr /usr/${CTARGET}/${CTARGET}
+		dosym usr/include /usr/${CTARGET}/sys-include
+	fi
+
+	env -uRESTRICT CHOST=${CTARGET} prepallstrip
+	rm -rf "${ED}/usr/share"
+}


             reply	other threads:[~2017-12-29 11:45 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29 11:45 Sergei Trofimovich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-03 12:31 [gentoo-commits] repo/gentoo:master commit in: dev-util/mingw64-runtime/ Ionen Wolkens
2024-05-30  6:39 Ionen Wolkens
2024-05-22  3:32 Ionen Wolkens
2024-05-21  3:01 Ionen Wolkens
2024-05-21  3:01 Ionen Wolkens
2024-05-07 14:28 Ionen Wolkens
2024-03-24 18:39 Ionen Wolkens
2024-01-15 17:33 Ionen Wolkens
2023-12-22 17:38 Ionen Wolkens
2023-06-26 10:12 Ionen Wolkens
2023-04-29  9:43 Ionen Wolkens
2022-10-31  0:54 Ionen Wolkens
2022-10-23  7:20 Ionen Wolkens
2022-09-14 23:24 Ionen Wolkens
2022-07-16 17:03 Ionen Wolkens
2022-06-29 17:48 Ionen Wolkens
2022-06-29 17:22 Ionen Wolkens
2022-06-21  2:01 Ionen Wolkens
2022-06-21  2:01 Ionen Wolkens
2022-05-21 18:38 Ionen Wolkens
2022-05-21 18:38 Ionen Wolkens
2022-05-14  2:23 Ionen Wolkens
2022-05-13  2:48 Ionen Wolkens
2022-05-13  2:48 Ionen Wolkens
2022-05-13  2:48 Ionen Wolkens
2022-04-24 21:09 Ionen Wolkens
2022-04-22  8:02 Ionen Wolkens
2022-04-17  2:33 Ionen Wolkens
2022-04-17  2:33 Ionen Wolkens
2022-04-17  2:33 Ionen Wolkens
2022-04-17  2:33 Ionen Wolkens
2021-07-05 22:50 Sergei Trofimovich
2021-04-16 10:25 David Seifert
2020-09-30 18:28 Sergei Trofimovich
2020-09-30 18:28 Sergei Trofimovich
2020-01-12 16:43 Sergei Trofimovich
2020-01-12 16:43 Sergei Trofimovich
2019-09-16 21:18 Sergei Trofimovich
2019-08-13  7:10 Sergei Trofimovich
2018-11-25 15:27 Sergei Trofimovich
2018-10-06 22:59 Sergei Trofimovich
2018-10-06 17:35 Sergei Trofimovich
2018-10-05 22:43 Sergei Trofimovich
2018-09-17 22:05 Alon Bar-Lev
2018-06-15 20:56 Alon Bar-Lev
2018-03-24 21:16 Sergei Trofimovich
2018-03-24 14:34 Sergei Trofimovich
2018-01-07 19:39 Sergei Trofimovich
2017-05-22  9:46 Alon Bar-Lev
2017-03-29 20:04 Alon Bar-Lev
2017-01-06 18:39 Alon Bar-Lev
2016-11-11 23:39 Alon Bar-Lev
2016-08-07 19:40 Alon Bar-Lev
2016-06-07 19:10 Alon Bar-Lev
2015-08-14  7:50 Alon Bar-Lev
2015-08-14  7:50 Alon Bar-Lev

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=1514547907.e579457fd49eef426c8cc4d6170cf83b9a42328f.slyfox@gentoo \
    --to=slyfox@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