From 38dce4637fe416152f8308870fdeb0363d206931 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Thu, 18 Jan 2018 14:49:29 +0100 Subject: [PATCH] crystal: cleanup; fix arch specific distfiles --- srcpkgs/crystal/template | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/srcpkgs/crystal/template b/srcpkgs/crystal/template index 1d240ae8ce3..69d02c63386 100644 --- a/srcpkgs/crystal/template +++ b/srcpkgs/crystal/template @@ -15,12 +15,12 @@ short_desc="The Crystal Programming Language" maintainer="lvmbdv " license="Apache-2.0" homepage="https://crystal-lang.org/" -distfiles="https://github.com/crystal-lang/crystal/archive/v${version}.tar.gz -https://github.com/crystal-lang/shards/archive/v${_shardsversion}.tar.gz -$(vopt_if binary_bootstrap https://github.com/crystal-lang/crystal/releases/download/v${_bootstrapversion}/crystal-${_bootstrapversion}-${_bootstraprevision}-linux-${XBPS_TARGET_MACHINE}.tar.gz)" -checksum="4999a4d2a9ffc7bfbea8351b97057c3a135c2091cbd518e5c22ea7f5392b67d8 -97a3681e74d2fdcba0575f6906f4ba0aefc709a2eb672c7289c63176ff4f3be2 -$(vopt_if binary_bootstrap b75df8522f2302270b48e6b77812a0cb0086e338cdf884227e0076afbf83aca7)" +distfiles=" + https://github.com/crystal-lang/crystal/archive/v${version}.tar.gz + https://github.com/crystal-lang/shards/archive/v${_shardsversion}.tar.gz" +checksum=" + 4999a4d2a9ffc7bfbea8351b97057c3a135c2091cbd518e5c22ea7f5392b67d8 + 97a3681e74d2fdcba0575f6906f4ba0aefc709a2eb672c7289c63176ff4f3be2" nocross="FIXME: someone needs to sort out the llvm --cxxflags for cross building" _crystalflags="--release --no-debug --progress" @@ -28,12 +28,30 @@ build_options="binary_bootstrap" build_options_default="binary_bootstrap" desc_option_oracle_bootstrap="Bootstrap using precompiled binaries" +if [ "$build_option_binary_bootstrap" ]; then + case "$XBPS_TARGET_MACHINE" in + x86_64) + distfiles+=" https://github.com/crystal-lang/crystal/releases/download/v${_bootstrapversion}/crystal-${_bootstrapversion}-${_bootstraprevision}-linux-x86_64.tar.gz" + checksum+=" b75df8522f2302270b48e6b77812a0cb0086e338cdf884227e0076afbf83aca7" + ;; + i686) + distfiles+=" https://github.com/crystal-lang/crystal/releases/download/v${_bootstrapversion}/crystal-${_bootstrapversion}-${_bootstraprevision}-linux-i686.tar.gz" + checksum+=" 4f45f8ea57486be0f8d035c466edda848b7e1a7aa809fff4ea31311fd8ebea97" + ;; + *) broken="cannot be built for $XBPS_TARGET_MACHINE" + ;; + esac +fi + do_extract() { mkdir -p ${wrksrc}/{shards,$(vopt_if binary_bootstrap bootstrap)} tar xfz ${XBPS_SRCDISTDIR}/${pkgname}-${version}/v${version}.tar.gz --strip-components=1 -C ${wrksrc} tar xfz ${XBPS_SRCDISTDIR}/${pkgname}-${version}/v${_shardsversion}.tar.gz --strip-components=1 -C ${wrksrc}/shards - $(vopt_if binary_bootstrap "tar xfz ${XBPS_SRCDISTDIR}/${pkgname}-${version}/crystal-${_bootstrapversion}-${_bootstraprevision}-linux-${XBPS_TARGET_MACHINE}.tar.gz --strip-components=1 -C ${wrksrc}/bootstrap") + if [ "$build_option_binary_bootstrap" ]; then + tar xf ${XBPS_SRCDISTDIR}/${pkgname}-${version}/crystal-${_bootstrapversion}-${_bootstraprevision}-linux-${XBPS_TARGET_MACHINE}.tar.gz \ + --strip-components=1 -C ${wrksrc}/bootstrap + fi } post_extract() {