Commit fb1acd6b authored by Matthew Brett's avatar Matthew Brett
Browse files

Refactor build_github for unknown output dirs.

We can't easily predict what the output directory will be for a Github
release archive.  Get fetch_unpack to tell us.  Add some tests that
won't fail, but at least show us the output.
parent 37dac7cb
......@@ -157,6 +157,8 @@ function fetch_unpack {
# url - URL from which to fetch archive
# archive_fname (optional) archive name
#
# Echos unpacked directory and file names.
#
# If `archive_fname` not specified then use basename from `url`
# If `archive_fname` already present at download location, use that instead.
local url=$1
......@@ -170,10 +172,14 @@ function fetch_unpack {
if [ ! -f "$out_archive" ]; then
curl -L $url > $out_archive
fi
# Unpack archive, refreshing contents
# Unpack archive, refreshing contents, echoing dir and file
# names.
rm_mkdir arch_tmp
install_rsync
(cd arch_tmp && untar ../$out_archive && rsync --delete -ah * ..)
(cd arch_tmp && \
untar ../$out_archive && \
ls -1d * &&
rsync --delete -ah * ..)
}
function clean_code {
......
......@@ -77,12 +77,11 @@ function build_github {
local tag_name=$2
local configure_args=${@:3}
local name=`basename "$path"`
local name_tag_name="${name}-${tag_name}"
if [ -e "${name}-stamp" ]; then
return
fi
fetch_unpack "https://github.com/${path}/archive/${tag_name}.tar.gz"
(cd $name_tag_name \
local out_dir=$(fetch_unpack "https://github.com/${path}/archive/${tag_name}.tar.gz")
(cd $out_dir \
&& ./configure --prefix=$BUILD_PREFIX $configure_args \
&& make -j4 \
&& make install)
......
......@@ -12,10 +12,15 @@ suppress build_libpng
suppress build_libwebp
suppress build_szip
suppress build_swig
# We need to find a test for build_github
# We need to find a failable test for build_github
# It needs a standalone C library with ./configure script.
# arb (below) requires a couple of other libraries.
# suppress build_github fredrik-johansson/arb 2.13.0
# E.g. arb (below) requires a couple of other libraries.
# Run here just for the output, even though they fail.
(set +e ;
build_github fredrik-johansson/arb 2.13.0 ;
build_github glennrp/libpng v1.6.34 ;
build_github wbhart/mpir mpir-3.0.0
)
suppress build_flex
suppress build_openblas
suppress build_tiff
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment