Commit 805f100e authored by Simon Braß's avatar Simon Braß
Browse files

Add patched M4; fix some words

parent 62665423
Pipeline #9764 failed with stage
in 60 minutes and 9 seconds
#!/usr/bin/env bash
## Bootstrap WHIZARD and environment
##
## with recommanded packages enabled as default.
## with recommended packages enabled as default.
##
## Author: Simon Braß <simon.brass@desy.de>
## Last modified: 25th May 2021
##
## CAUTION: We take no garantue for the correct usage or indentation of this script.
## CAUTION: We take no garantuee for the correct usage or indentation of this script.
## USE AT YOUR OWN RISK! → READ AND UNDERSTAND the following lines.
##
## Requirements: Bash (>5), Unix-System
......@@ -15,7 +15,7 @@
## * Description
##
## Bundle all external dependencies of the Monte Carlo event generator WHIZARD.
## The bootstrap script downloads, builds and installs all external tools in a consistent way in one (discardable) user place.
## The bootstrap script downloads, builds and installs all external tools in a consistent way in one (discard able) user place.
## The script is not meant for global installation, i.e. directly in {/usr,/usr/local}, neither to be run as root or with superuser/sudo permissions.
## We try our best to veto those cases, but beware of the unconventional user.
##
......@@ -41,6 +41,7 @@
##
## * TODO
##
## - Signature validation
## - CMake (Build)
## - Compiler FLAGS (FC, CC, CXX) and CFLAGS, CXXFLAGS, FCFLAGS (at least)
##
......@@ -80,7 +81,7 @@ export PATH="${PREFIX}/bin:${PATH}"
export LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/OpenLoops/lib:${LD_LIBRARY_PATH}"
# #######################################################################
# The locations of the sofware packages
# The locations of the software packages
# #######################################################################
# 1. Verify packages (checksum, GPG signature,...)
......@@ -89,6 +90,7 @@ export LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/OpenLoops/lib:${LD_LIBRARY_PATH}
# Autotools
url_make="http://ftp.gnu.org/gnu/make/make-4.3.tar.gz"
url_m4="http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz"
url_m4_patch="https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/m4/trunk/m4-1.4.18-glibc-change-work-around.patch"
url_autoconf="http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz"
url_automake="http://ftp.gnu.org/gnu/automake/automake-1.16.2.tar.gz"
url_libtool="http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz"
......@@ -153,7 +155,13 @@ function basename_pkg () {
function download_untar_pkg () {
local url="${1}"
# --content-disposition: Use filename from HTTPS header, if available.
wget -q --content-disposition "${url}" -O- | tar xz
wget --quiet --content-disposition "${url}" -O- | tar xz
}
function patch_pkg () {
local url_patch="${1}"
wget --quiet "${url_patch}" && \
patch -p1 -i "$(basename ${url_patch})"
}
function make_make_install () {
......@@ -197,6 +205,19 @@ build_generic () {
popd || return
}
patch_build_generic () {
local url="${1}"
local url_patch="${2}"
local config="${3:-}"
local name="$(basename_pkg ${url} .tar.gz)"
test -d "${name}" || download_untar_pkg "${url}" "${url_patch}"
pushd "${name}" && \
patch_pkg "${url_patch}" && \
make_make_install "${config}" && \
popd || return
}
# $1 : Download-URL
# $2 : Configure options
build_cmake_generic () {
......@@ -275,6 +296,22 @@ build_rivet () {
popd
}
# Download, *patch*, and build package with NAME from URL, log the progress to LOGDIR/NAME.log.
patch_make_and_log () {
local name="${1}"
local url="${2}"
local url_patch="${3}"
local config="${4:-}"
echo "Patch and build ${name} ... " && \
patch_build_generic "${url}" "${url_patch}" "${config}" 1>"${LOG}/${name}.log" 2>&1
if test $? -eq 0; then
echo "... finished."
else
echo "... failed. See ${LOG}/${name}.log."
exit 2
fi
}
# Download and build package with NAME from URL, log the progress to LOGDIR/NAME.log.
make_and_log () {
local name="${1}"
......@@ -457,7 +494,7 @@ PYTHIA8_CONFIG=(
## ** Note
##
## Per default, we do not include the ROOT build.
## However, the user *must* set an exisiting =ROOT_DIR= which points towards the top-level directory of an ROOT installation.
## However, the user *must* set an existing =ROOT_DIR= which points towards the top-level directory of an ROOT installation.
## We /only/ check the existence of the top-level directory and assess that =ROOTConfig.cmake= exists.
##
## ** Example
......@@ -539,8 +576,8 @@ function main() {
autotools)
(command -v make >/dev/null 2>&1 && test "${FORCE}" != "True") || make_and_log "make" "${url_make}"
# https://lists.gnu.org/archive/html/bug-m4/2019-10/msg00000.html
# We exclude m4 as long as there is no fix in sight.
# (command -v m4 >/dev/null 2>&1 && test "${FORCE}" != "True") || make_and_log "m4" "${url_m4}"
# M4 and some glibc version clash, hence, we include a patch by ArchLinux to circumvent the issue.
(command -v m4 >/dev/null 2>&1 && test "${FORCE}" != "True") || patch_make_and_log "m4" "${url_m4}" "${url_m4_patch}"
(command -v autoconf >/dev/null 2>&1 && test "${FORCE}" != "True") || make_and_log "autoconf" "${url_autoconf}"
(command -v automake >/dev/null 2>&1 && test "${FORCE}" != "True") || make_and_log "automake" "${url_automake}"
(command -v libtool >/dev/null 2>&1 && test "${FORCE}" != "True") || make_and_log "libtool" "${url_libtool}"
......
Supports Markdown
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