ioapi/build: reviewed
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env modbuild
|
||||
|
||||
pbuild::supported_os 'Darwin'
|
||||
|
||||
pbuild::set_download_url "https://gitlab.psi.ch/Pmodules/download/raw/master/$P-$V.tar.gz"
|
||||
|
||||
pbuild::add_to_group 'HDF5'
|
||||
@@ -11,43 +13,33 @@ pbuild::add_docfile V32-CHANGES.txt
|
||||
pbuild::add_docfile VERSION.txt
|
||||
pbuild::add_docfile HTML/gpl.txt
|
||||
|
||||
echo $SRC_DIR
|
||||
declare config_args=()
|
||||
declare BIN=''
|
||||
|
||||
pbuild::post_prep() {
|
||||
find "${SRC_DIR}" -name "*.mod" -exec rm {} \;
|
||||
find "${SRC_DIR}" -name "*.o" -exec rm {} \;
|
||||
}
|
||||
|
||||
pbuild::pre_configure_Darwin() {
|
||||
cp -av "${BUILDBLOCK_DIR}/files/Makeinclude.OSX_x86_gfortmpi" "ioapi"
|
||||
BIN='OSX_x86_gfortmpi'
|
||||
}
|
||||
|
||||
pbuild::pre_configure() {
|
||||
config_args=()
|
||||
cp Makefile.template Makefile
|
||||
config_args+=( "BASEDIR=${SRC_DIR}" )
|
||||
config_args+=( "CPLMODE=pncf" )
|
||||
config_args+=( "INSTALL=${PREFIX}" )
|
||||
config_args+=( "NCFLIBS=-lpnetcdf -lnetcdf -lnetcdff -lgfortran" )
|
||||
|
||||
case "${OS}" in
|
||||
"Darwin" )
|
||||
config_args+=( "BIN=OSX_x86_gfortmpi" )
|
||||
;;
|
||||
* )
|
||||
echo "OS not supported!" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
pbuild::pre_configure_Darwin() {
|
||||
cd "${SRC_DIR}"
|
||||
cp Makefile.template Makefile
|
||||
cp -av "${BUILDBLOCK_DIR}/files/Makeinclude.OSX_x86_gfortmpi" "ioapi"
|
||||
config_args+=( "BIN=${BIN}" )
|
||||
}
|
||||
|
||||
pbuild::configure() {
|
||||
cd "${SRC_DIR}"
|
||||
make "${config_args[@]}" configure
|
||||
}
|
||||
|
||||
pbuild::build() {
|
||||
pbuild::compile() {
|
||||
make "${config_args[@]}" all
|
||||
}
|
||||
|
||||
@@ -56,5 +48,13 @@ pbuild::install() {
|
||||
make "${config_args[@]}" install
|
||||
}
|
||||
|
||||
pbuild::post_install() {
|
||||
cd "${PREFIX}"
|
||||
mkdir -p lib
|
||||
mv -v "${BIN}"/*.a 'lib'
|
||||
mv -v "${BIN}"/*.mod 'lib'
|
||||
mv -v "${BIN}" 'bin'
|
||||
}
|
||||
|
||||
pbuild::make_all
|
||||
|
||||
|
||||
Reference in New Issue
Block a user