From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1034388-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id AB40E138334
	for <garchives@archives.gentoo.org>; Tue,  3 Jul 2018 14:36:52 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 95842E0920;
	Tue,  3 Jul 2018 14:36:51 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4C5B5E0920
	for <gentoo-commits@lists.gentoo.org>; Tue,  3 Jul 2018 14:36:51 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id C8087335CB1
	for <gentoo-commits@lists.gentoo.org>; Tue,  3 Jul 2018 14:36:49 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id C31E52E5
	for <gentoo-commits@lists.gentoo.org>; Tue,  3 Jul 2018 14:36:47 +0000 (UTC)
From: "Michael Haubenwallner" <haubi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michael Haubenwallner" <haubi@gentoo.org>
Message-ID: <1530628584.0fc053670eaa8bbfd0660a36e1cf83b6dcf4df36.haubi@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/parity/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-devel/parity/metadata.xml sys-devel/parity/parity-9999.ebuild
X-VCS-Directories: sys-devel/parity/
X-VCS-Committer: haubi
X-VCS-Committer-Name: Michael Haubenwallner
X-VCS-Revision: 0fc053670eaa8bbfd0660a36e1cf83b6dcf4df36
X-VCS-Branch: master
Date: Tue,  3 Jul 2018 14:36:47 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 7cb8d9ed-b943-4b82-86d5-e0b79308fae8
X-Archives-Hash: df9a2a8ef53f02e0306b6a7376d58de3

commit:     0fc053670eaa8bbfd0660a36e1cf83b6dcf4df36
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  3 14:35:22 2018 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Tue Jul  3 14:36:24 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fc05367

sys-devel/parity-9999: follow upstream development

Package-Manager: Portage-2.3.24, Repoman-2.3.6

 sys-devel/parity/metadata.xml       | 13 +++++++-
 sys-devel/parity/parity-9999.ebuild | 66 +++++++++++++++++++++++--------------
 2 files changed, 53 insertions(+), 26 deletions(-)

diff --git a/sys-devel/parity/metadata.xml b/sys-devel/parity/metadata.xml
index c0714eac500..2d8ffbadd13 100644
--- a/sys-devel/parity/metadata.xml
+++ b/sys-devel/parity/metadata.xml
@@ -6,7 +6,18 @@
 		<name>Michael Haubenwallner</name>
 	</maintainer>
 	<upstream>
-		<remote-id type="sourceforge">parity</remote-id>
 		<remote-id type="github">haubi/parity</remote-id>
 	</upstream>
+	<use>
+		<flag name="vc7_0">Enable support for Visual Studio 2002</flag>
+		<flag name="vc7_1">Enable support for Visual Studio 2003</flag>
+		<flag name="vc8_0">Enable support for Visual Studio 2005</flag>
+		<flag name="vc9_0">Enable support for Visual Studio 2008</flag>
+		<flag name="vc10_0">Enable support for Visual Studio 2010</flag>
+		<flag name="vc11_0">Enable support for Visual Studio 2012</flag>
+		<flag name="vc12_0">Enable support for Visual Studio 2013</flag>
+		<flag name="vc14_0">Enable support for Visual Studio 2015</flag>
+		<flag name="vc15_0">Enable support for Visual Studio 2017</flag>
+		<flag name="vc_x86">Enable support for 32bit Visual Studio compilers</flag>
+	</use>
 </pkgmetadata>

diff --git a/sys-devel/parity/parity-9999.ebuild b/sys-devel/parity/parity-9999.ebuild
index 381b4c75382..24a6582d4ea 100644
--- a/sys-devel/parity/parity-9999.ebuild
+++ b/sys-devel/parity/parity-9999.ebuild
@@ -14,9 +14,15 @@ fi
 DESCRIPTION="A POSIX to native Win32 Cross-Compiler Tool (requires Visual Studio)"
 HOMEPAGE="https://github.com/haubi/parity"
 
+parity-vcarchs() { echo x86 ; }
+parity-vcvers() { echo 7_0 7_1 8_0 9_0 10_0 11_0 12_0 14_0 15_0 ; }
+
 LICENSE="LGPL-3"
 SLOT="0"
-IUSE=""
+IUSE="$(
+	for a in $(parity-vcarchs); do echo "+vc_${a}"; done
+	for v in $(parity-vcvers); do echo "+vc${v}"; done
+)"
 
 if [[ ${PV} == 9999 ]]; then
 	src_prepare() {
@@ -25,30 +31,40 @@ if [[ ${PV} == 9999 ]]; then
 	}
 fi
 
-src_install() {
-	emake DESTDIR="${D}" install || die "emake install failed"
-
-	# create i586-pc-winnt-g[++|cc|..] links..
-	local exeext=
-
-	[[ -f ${ED}usr/bin/parity.gnu.gcc.exe ]] && exeext=.exe
-
-	# create cross compiler syms, also for former versioned winnt profiles
-	local v t
-	for v in "" 5.2 6.1; do
-		dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt${v}-c++
-		dosym /usr/bin/parity.gnu.gcc${exeext} /usr/bin/i586-pc-winnt${v}-g++
-		for t in gcc ld windres ar nm ranlib strip; do
-			if [[ -e "${ED}"usr/bin/parity.gnu.${t}${exeext} ]]; then
-				dosym /usr/bin/parity.gnu.${t}${exeext} /usr/bin/i586-pc-winnt${v}-${t}
-			else
-				dosym /usr/bin/parity.gnu.${t} /usr/bin/i586-pc-winnt${v}-${t}
-			fi
-		done
+parity-enabled-vcarchs() {
+	local enabled= a
+	for a in $(parity-vcarchs) ; do
+		if use vc_${a} ; then
+			enabled+=",${a}"
+		fi
+	done
+	echo ${enabled#,}
+}
+
+parity-enabled-vcvers() {
+	local enabled= v
+	for v in $(parity-vcvers) ; do
+		if use vc${v} ; then
+			enabled+=",${v/_/.}"
+		fi
 	done
+	echo ${enabled#,}
+}
+
+src_configure() {
+	local myconf=(
+		--enable-msvc-archs="$(parity-enabled-vcarchs)"
+		--enable-msvc-versions="$(parity-enabled-vcvers)"
+		--disable-default-msvc-version
+	)
+	econf "${myconf[@]}"
+}
 
-	# we don't need the header files installed by parity... private
-	# header files are supported with a patch from 2.1.0-r1 onwards,
-	# so they won't be there anymore, but -f does the job in any case.
-	rm -f "${ED}"/usr/include/*.h
+pkg_postinst() {
+	if [[ -n ${ROOT%/} ]] ; then
+		einfo "To enable all available MSVC versions, on the target machine please run:"
+		einfo " '${EPREFIX}/usr/bin/parity-setup' --enable-all"
+	else
+		"${EPREFIX}"/usr/bin/parity-setup --enable-all
+	fi
 }