generated from arras-energy/gridlabd-old
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Darwin 23 setup (#193)
Signed-off-by: Duncan Ragsdale <[email protected]>
- Loading branch information
1 parent
686e61d
commit 22f6be4
Showing
8 changed files
with
110 additions
and
27 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ m4_define([versionname], sbuild_m4_esyscmd_s([build-aux/version.sh --name])) | |
m4_define([pkginstall], sbuild_m4_esyscmd_s([build-aux/version.sh --install])) | ||
m4_define([pkgorigin],sbuild_m4_esyscmd_s([git rev-parse --abbrev-ref HEAD])) | ||
AC_PREREQ([2.71]) | ||
AC_PREREQ([2.72]) | ||
AC_INIT([pkgname],[pkgversion],[[email protected]],[pkg]) | ||
AC_CONFIG_SRCDIR([source/gridlabd.h]) | ||
AC_CONFIG_HEADERS([source/config.h]) | ||
|
@@ -527,6 +527,14 @@ AS_IF([test "x$MYSQL" != "xno"], | |
# Define HAVE_MYSQL | ||
AC_DEFINE([HAVE_MYSQL], [1], [Define when you have MySQL]) | ||
# Add brew paths for Darwin systems | ||
AS_CASE([$host_os], | ||
[darwin*], [ | ||
BREW_PREFIX=$(brew --prefix) | ||
MYSQL_LDFLAGS="$MYSQL_LDFLAGS -L${BREW_PREFIX}/opt/openssl/lib -L${BREW_PREFIX}/lib" | ||
MYSQL_CPPFLAGS="$MYSQL_CPPFLAGS -I${BREW_PREFIX}/opt/openssl/include -I${BREW_PREFIX}/include" | ||
]) | ||
], | ||
[HAVE_MYSQL=no]) | ||
|
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
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
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
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,75 @@ | ||
set -x | ||
alias INSTALL='' | ||
|
||
INSTALL error () { echo "ERROR [$(basename $0)]: $*" > /dev/stderr ; exit 1 ; } | ||
INSTALL PYTHON_VERSION=3.10 | ||
INSTALL PYTHON_VENV=${HOME:-/tmp}/.gridlabd | ||
INSTALL PYTHON_EXEC=$PYTHON_VENV/bin/python$PYTHON_VERSION | ||
INSTALL PYTHON_CONFIG=$PYTHON_VENV/bin/python${PYTHON_VERSION}-config | ||
|
||
# check for root access | ||
INSTALL test "$(whoami)" != "root" || error "you should not run setup.sh as root or use sudo" | ||
|
||
# prepare brew for installations | ||
INSTALL brew -h 1>/dev/null 2>&1 || error "you must install brew first. See https://brew.sh for details." | ||
|
||
# setup requires python version if not already installed | ||
if ! python$PYTHON_VERSION --version 1>/dev/null 2>&1 ; then | ||
INSTALL brew install python@$PYTHON_VERSION | ||
python$PYTHON_VERSION --version || error "python$PYTHON_VERSION installation failed" | ||
fi | ||
if ! python$PYTHON_VERSION -m venv -h 1>/dev/null 2>&1 ; then | ||
printf "installing... " | ||
INSTALL brew install python$PYTHON_VERSION-venv | ||
python$PYTHON_VERSION -m venv -h >/dev/null || error "unable to install python$PYTHON_VERSION-venv" | ||
fi | ||
|
||
# create python venv for setup if not already done | ||
if [ ! -x "$PYTHON_EXEC" ] ; then | ||
INSTALL python$PYTHON_VERSION -m venv $PYTHON_VENV | ||
test -x "$PYTHON_EXEC" || error "python venv creation failed" | ||
fi | ||
|
||
# activate the build environment for python | ||
INSTALL . $PYTHON_VENV/bin/activate | ||
test ! -z "$VIRTUAL_ENV" || error "python venv activation failed" | ||
|
||
# upgrade pip if needed | ||
if ! "$PYTHON_EXEC" -m pip --version 1>/dev/null 2>&1 ; then | ||
INSTALL curl -fsL https://bootstrap.pypa.io/get-pip.py | python$PYTHON_VERSION | ||
INSTALL "$PYTHON_EXEC" -m pip --version || error "pip installation failed" | ||
fi | ||
|
||
# install python-config | ||
if ! "python$PYTHON_VERSION-config" --prefix 1>/dev/null 2>&1 ; then | ||
INSTALL brew install python$PYTHON_VERSION-dev | ||
python$PYTHON_VERSION-config --prefix || error "python$PYTHON_VERSION-config installation failed" | ||
fi | ||
INSTALL "$PYTHON_EXEC" -m pip install --upgrade pip || error "pip update failed" | ||
|
||
# install required libraries | ||
INSTALL brew install autoconf libffi zlib pkg-config xz gdbm tcl-tk | ||
|
||
# install required tools | ||
INSTALL brew install automake libtool gnu-sed gawk | ||
|
||
clang -v >/dev/null || error "you have not installed clang. Use 'xcode-select --install' to install command line build tools." | ||
|
||
# # update library paths | ||
# INSTALL ldconfig | ||
|
||
# install mysql | ||
if ! mysql_config --libs >/dev/null 2>&1 ; then | ||
printf "Installing MySQL... " | ||
brew install mysql | ||
if ! mysql_config --libs >/dev/null 2>&1 ; then | ||
error "Failed to install MySQL with Homebrew." | ||
fi | ||
fi | ||
|
||
# install autoconf 2.72 as required | ||
if [ "$(autoconf --version | head -n 1 | cut -f4 -d' ')" != "2.72" ] ; then | ||
(cd /tmp ; curl -sL https://ftpmirror.gnu.org/autoconf/autoconf-2.72.tar.gz | tar xz ) | ||
(cd /tmp/autoconf-2.72 ; ./configure ; make ; make install) | ||
test "$(autoconf --version | head -n 1 | cut -f4 -d' ')" = "2.72" || error "autoconf installation failed" | ||
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
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