--- mingw64-runtime-3.2.0-r1.ebuild 2015-02-27 10:31:09.000000000 +0200 +++ mingw64-runtime-4.0.1.ebuild 2015-05-05 11:39:52.850688806 +0300 @@ -12,7 +12,9 @@ if [[ ${CTARGET} == ${CHOST} ]] ; then fi fi -inherit flag-o-matic eutils +WANT_AUTOMAKE="1.15" + +inherit autotools flag-o-matic eutils DESCRIPTION="Free Win64 runtime and import library definitions" HOMEPAGE="http://mingw-w64.sourceforge.net/" @@ -21,7 +23,7 @@ SRC_URI="mirror://sourceforge/mingw-w64/ LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="crosscompile_opts_headers-only idl" +IUSE="crosscompile_opts_headers-only idl libraries tools" RESTRICT="strip" S="${WORKDIR}/mingw-w64-v${PV}" @@ -32,6 +34,15 @@ is_crosscompile() { 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 @@ -39,31 +50,54 @@ pkg_setup() { fi } +src_prepare() { + epatch "${FILESDIR}/${P}-winpthreads.patch" + epatch "${FILESDIR}/${P}-build.patch" + eautoreconf +} + src_configure() { - local extra_conf=() + CHOST=${CTARGET} strip-unsupported-flags - if just_headers; then - extra_conf+=( --without-crt ) - else - extra_conf+=( --with-crt ) + 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 + local extra_conf=() + case ${CTARGET} in x86_64*) extra_conf+=( --disable-lib32 --enable-lib64 ) ;; i?86*) extra_conf+=( --enable-lib32 --disable-lib64 ) ;; *) die "Unsupported ${CTARGET}" ;; esac - CHOST=${CTARGET} strip-unsupported-flags CHOST=${CTARGET} econf \ --prefix=/usr/${CTARGET} \ --includedir=/usr/${CTARGET}/usr/include \ --with-headers \ --enable-sdk \ - $(use_enable idl) \ + $(crt_with crt) \ + $(crt_use_enable idl) \ + $(crt_use_with libraries libraries winpthreads,libmangle) \ + $(crt_use_with tools) \ "${extra_conf[@]}" } +src_compile() { + if ! just_headers; then + emake -C "${WORKDIR}/headers" install + fi + default +} + src_install() { default