Skip to content

Commit 36ea08c

Browse files
probuf patch for macos
1 parent 049e404 commit 36ea08c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ jobs:
6060
- name: Run macOS Build
6161
if: inputs.os_target == 'macos'
6262
run: |
63+
# Set PATH and env manually to match the shell script
64+
echo "Setting environment vars"
65+
echo 'PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"' >> $GITHUB_ENV
66+
echo 'PROTOBUF_DIR=$HOME/local/protobuf-3.6.1' >> $GITHUB_ENV
67+
echo 'PKG_CONFIG_PATH=$HOME/local/protobuf-3.6.1/lib/pkgconfig:$PKG_CONFIG_PATH' >> $GITHUB_ENV
68+
echo 'LDFLAGS=-L$HOME/local/protobuf-3.6.1/lib $LDFLAGS' >> $GITHUB_ENV
69+
echo 'CPPFLAGS=-I$HOME/local/protobuf-3.6.1/include $CPPFLAGS' >> $GITHUB_ENV
70+
echo 'LD_LIBRARY_PATH=$HOME/local/protobuf-3.6.1/lib:$LD_LIBRARY_PATH' >> $GITHUB_ENV
71+
echo 'PROTOC=$HOME/local/protobuf-3.6.1/bin/protoc' >> $GITHUB_ENV
72+
6373
echo -e "2\ny\ny" | ./build_adventurecoin_mac.sh
6474
6575
- name: Upload to GitHub Release

build_adventurecoin_mac.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,23 @@ echo -e "${CYAN}============================="
1414
echo -e " AdventureCoin macOS Builder"
1515
echo -e "=============================${RESET}"
1616

17+
# --------------------------
1718
# 1. Build type
19+
# --------------------------
1820
echo -e "\n${GREEN}Select build type:${RESET}"
1921
echo "1) Daemon only"
2022
echo "2) Daemon + Qt Wallet (full)"
2123
echo "3) Qt Wallet only"
2224
read -rp "Enter choice [1-3]: " BUILD_CHOICE
2325

26+
# --------------------------
2427
# 2. Strip?
28+
# --------------------------
2529
read -rp $'\nDo you want to strip the binaries after build? (y/n): ' STRIP_BIN
2630

31+
# --------------------------
2732
# 3. Create .app + .dmg?
33+
# --------------------------
2834
read -rp $'\nDo you want to create a .app and DMG for Qt Wallet? (y/n): ' MAKE_DMG
2935

3036
# --------------------------
@@ -62,7 +68,30 @@ else
6268
echo -e "${CYAN}✔ Protobuf 3.6.1 already installed at $PROTOBUF_DIR${RESET}"
6369
fi
6470

71+
# --------------------------
72+
# Fix missing protobuf.pc if needed
73+
# --------------------------
74+
if [ ! -f "$PROTOBUF_DIR/lib/pkgconfig/protobuf.pc" ]; then
75+
echo -e "${GREEN}>>> Creating missing protobuf.pc...${RESET}"
76+
mkdir -p "$PROTOBUF_DIR/lib/pkgconfig"
77+
cat > "$PROTOBUF_DIR/lib/pkgconfig/protobuf.pc" <<EOF
78+
prefix=$PROTOBUF_DIR
79+
exec_prefix=\${prefix}
80+
libdir=\${exec_prefix}/lib
81+
includedir=\${prefix}/include
82+
83+
Name: Protocol Buffers
84+
Description: Google's Data Interchange Format
85+
Version: 3.6.1
86+
Libs: -L\${libdir} -lprotobuf
87+
Cflags: -I\${includedir}
88+
EOF
89+
echo -e "${CYAN}✔ Created protobuf.pc at $PROTOBUF_DIR/lib/pkgconfig${RESET}"
90+
fi
91+
92+
# --------------------------
6593
# Set protobuf paths
94+
# --------------------------
6695
export PATH="$PROTOBUF_DIR/bin:$PATH"
6796
export LD_LIBRARY_PATH="$PROTOBUF_DIR/lib:$LD_LIBRARY_PATH"
6897
export PKG_CONFIG_PATH="$PROTOBUF_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"

0 commit comments

Comments
 (0)