Skip to content

Commit

Permalink
Update package script
Browse files Browse the repository at this point in the history
  • Loading branch information
grunt-lucas committed Aug 29, 2023
1 parent a724091 commit 218749f
Showing 1 changed file with 42 additions and 18 deletions.
60 changes: 42 additions & 18 deletions package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@

set -eu

macos_aarch64() {
echo "Packaging release macos-aarch64..."
mkdir -p "$output_directory/porytiles-$mode"
make clean
CXXFLAGS="-nostdinc++ -nostdlib++ -isystem /opt/homebrew/opt/llvm@16/include/c++/v1" \
LDFLAGS="-L /opt/homebrew/opt/llvm@16/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@16/lib/c++ -lc++" \
CXX=/opt/homebrew/opt/llvm/bin/clang++ \
make release-check
package_release() {
cp release/bin/porytiles "$output_directory/porytiles-$mode"
cp CHANGELOG.md "$output_directory/porytiles-$mode"
cp README.md "$output_directory/porytiles-$mode"
Expand All @@ -19,21 +12,48 @@ macos_aarch64() {
zip -r "$output_directory/porytiles-$mode.zip" "$output_directory/porytiles-$mode"
}

macos_aarch64() {
echo "Packaging release macos-aarch64..."
mkdir -p "$output_directory/porytiles-$mode"
make clean
export CXXFLAGS="-nostdinc++ -nostdlib++ -isystem /opt/homebrew/opt/llvm@16/include/c++/v1"
export LDFLAGS="-L /opt/homebrew/opt/llvm@16/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm@16/lib/c++ -lc++"
export CXX=/opt/homebrew/opt/llvm/bin/clang++
make release-check
package_release
}

macos_amd64() {
echo "Packaging release macos-amd64..."
mkdir -p "$output_directory/porytiles-$mode"
make clean
CXXFLAGS="-nostdinc++ -nostdlib++ -isystem /usr/local/opt/llvm@16/include/c++/v1" \
LDFLAGS="-L /usr/local/opt/llvm@16/lib/c++ -Wl,-rpath,/usr/local/opt/llvm@16/lib/c++ -lc++" \
CXX=/usr/local/opt/llvm/bin/clang++ \
export CXXFLAGS="-nostdinc++ -nostdlib++ -isystem /usr/local/opt/llvm@16/include/c++/v1"
export LDFLAGS="-L /usr/local/opt/llvm@16/lib/c++ -Wl,-rpath,/usr/local/opt/llvm@16/lib/c++ -lc++"
export CXX=/usr/local/opt/llvm/bin/clang++
make release-check
cp release/bin/porytiles "$output_directory/porytiles-$mode"
cp CHANGELOG.md "$output_directory/porytiles-$mode"
cp README.md "$output_directory/porytiles-$mode"
cp LICENSE "$output_directory/porytiles-$mode"
cp -r res "$output_directory/porytiles-$mode"
cp -r libs "$output_directory/porytiles-$mode"
zip -r "$output_directory/porytiles-$mode.zip" "$output_directory/porytiles-$mode"
package_release
}

linux_aarch64() {
echo "Packaging release linux-aarch64..."
mkdir -p "$output_directory/porytiles-$mode"
make clean
export CXXFLAGS=-stdlib=libc++
export LDFLAGS="-stdlib=libc++ -static"
export CXX=clang++-16
make release-check
package_release
}

linux_amd64() {
echo "Packaging release linux-amd64..."
mkdir -p "$output_directory/porytiles-$mode"
make clean
export CXXFLAGS=-stdlib=libc++
export LDFLAGS="-stdlib=libc++ -static"
export CXX=clang++-16
make release-check
package_release
}

main() {
Expand All @@ -58,6 +78,10 @@ main() {
macos-amd64
;;

linux-amd64)
linux-amd64
;;

*)
echo "unknown mode: $mode"
exit 1
Expand Down

0 comments on commit 218749f

Please sign in to comment.