-
Notifications
You must be signed in to change notification settings - Fork 102
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
11 changed files
with
154 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/bin/bash | ||
|
||
# Compile dependencies that cannot be acquired via the official repositories | ||
|
||
mkdir -p ${INSTALL_PATH} | ||
|
||
## Compile Thrift | ||
CXXFLAGS_OLD=$CXXFLAGS | ||
LDFLAGS_OLD=$LDFLAGS | ||
export CXXFLAGS="$CXXFLAGS -I/opt/homebrew/include" | ||
export LDFLAGS="$LDFLAGS -L/opt/homebrew/lib" | ||
export CXXFLAGS="$CXXFLAGS -Wno-error" | ||
|
||
tar -xvf ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz | ||
cd thrift-0.16.0 | ||
./configure --prefix=${INSTALL_PATH}/thrift --silent --without-python \ | ||
--enable-libtool-lock --enable-tutorial=no --enable-tests=no \ | ||
--with-libevent --with-zlib --without-nodejs --without-lua \ | ||
--without-ruby --without-csharp --without-erlang --without-perl \ | ||
--without-php --without-php_extension --without-dart \ | ||
--without-haskell --without-go --without-rs --without-haxe \ | ||
--without-dotnetcore --without-d --without-qt4 --without-qt5 \ | ||
--without-java --without-swift \ | ||
--with-openssl=/opt/homebrew/opt/openssl | ||
|
||
make install -j $(nproc) | ||
|
||
export CXXFLAGS=$CXXFLAGS_OLD | ||
export LDFLAGS=$LDFLAGS_OLD | ||
|
||
## Compile build2 | ||
|
||
sh "${DOWNLOAD_PATH}/install_latest_build2.sh" ${INSTALL_PATH}/build2 | ||
|
||
## Compile libodb runtime libraries | ||
mkdir -p ${DOWNLOAD_PATH}/libodb | ||
cd ${DOWNLOAD_PATH}/libodb | ||
${INSTALL_PATH}/build2/bin/bpkg create --quiet --jobs $(nproc) cc \ | ||
config.cxx=g++ \ | ||
config.cc.coptions=-O3 \ | ||
config.bin.rpath=${INSTALL_PATH}/odb/lib \ | ||
config.install.root=${INSTALL_PATH}/odb | ||
|
||
### Getting the source | ||
${INSTALL_PATH}/build2/bin/bpkg add https://pkg.cppget.org/1/beta --trust-yes | ||
${INSTALL_PATH}/build2/bin/bpkg fetch --trust-yes | ||
|
||
### Building ODB runtime library | ||
${INSTALL_PATH}/build2/bin/bpkg build libodb --yes | ||
${INSTALL_PATH}/build2/bin/bpkg build libodb-sqlite --yes | ||
${INSTALL_PATH}/build2/bin/bpkg build libodb-pgsql --yes | ||
${INSTALL_PATH}/build2/bin/bpkg install --all --recursive | ||
|
||
## Compile odb compiler | ||
mkdir -p ${DOWNLOAD_PATH}/odb | ||
cd ${DOWNLOAD_PATH}/odb | ||
bpkg create --quiet --jobs $(nproc) cc \ | ||
config.cxx=g++-13 \ | ||
config.cc.poptions=-I/opt/homebrew/include \ | ||
config.cc.coptions=-O3 \ | ||
config.bin.rpath=${INSTALL_PATH}/odb/lib \ | ||
config.install.root=${INSTALL_PATH}/odb | ||
|
||
### Getting the source | ||
bpkg add https://pkg.cppget.org/1/beta --trust-yes | ||
bpkg fetch --trust-yes | ||
|
||
### Building ODB Compiler | ||
bpkg build odb --yes | ||
bpkg install odb |
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,36 @@ | ||
#!/bin/bash | ||
|
||
# Download installers for compiled dependencies | ||
|
||
mkdir -p "${DOWNLOAD_PATH}" | ||
|
||
## Thrift 0.16 | ||
|
||
wget -O ${DOWNLOAD_PATH}/thrift-0.16.0.tar.gz "http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz" | ||
|
||
## ODB | ||
|
||
wget -O "${DOWNLOAD_PATH}/install_latest_build2.sh" "https://github.com/Ericsson/CodeCompass/raw/master/scripts/install_latest_build2.sh" | ||
build2_version=$(sh "${DOWNLOAD_PATH}/install_latest_build2.sh" --version) | ||
odb_signature=$(wget -qO- https://pkg.cppget.org/1/beta/signature.manifest) | ||
|
||
# Calculate hash of dependencies for Github Cache Action | ||
|
||
dependencies_to_hash=("thrift-0.16.0.tar.gz") | ||
|
||
concatenated_hashes="" | ||
for file in "${dependencies_to_hash[@]}"; do | ||
file_hash=$(md5sum "${DOWNLOAD_PATH}/${file}" | awk '{print $1}') | ||
concatenated_hashes="${concatenated_hashes}${file_hash}" | ||
done | ||
concatenated_hashes="${concatenated_hashes}${build2_version}${odb_signature}" | ||
|
||
hash_value=$(echo -n "$concatenated_hashes" | md5sum | awk '{print $1}') | ||
|
||
## Save said hash | ||
|
||
### Restore action | ||
echo "macos-12-compile-hash-key=${hash_value}" >> "$GITHUB_OUTPUT" | ||
|
||
### Save action | ||
echo "CACHE_KEY=${hash_value}" >> "$GITHUB_ENV" |
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 @@ | ||
#!/bin/bash | ||
|
||
# Post compilation configuration for building (environmental variables, library location settings etc..) | ||
|
||
echo "${INSTALL_PATH}/odb/bin" >> $GITHUB_PATH | ||
echo "CMAKE_PREFIX_PATH=${INSTALL_PATH}/odb:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV |
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,21 @@ | ||
#!/bin/bash | ||
|
||
# Install available dependencies from HomeBrew | ||
brew install wget | ||
brew install node | ||
brew install sqlite | ||
brew install cmake | ||
brew install llvm@15 | ||
brew install gcc | ||
brew install boost | ||
brew install bison | ||
brew install graphviz | ||
brew install googletest | ||
brew install libgit2 | ||
brew install libmagic | ||
brew install openssl@3 | ||
brew install gnu-sed | ||
brew install coreutils | ||
|
||
# Place Bison on the PATH | ||
echo "/opt/homebrew/opt/bison/bin" >> $GITHUB_PATH |
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 @@ | ||
#!/bin/bash | ||
|
||
# Install PostgreSQL | ||
brew install postgresql@14 |
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 @@ | ||
#!/bin/bash | ||
|
||
# Install SQLite3 | ||
brew install sqlite |
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
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