Last active
August 17, 2017 01:31
-
-
Save cartoonist/32fc8595d8e1a6255c44067d1eb0dfcc to your computer and use it in GitHub Desktop.
GCSA2 installation script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prefix=${TMP_PREFIX} | |
exec_prefix=${prefix} | |
libdir=${prefix}/lib | |
includedir=${prefix}/include | |
bindir=${prefix}/bin | |
Name: gcsa2 | |
Description: GCSA2: BWT-based index for graphs | |
Version: 1.0.0 | |
URL: https://github.com/jltsiren/gcsa2 | |
Libs: -L${libdir} -lgcsa2 | |
Cflags: -I${includedir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PREFIX="$1" | |
if [ -z "${PREFIX}" ] || [ ! -d "${PREFIX}" ]; then | |
echo "Setting PREFIX to '/usr/local'" | |
PREFIX="/usr/local" | |
fi | |
PREFIX_BIN="${PREFIX}/bin" | |
PREFIX_LIB="${PREFIX}/lib" | |
PREFIX_PKG="${PREFIX_LIB}/pkgconfig" | |
GCSA2PC_TMPL="https://gist.githubusercontent.com/cartoonist/32fc8595d8e1a6255c44067d1eb0dfcc/raw/c38044ae5466e597d57477eff3b4864a19ffd548/gcsa2.pc.in" | |
declare -a BINS=("build_gcsa" "convert_graph" "gcsa_format") | |
declare -a LIBS=("libgcsa2.a") | |
declare -a INCS=($(find "include/gcsa" -type f)) | |
function lc_install { | |
install -vD "$1" "$2" | |
} | |
function install_bin { | |
lc_install "$1" "${PREFIX_BIN}/$1" | |
} | |
function install_lib { | |
lc_install "$1" "${PREFIX_LIB}/$1" | |
} | |
function install_inc { | |
lc_install "$1" "${PREFIX}/$1" # $1 already contains 'include/' | |
} | |
function install_pkg { | |
lc_install "$1" "${PREFIX_PKG}/$1" | |
} | |
for BINARY in ${BINS[@]}; do | |
install_bin ${BINARY} | |
done | |
for LIBRARY in ${LIBS[@]}; do | |
install_lib ${LIBRARY} | |
done | |
for HEADER in ${INCS[@]}; do | |
install_inc ${HEADER} | |
done | |
curl "${GCSA2PC_TMPL}" | sed -e "s#\${TMP_PREFIX}#${PREFIX}#" > gcsa2.pc | |
install_pkg gcsa2.pc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
install.sh
.gcsa2
source directory.install.sh
.