Skip to content

Commit

Permalink
Fix up linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
RyeMutt committed Jun 23, 2024
1 parent cfce156 commit 38697f9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 40 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 3p-sentry

[Autobuild][] packaged [sentry-native][] and [sentry-cocoa][].

[Autobuild]: https://github.com/secondlife/autobuild
[sentry-native]: https://github.com/getsentry/sentry-native
[sentry-cocoa]: https://github.com/getsentry/sentry-cocoa
10 changes: 5 additions & 5 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<key>name</key>
<string>curl</string>
<key>canonical_repo</key>
<string>https://git.alchemyviewer.org/alchemy/thirdparty/3p-curl</string>
<string>https://github.com/AlchemyViewer/3p-curl</string>
<key>description</key>
<string>Library for transferring data specified with URL syntax</string>
<key>source_type</key>
Expand Down Expand Up @@ -194,7 +194,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>name</key>
<string>openssl</string>
<key>canonical_repo</key>
<string>https://git.alchemyviewer.org/alchemy/thirdparty/3p-openssl</string>
<string>https://github.com/AlchemyViewer/3p-openssl</string>
<key>description</key>
<string>Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) Library</string>
</map>
Expand Down Expand Up @@ -256,7 +256,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>name</key>
<string>zlib-ng</string>
<key>canonical_repo</key>
<string>https://git.alchemyviewer.org/alchemy/thirdparty/3p-zlib-ng</string>
<string>https://github.com/AlchemyViewer/3p-zlib-ng</string>
<key>description</key>
<string>zlib replacement with optimizations for next generation systems.</string>
</map>
Expand Down Expand Up @@ -287,7 +287,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
</map>
<key>manifest</key>
<array>
<string>include/sentry/*</string>
<string>include/*</string>
<string>LICENSES/sentry.txt</string>
</array>
<key>build_directory</key>
Expand Down Expand Up @@ -334,7 +334,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
</map>
<key>manifest</key>
<array>
<string>lib/release/*</string>
<string>lib/*.a</string>
</array>
<key>name</key>
<string>linux</string>
Expand Down
44 changes: 9 additions & 35 deletions build-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ case "$AUTOBUILD_PLATFORM" in
mkdir -p "build_release"
pushd "build_release"
# Invoke cmake and use as official build
cmake -G "$AUTOBUILD_WIN_CMAKE_GEN" -A "$AUTOBUILD_WIN_VSPLATFORM" .. \
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_INSTALL_PREFIX=$(cygpath -w "$stage/sentry")

Expand Down Expand Up @@ -75,24 +76,13 @@ case "$AUTOBUILD_PLATFORM" in
popd
popd
cp -a Carthage/Build/Mac/* $stage/lib/release/

if [ -n "${APPLE_SIGNATURE:=""}" -a -n "${APPLE_KEY:=""}" -a -n "${APPLE_KEYCHAIN:=""}" ]; then
KEYCHAIN_PATH="$HOME/Library/Keychains/$APPLE_KEYCHAIN"
security unlock-keychain -p $APPLE_KEY $KEYCHAIN_PATH
codesign --keychain "$KEYCHAIN_PATH" --sign "$APPLE_SIGNATURE" --force --timestamp "$stage/lib/release/Sentry.framework" || true
codesign --keychain "$KEYCHAIN_PATH" --sign "$APPLE_SIGNATURE" --force --timestamp "$stage/lib/release/SentryPrivate.framework" || true
codesign --keychain "$KEYCHAIN_PATH" --sign "$APPLE_SIGNATURE" --force --timestamp "$stage/lib/release/SentrySwiftUI.framework" || true
security lock-keychain $KEYCHAIN_PATH
else
echo "Code signing not configured; skipping codesign."
fi
popd
;;

# -------------------------- linux, linux64 --------------------------
linux*)
pushd "$NATIVE_SOURCE_DIR"
# Linux build environment at Alchemy comes pre-polluted with stuff that can
# Linux build environment at Linden comes pre-polluted with stuff that can
# seriously damage 3rd-party builds. Environmental garbage you can expect
# includes:
#
Expand All @@ -107,17 +97,9 @@ case "$AUTOBUILD_PLATFORM" in
#
unset DISTCC_HOSTS CFLAGS CPPFLAGS CXXFLAGS

# Default target per autobuild build --address-size
opts="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE}"
# Use simple flags for crash reporter
DEBUG_COMMON_FLAGS="$opts -Og -g -fPIC -DPIC"
RELEASE_COMMON_FLAGS="$opts -O2 -g -fPIC -DPIC -D_FORTIFY_SOURCE=2"
DEBUG_CFLAGS="$DEBUG_COMMON_FLAGS"
RELEASE_CFLAGS="$RELEASE_COMMON_FLAGS"
DEBUG_CXXFLAGS="$DEBUG_COMMON_FLAGS -std=c++17"
RELEASE_CXXFLAGS="$RELEASE_COMMON_FLAGS -std=c++17"
DEBUG_CPPFLAGS="-DPIC"
RELEASE_CPPFLAGS="-DPIC -D_FORTIFY_SOURCE=2"
# Default target per --address-size
opts_c="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE_CFLAGS}"
opts_cxx="${TARGET_OPTS:--m$AUTOBUILD_ADDRSIZE $LL_BUILD_RELEASE_CXXFLAGS}"

# Handle any deliberate platform targeting
if [ -z "${TARGET_CPPFLAGS:-}" ]; then
Expand All @@ -134,23 +116,15 @@ case "$AUTOBUILD_PLATFORM" in
cmake ../ -G"Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_C_FLAGS="$RELEASE_CFLAGS" \
-DCMAKE_CXX_FLAGS="$RELEASE_CXXFLAGS" \
-DCMAKE_INSTALL_PREFIX="$stage/sentry" \
-DCMAKE_C_FLAGS="$opts_c" \
-DCMAKE_CXX_FLAGS="$opts_cxx" \
-DCMAKE_INSTALL_PREFIX="$stage" \
-DSENTRY_BUILD_SHARED_LIBS=FALSE \
-DSENTRY_BACKEND="breakpad"

cmake --build . --config RelWithDebInfo --parallel $AUTOBUILD_CPU_COUNT
cmake --install . --config RelWithDebInfo
popd

pushd "$stage/sentry"
mkdir -p "$stage/include/sentry"
mkdir -p "$stage/lib/release"

cp -a lib/*.a "$stage/lib/release"
cp -a include/* "$stage/include/sentry"
popd
popd
;;
esac
Expand Down

0 comments on commit 38697f9

Please sign in to comment.