-
Notifications
You must be signed in to change notification settings - Fork 9
Update action macos #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c960d56
c9efbbd
e36da3e
1c2ed21
4f7a658
b01f30e
09ecdba
6f721ad
7dae367
968fd70
82052e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,51 +1,39 @@ | ||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||
| set -ev | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if [[ -n $GITHUB_ACTION ]]; then | ||||||||||||||||||||
| PYTHON_VERSION=3.7.9 | ||||||||||||||||||||
| PYFTP=https://www.python.org/ftp/python/$PYTHON_VERSION | ||||||||||||||||||||
| PYPKG_NAME=python-$PYTHON_VERSION-macosx10.9.pkg | ||||||||||||||||||||
| PY_SHA256=bf54a14eef23467991e8c7a88c7307762e484c024a94ec1ee292ac1db3d41fc9 | ||||||||||||||||||||
| echo "$PY_SHA256 $PYPKG_NAME" > $PYPKG_NAME.sha256 | ||||||||||||||||||||
| curl -O $PYFTP/$PYPKG_NAME | ||||||||||||||||||||
| shasum -a256 -s -c $PYPKG_NAME.sha256 | ||||||||||||||||||||
| sudo installer -pkg $PYPKG_NAME -target / | ||||||||||||||||||||
| rm $PYPKG_NAME $PYPKG_NAME.sha256 | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| PYTHON_VERSION=$(python3 --version) | ||||||||||||||||||||
| echo "Using system Python: $PYTHON_VERSION" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| brew install gmp | ||||||||||||||||||||
| brew install gettext libtool automake pkg-config | ||||||||||||||||||||
|
|
||||||||||||||||||||
| export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig" | ||||||||||||||||||||
| export CFLAGS="-I/opt/homebrew/include -I/usr/local/include $CFLAGS" | ||||||||||||||||||||
| export LDFLAGS="-L/opt/homebrew/lib -L/usr/local/lib $LDFLAGS" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| LIBUSB_VER=1.0.24 | ||||||||||||||||||||
| LIBUSB_URI=https://github.com/libusb/libusb/releases/download | ||||||||||||||||||||
| LIBUSB_SHA=7efd2685f7b327326dcfb85cee426d9b871fd70e22caa15bb68d595ce2a2b12a | ||||||||||||||||||||
| LIBUSB_FILE=libusb-${LIBUSB_VER}.tar.bz2 | ||||||||||||||||||||
| echo "${LIBUSB_SHA} ${LIBUSB_FILE}" > ${LIBUSB_FILE}.sha256 | ||||||||||||||||||||
| curl -O -L ${LIBUSB_URI}/v${LIBUSB_VER}/${LIBUSB_FILE} | ||||||||||||||||||||
| tar -xzvf ${LIBUSB_FILE} | ||||||||||||||||||||
| tar -xjf ${LIBUSB_FILE} | ||||||||||||||||||||
| shasum -a256 -s -c ${LIBUSB_FILE}.sha256 | ||||||||||||||||||||
|
Comment on lines
18
to
21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: git ls-files | grep -E "install-osx|dash" | head -20Repository: firoorg/electrum-firo Length of output: 805 🏁 Script executed: cat -n contrib/dash/actions/install-osx.sh | head -30Repository: firoorg/electrum-firo Length of output: 1238 Verify libusb checksum before extracting. The current code extracts the archive (line 15) before verifying its SHA-256 checksum (line 16), exposing the system to potential extraction of malicious or corrupted files. Reorder to verify the checksum immediately after download, before extraction. Proposed fixcurl -O -L ${LIBUSB_URI}/v${LIBUSB_VER}/${LIBUSB_FILE}
+shasum -a256 -s -c ${LIBUSB_FILE}.sha256
-tar -xjf ${LIBUSB_FILE}
-shasum -a256 -s -c ${LIBUSB_FILE}.sha256
+tar -xjf ${LIBUSB_FILE}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| pushd libusb-${LIBUSB_VER} | ||||||||||||||||||||
| ./configure --disable-dependency-tracking --prefix=/opt/libusb | ||||||||||||||||||||
| sudo env MACOSX_DEPLOYMENT_TARGET=10.13 make install | ||||||||||||||||||||
| sudo env MACOSX_DEPLOYMENT_TARGET=11.0 make install | ||||||||||||||||||||
| popd | ||||||||||||||||||||
| sudo rm -rf libusb-${LIBUSB_VER}* | ||||||||||||||||||||
| cp /opt/libusb/lib/libusb-1.*.dylib . | ||||||||||||||||||||
| cp /opt/libusb/lib/libusb-1.*.dylib . || true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| LSECP256K1_PATH=https://github.com/zebra-lucky/secp256k1/ | ||||||||||||||||||||
| LSECP256K1_PATH=${LSECP256K1_PATH}releases/download/210521 | ||||||||||||||||||||
| LSECP256K1_FILE=libsecp256k1-210521-osx.tgz | ||||||||||||||||||||
| LIB_SHA256=51c861bfb894ec520cc1ee0225fae00447aa86096782a1acd1fc6e338a576ea7 | ||||||||||||||||||||
| echo "$LIB_SHA256 $LSECP256K1_FILE" > $LSECP256K1_FILE.sha256 | ||||||||||||||||||||
| curl -O -L ${LSECP256K1_PATH}/${LSECP256K1_FILE} | ||||||||||||||||||||
| shasum -a256 -s -c ${LSECP256K1_FILE}.sha256 | ||||||||||||||||||||
| tar -xzf ${LSECP256K1_FILE} | ||||||||||||||||||||
| rm -f libsecp256k1.0.dylib | ||||||||||||||||||||
| cp libsecp256k1/libsecp256k1.0.dylib . | ||||||||||||||||||||
| rm -rf libsecp256k1/ ${LSECP256K1_FILE} ${LSECP256K1_FILE}.sha256 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| brew install gettext libtool automake pkg-config | ||||||||||||||||||||
| brew install secp256k1 | ||||||||||||||||||||
| cp /opt/homebrew/lib/libsecp256k1*.dylib . || true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| if [[ -n $GITHUB_REF ]]; then | ||||||||||||||||||||
| echo "Building ZBar dylib..." | ||||||||||||||||||||
| rm -f libzbar.0.dylib | ||||||||||||||||||||
| export MACOSX_DEPLOYMENT_TARGET=10.13 | ||||||||||||||||||||
| export MACOSX_DEPLOYMENT_TARGET=11.0 | ||||||||||||||||||||
| export LDFLAGS="$LDFLAGS -liconv" | ||||||||||||||||||||
| ./contrib/make_zbar.sh | ||||||||||||||||||||
| rm -rf contrib/zbar/ | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,21 +1,13 @@ | ||||||
| #!/bin/bash | ||||||
| set -ev | ||||||
|
|
||||||
| export MACOSX_DEPLOYMENT_TARGET=10.13 | ||||||
| export MACOSX_DEPLOYMENT_TARGET=11.0 | ||||||
|
|
||||||
| export PY37BINDIR=/Library/Frameworks/Python.framework/Versions/3.7/bin/ | ||||||
| export PATH=$PATH:$PY37BINDIR | ||||||
| echo osx build version is $DASH_ELECTRUM_VERSION | ||||||
|
|
||||||
|
|
||||||
| if [[ -n $GITHUB_REF ]]; then | ||||||
| PIP_CMD="sudo python3 -m pip" | ||||||
| else | ||||||
| python3 -m virtualenv env | ||||||
| source env/bin/activate | ||||||
| PIP_CMD="pip" | ||||||
| fi | ||||||
|
|
||||||
| python3 -m venv env | ||||||
| source env/bin/activate | ||||||
| PIP_CMD="pip" | ||||||
|
|
||||||
| $PIP_CMD install --no-dependencies --no-warn-script-location -U \ | ||||||
| -r contrib/deterministic-build/requirements.txt | ||||||
|
|
@@ -24,11 +16,10 @@ $PIP_CMD install --no-dependencies --no-warn-script-location -U \ | |||||
| $PIP_CMD install --no-dependencies --no-warn-script-location -U \ | ||||||
| -r contrib/deterministic-build/requirements-binaries-mac.txt | ||||||
| $PIP_CMD install --no-dependencies --no-warn-script-location -U x11_hash>=1.4 | ||||||
|
|
||||||
| $PIP_CMD install --no-dependencies --no-warn-script-location -U \ | ||||||
| -r contrib/deterministic-build/requirements-build-mac.txt | ||||||
|
|
||||||
| export PATH="/usr/local/opt/gettext/bin:$PATH" | ||||||
| export PATH="/opt/homebrew/bin:/usr/local/opt/gettext/bin:$PATH" | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's examine the file to understand the context
cat -n contrib/dash/actions/script-osx.sh | head -30Repository: firoorg/electrum-firo Length of output: 1285 🏁 Script executed: # Let's also check if there are any other references to this PATH or gettext in the repo
rg "gettext" --type sh -B 2 -A 2Repository: firoorg/electrum-firo Length of output: 1409 Add arm64 gettext bin to PATH. On macOS with arm64 (Apple Silicon), Homebrew installs packages under 🛠️ Proposed fix-export PATH="/opt/homebrew/bin:/usr/local/opt/gettext/bin:$PATH"
+export PATH="/opt/homebrew/bin:/opt/homebrew/opt/gettext/bin:/usr/local/opt/gettext/bin:$PATH"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| ./contrib/make_locale | ||||||
| find . -name '*.po' -delete | ||||||
| find . -name '*.pot' -delete | ||||||
|
|
@@ -44,4 +35,4 @@ pyinstaller --clean \ | |||||
|
|
||||||
| sudo hdiutil create -fs HFS+ -volname "Firo Electrum" \ | ||||||
| -srcfolder dist/Firo\ Electrum.app \ | ||||||
| dist/Firo-Electrum-$DASH_ELECTRUM_VERSION-macosx.dmg | ||||||
| dist/Firo-Electrum-$DASH_ELECTRUM_VERSION | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the version echo to avoid word-splitting.
Shellcheck SC2086 applies here.
🔧 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents