Skip to content

Commit d0420a6

Browse files
authored
Fix macOS CI build issues (libtinfo + fcommon) (#1050)
* Add workaround Added workaround for missing libtinfo.so.5 on macOS cross-toolchain. * Add CMAKE_C_FLAGS and CMAKE_CXX_FLAGS for build Veil now builds in Github Actions, and can be launched in Terminal with `./veil-qt` or `./veild` and commands given with `./veil-cli ...`
1 parent 7399221 commit d0420a6

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/build-factory.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,37 +132,56 @@ jobs:
132132
with:
133133
name: ${{ env.SOURCE_ARTIFACT }}
134134
path: ${{ env.SOURCE_ARTIFACT }}
135+
135136
- name: Extract Archives
136137
run: |
137138
tar -xzf depends.tar.gz
138139
tar -xzf veil-*.tar.gz --strip-components=1
139140
working-directory: ${{ env.SOURCE_ARTIFACT }}
141+
140142
- name: Install Required Packages
141143
run: |
142144
sudo apt update
143145
sudo apt install -y python3-setuptools libcap-dev zlib1g-dev cmake
144146
sudo -H pip install setuptools
147+
148+
- name: Work around missing libtinfo.so.5 for macOS cross-toolchain
149+
run: |
150+
# Try to install libtinfo5 if it's in the repo
151+
if apt-cache show libtinfo5 >/dev/null 2>&1; then
152+
sudo apt-get install -y libtinfo5
153+
fi
154+
# If still no libtinfo.so.5, symlink it to libtinfo.so.6
155+
if [ ! -f /usr/lib/x86_64-linux-gnu/libtinfo.so.5 ] && [ -f /usr/lib/x86_64-linux-gnu/libtinfo.so.6 ]; then
156+
echo "Creating libtinfo.so.5 -> libtinfo.so.6 symlink..."
157+
sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
158+
fi
159+
145160
- name: Get macOS SDK
146161
run: |
147162
mkdir -p depends/sdk-sources
148163
mkdir -p depends/SDKs
149164
curl https://bitcoincore.org/depends-sources/sdks/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz -o depends/sdk-sources/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz
150165
tar -C depends/SDKs -xf depends/sdk-sources/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers.tar.gz
151166
working-directory: ${{ env.SOURCE_ARTIFACT }}
167+
152168
- name: Build Dependencies
153169
run: make -C depends HOST=x86_64-apple-darwin18 -j$(nproc)
154170
working-directory: ${{ env.SOURCE_ARTIFACT }}
171+
155172
- name: Build Veil
156173
run: |
157174
./configure --enable-c++17 --disable-jni --prefix=$(realpath depends/x86_64-apple-darwin18)
158175
make -j$(nproc)
159176
working-directory: ${{ env.SOURCE_ARTIFACT }}
177+
160178
- name: Prepare Files for Artifact
161179
run: |
162180
mkdir -p $ARTIFACT_DIR
163181
# strip fails with "Unable to recognise the format of the input file"
164182
#strip $SOURCE_ARTIFACT/src/{veil-cli,veil-tx,veild,qt/veil-qt}
165183
mv $SOURCE_ARTIFACT/src/{veil-cli,veil-tx,veild,qt/veil-qt} $ARTIFACT_DIR
184+
166185
- name: Upload Artifact
167186
uses: actions/upload-artifact@v4
168187
with:

depends/packages/native_cdrkit.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ define $(package)_preprocess_cmds
1010
endef
1111

1212
define $(package)_config_cmds
13-
cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix)
13+
cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix) \
14+
-DCMAKE_C_FLAGS="-fcommon" \
15+
-DCMAKE_CXX_FLAGS="-fcommon"
1416
endef
1517

1618
define $(package)_build_cmds

0 commit comments

Comments
 (0)