File: before_all.sh

package info (click to toggle)
pybdsf 1.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,104 kB
  • sloc: fortran: 40,850; python: 14,894; ansic: 4,347; cpp: 1,586; makefile: 131; sh: 46
file content (34 lines) | stat: -rwxr-xr-x 1,051 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash -eux
#
# This script should be called by `cibuildwheel` in the `before-all` stage.
#
# This script will download and untar the Boost C++ source files.
# `${BOOST_VERSION}` should be set as `x.y.z`; the untarred sources can be
# found in the directory `${BOOST_BUILD_DIR}/boost`.
# Both environment variables must have been set.

# Download and untar the Boost C++ source files
# Rename the source directory to `boost`
function download_and_untar_boost
{
  major=$(echo "${BOOST_VERSION}" | cut -d. -f1)
  minor=$(echo "${BOOST_VERSION}" | cut -d. -f2)
  patch=$(echo "${BOOST_VERSION}" | cut -d. -f3)

  name="boost"
  long_name="${name}_${major}_${minor}_${patch}"
  site="https://sourceforge.net"
  directory="projects/${name}/files/${name}/${major}.${minor}.${patch}"
  file="${long_name}.tar.bz2"

  url="${site}/${directory}/${file}"

  rm -rf "${BOOST_BUILD_DIR}"
  mkdir -p "${BOOST_BUILD_DIR}"
  cd "${BOOST_BUILD_DIR}"
  curl -L -o - "${url}" | tar -xjf -
  mv "${long_name}" "${name}"
}

set -o pipefail
download_and_untar_boost