Skip to content

Commit 069ad08

Browse files
Update build_adventurecoin_mac.sh
1 parent ddc6e63 commit 069ad08

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

build_adventurecoin_mac.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ read -rp $'\nDo you want to strip the binaries after build? (y/n): ' STRIP_BIN
2727
# 3. Create .app + .dmg?
2828
read -rp $'\nDo you want to create a .app and DMG for Qt Wallet? (y/n): ' MAKE_DMG
2929

30+
# --------------------------
31+
# Environment PATH fallback
32+
# --------------------------
33+
export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"
34+
3035
# --------------------------
3136
# Dependencies
3237
# --------------------------
@@ -43,6 +48,7 @@ PROTOBUF_URL="https://github.com/protocolbuffers/protobuf/releases/download/v3.6
4348
if [ ! -f "$PROTOBUF_DIR/bin/protoc" ]; then
4449
echo -e "${GREEN}>>> Installing Protobuf 3.6.1 (compatible version)...${RESET}"
4550
mkdir -p "$HOME/local"
51+
CUR_DIR="$(pwd)"
4652
cd /tmp
4753
curl -LO "$PROTOBUF_URL"
4854
tar -xvf "$PROTOBUF_TAR"
@@ -51,6 +57,7 @@ if [ ! -f "$PROTOBUF_DIR/bin/protoc" ]; then
5157
make -j"$(sysctl -n hw.logicalcpu)"
5258
make install
5359
echo -e "${CYAN}✔ Installed Protobuf 3.6.1 to $PROTOBUF_DIR${RESET}"
60+
cd "$CUR_DIR"
5461
else
5562
echo -e "${CYAN}✔ Protobuf 3.6.1 already installed at $PROTOBUF_DIR${RESET}"
5663
fi
@@ -60,8 +67,8 @@ export PATH="$PROTOBUF_DIR/bin:$PATH"
6067
export LD_LIBRARY_PATH="$PROTOBUF_DIR/lib:$LD_LIBRARY_PATH"
6168
export PKG_CONFIG_PATH="$PROTOBUF_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
6269
export PROTOC="$PROTOBUF_DIR/bin/protoc"
63-
64-
cd "$OLDPWD"
70+
export LDFLAGS="-L$PROTOBUF_DIR/lib $LDFLAGS"
71+
export CPPFLAGS="-I$PROTOBUF_DIR/include $CPPFLAGS"
6572

6673
# --------------------------
6774
# AdventureCoin source
@@ -139,7 +146,6 @@ export CXXFLAGS="-std=c++11"
139146
# --------------------------
140147
echo -e "${GREEN}>>> Applying macOS compatibility patches...${RESET}"
141148

142-
# Boost global placeholder patch
143149
BOOST_FILES=("src/init.cpp" "src/torcontrol.cpp" "src/validation.cpp" "src/validationinterface.cpp" "src/scheduler.cpp")
144150
for FILE in "${BOOST_FILES[@]}"; do
145151
if ! grep -q "BOOST_BIND_GLOBAL_PLACEHOLDERS" "$FILE"; then
@@ -150,7 +156,6 @@ for FILE in "${BOOST_FILES[@]}"; do
150156
fi
151157
done
152158

153-
# is_complete -> is_absolute fix
154159
PROTOCOL_CPP="rpc/protocol.cpp"
155160
if grep -q 'is_complete' "$PROTOCOL_CPP"; then
156161
echo -e "${GREEN}>>> Patching deprecated is_complete() in $PROTOCOL_CPP...${RESET}"
@@ -176,7 +181,7 @@ elif [[ "$BUILD_CHOICE" == "3" ]]; then
176181
./configure $CONFIGURE_ARGS --disable-wallet --with-gui=qt5
177182
fi
178183

179-
make -j"$(sysctl -n hw.ncpu)"
184+
make -j"$(sysctl -n hw.logicalcpu)"
180185

181186
mkdir -p "$COMPILED_DIR"
182187
[[ "$BUILD_CHOICE" =~ [12] ]] && cp src/adventurecoind src/adventurecoin-cli src/adventurecoin-tx "$COMPILED_DIR/" 2>/dev/null || true
@@ -219,7 +224,7 @@ if [[ "$MAKE_DMG" =~ ^[Yy]$ && -f "$COMPILED_DIR/adventurecoin-qt" ]]; then
219224
EOF
220225

221226
echo -e "${GREEN}>>> Running macdeployqt...${RESET}"
222-
macdeployqt "$APP_BUNDLE_DIR" || echo -e "${RED}✖ macdeployqt failed (ensure Qt is in PATH)${RESET}"
227+
macdeployqt "$APP_BUNDLE_DIR" || { echo -e "${RED}✖ macdeployqt failed. Ensure Qt is in PATH and compatible.${RESET}"; exit 1; }
223228

224229
echo -e "${GREEN}>>> Creating DMG...${RESET}"
225230
DMG_PATH="${COMPILED_DIR}/AdventureCoin-Wallet.dmg"

0 commit comments

Comments
 (0)