-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set -u | ||
|
||
cd build | ||
make ${MAKE_J} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set -u | ||
|
||
cd build | ||
make install |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set -u | ||
|
||
rm -rf build && mkdir -p build && cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX ../ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) | ||
. $SCRIPT_DIR/../../scripts/util.sh | ||
. $SCRIPT_DIR/version.sh | ||
set_prefix | ||
|
||
VERSION_MAJOR=$(echo "${__VERSION__}" | cut -d . -f 1,2) | ||
if [ -f $SOURCE_DIR/${__NAME__}-${__VERSION__}.tar.gz ]; then :; else | ||
check wget -O $SOURCE_DIR/${__NAME__}-${__VERSION__}.tar.gz https://github.com/spglib/spglib/archive/refs/tags/v${__VERSION__}.tar.gz | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/sh | ||
cat << EOF > config.txt | ||
# configurable variables (e.g. compiler) | ||
# use default if not defined | ||
export MAKE_J="${MAKE_J:-"-j1"}" | ||
# export explicitly if defined | ||
test -n "${CC+defined}" && export CC="$CC" | ||
EOF | ||
. ./config.txt | ||
|
||
set -e | ||
|
||
XTRACED=$(set -o | awk '/xtrace/{ print $2 }') | ||
if [ "$XTRACED" = "off" ]; then | ||
SHFLAG="" | ||
else | ||
SHFLAG="-x" | ||
fi | ||
|
||
mode=${1:-default} | ||
export SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) | ||
CONFIG_DIR=$SCRIPT_DIR/config/$mode | ||
if [ ! -d $CONFIG_DIR ]; then | ||
echo "Error: unknown mode: $mode" | ||
echo "Available list:" | ||
ls -1 $SCRIPT_DIR/config | ||
exit 127 | ||
fi | ||
DEFAULT_CONFIG_DIR=$SCRIPT_DIR/config/default | ||
|
||
export UTIL_SH=$SCRIPT_DIR/../../scripts/util.sh | ||
. $UTIL_SH | ||
. $SCRIPT_DIR/version.sh | ||
set_prefix | ||
|
||
. ${MA_ROOT}/env.sh | ||
export PREFIX="${MA_ROOT}/${__NAME__}/${__NAME__}-${__VERSION__}-${__MA_REVISION__}" | ||
if [ -d $PREFIX ]; then | ||
echo "Error: $PREFIX exists" | ||
exit 127 | ||
fi | ||
export LOG=${BUILD_DIR}/${__NAME__}-${__VERSION__}-${__MA_REVISION__}.log | ||
mv config.txt $LOG | ||
|
||
set +e | ||
. $SCRIPT_DIR/../../tools/openssl/find.sh; if [ ${MA_HAVE_OPENSSL} = "no" ]; then echo "Error: openssl not found"; exit 127; fi | ||
set -e | ||
|
||
rm -rf ${BUILD_DIR}/${__NAME__}-${__VERSION__} | ||
pipefail sh $SHFLAG ${SCRIPT_DIR}/setup.sh \| tee -a $LOG | ||
cd ${BUILD_DIR}/${__NAME__}-${__VERSION__} | ||
start_info | tee -a $LOG | ||
|
||
for process in preprocess build install postprocess; do | ||
if [ -f $CONFIG_DIR/${process}.sh ]; then | ||
echo "[${process}]" | tee -a $LOG | ||
pipefail check sh $SHFLAG $CONFIG_DIR/${process}.sh \| tee -a $LOG | ||
elif [ -f $DEFAULT_CONFIG_DIR/${process}.sh ]; then | ||
echo "[${process}]" | tee -a $LOG | ||
pipefail check sh $SHFLAG $DEFAULT_CONFIG_DIR/${process}.sh \| tee -a $LOG | ||
fi | ||
done | ||
|
||
finish_info | tee -a $LOG | ||
|
||
ROOTNAME=$(toupper ${__NAME__})_ROOT | ||
|
||
cat << EOF > ${BUILD_DIR}/${__NAME__}vars.sh | ||
# ${__NAME__} $(basename $0 .sh) ${__VERSION__} ${__MA_REVISION__} $(date +%Y%m%d-%H%M%S) | ||
export ${ROOTNAME}=$PREFIX | ||
export LD_LIBRARY_PATH=\${${ROOTNAME}}/lib64:\$LD_LIBRARY_PATH | ||
export DYLD_LIBRARY_PATH=\${${ROOTNAME}}/lib64:\$DYLD_LIBRARY_PATH | ||
EOF | ||
VARS_SH=${MA_ROOT}/${__NAME__}/${__NAME__}vars-${__VERSION__}-${__MA_REVISION__}.sh | ||
rm -f $VARS_SH | ||
cp -f ${BUILD_DIR}/${__NAME__}vars.sh $VARS_SH | ||
cp -f $LOG ${MA_ROOT}/${__NAME__}/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) | ||
. $SCRIPT_DIR/../../scripts/util.sh | ||
. $SCRIPT_DIR/version.sh | ||
set_prefix | ||
|
||
. $MA_ROOT/env.sh | ||
|
||
VARS_SH=$MA_ROOT/${__NAME__}/${__NAME__}vars-$__VERSION__-$__MA_REVISION__.sh | ||
rm -f $MA_ROOT/env.d/${__NAME__}vars.sh | ||
ln -s $VARS_SH $MA_ROOT/env.d/${__NAME__}vars.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
SCRIPT_DIR=$(cd "$(dirname $0)"; pwd) | ||
. $SCRIPT_DIR/../../scripts/util.sh | ||
. $SCRIPT_DIR/version.sh | ||
set_prefix | ||
|
||
sh $SCRIPT_DIR/download.sh | ||
|
||
cd $BUILD_DIR | ||
if [ -d ${__NAME__}-${__VERSION__} ]; then :; else | ||
check tar zxf $SOURCE_DIR/${__NAME__}-${__VERSION__}.tar.gz | ||
if [ -f $SCRIPT_DIR/patch/${__NAME__}-${__VERSION__}.patch ]; then | ||
cd ${__NAME__}-${__VERSION__} | ||
cat $SCRIPT_DIR/patch/${__NAME__}-${__VERSION__}.patch | patch -p1 | ||
fi | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SPGLIB_VERSION="2.5.0" | ||
SPGLIB_MA_REVISION="1" | ||
|
||
__NAME__=spglib | ||
__VERSION__=${SPGLIB_VERSION} | ||
__MA_REVISION__=${SPGLIB_MA_REVISION} |