summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/parity/parity-9999.ebuild')
-rw-r--r--sys-devel/parity/parity-9999.ebuild66
1 files changed, 41 insertions, 25 deletions
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
}