dev-lang/crystal: fix PATH path when bootstrapping
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 4 Sep 2018 08:06:47 +0000 (09:06 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Tue, 4 Sep 2018 08:19:25 +0000 (09:19 +0100)
Before crystal-0.25.0 binary tarball directories did
not contain '-<N>' revisions:
    crystal-0.24.2-1-linux-x86_64 -> crystal-0.24.2
After crystal-0.25.0 they did:
    crystal-0.25.1-1-linux-x86_64 -> crystal-0.25.1-1

Ebuild missed the change and kept passing PATH without
'-<N>' revision.

This change resotres revision for crystal-0.26.0, 0.26.1
and adds sanity check to make sure expected directry
is in place. Should help catching the failure next time.

Reported-by: Myrddin Emrys
Bug: https://github.com/crystal-lang/crystal/issues/6650
Package-Manager: Portage-2.3.49, Repoman-2.3.10

dev-lang/crystal/crystal-0.26.0.ebuild
dev-lang/crystal/crystal-0.26.1.ebuild

index 033b3eb6c9406d47e4f762229a98924d68176460..59268e937a6861e589985e16a329599574a6ac12 100644 (file)
@@ -5,15 +5,15 @@ EAPI=6
 
 inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
 
-BV=0.25.1
-BV_AMD64=${BV}-1-linux-x86_64
-BV_X86=${BV}-1-linux-i686
+BV=0.25.1-1
+BV_AMD64=${BV}-linux-x86_64
+BV_X86=${BV}-linux-i686
 
 DESCRIPTION="The Crystal Programming Language"
 HOMEPAGE="https://crystal-lang.org"
 SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz
-       amd64? ( https://github.com/crystal-lang/crystal/releases/download/${BV/}/crystal-${BV_AMD64}.tar.gz )
-       x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV}/crystal-${BV_X86}.tar.gz )"
+       amd64? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
+       x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
 
 LICENSE="Apache-2.0"
 SLOT="0"
index d02b47f0788e5dca42548559fcf968f706e9e41d..7d0ff4c7b5ba8f7e039d61bacfe18107e03daf45 100644 (file)
@@ -5,15 +5,15 @@ EAPI=6
 
 inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
 
-BV=0.26.0
-BV_AMD64=${BV}-1-linux-x86_64
-BV_X86=${BV}-1-linux-i686
+BV=0.26.0-1
+BV_AMD64=${BV}-linux-x86_64
+BV_X86=${BV}-linux-i686
 
 DESCRIPTION="The Crystal Programming Language"
 HOMEPAGE="https://crystal-lang.org"
 SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz
-       amd64? ( https://github.com/crystal-lang/crystal/releases/download/${BV/}/crystal-${BV_AMD64}.tar.gz )
-       x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV}/crystal-${BV_X86}.tar.gz )"
+       amd64? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
+       x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
 
 LICENSE="Apache-2.0"
 SLOT="0"
@@ -53,6 +53,12 @@ src_prepare() {
 }
 
 src_compile() {
+       local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
+       if [[ ! -d ${bootstrap_path} ]]; then
+               eerror "Binary tarball does not contain expected directory:"
+               die "'${bootstrap_path}' path does not exist."
+       fi
+
        emake \
                $(usex debug "" release=1) \
                progress=true \
@@ -64,7 +70,7 @@ src_compile() {
                CXX=$(tc-getCXX) \
                AR=$(tc-getAR) \
                \
-               PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \
+               PATH="${bootstrap_path}:${PATH}" \
                CRYSTAL_PATH=src \
                CRYSTAL_CONFIG_VERSION=${PV} \
                CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"