Skip to content

Commit

Permalink
fix macos builds
Browse files Browse the repository at this point in the history
 * added --location flag to curl so it follows 302 redirects (otherwise it results in an empty file and you get gpg errors)

maltfield@host buskill-app % build/mac/buildDmg.sh
...
+ tmpDir=/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2
+ pushd /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2
/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2 ~/sandbox/buskill-app
+ file_url=https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl
+ signature_url=https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl.asc
+ curl --remote-name https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
++ ls -1
++ head -n1
+ filename=python_gnupg-0.5.2-py2.py3-none-any.whl
+ curl --remote-name https://github.com/vsajip/python-gnupg/releases/download/0.5.2/python_gnupg-0.5.2-py2.py3-none-any.whl.asc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
+ mkdir gnupg
+ chmod 0700 gnupg
+ popd
~/sandbox/buskill-app
+ gpg --homedir /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg --import build/deps/python-gnupg.asc
gpg: keybox '/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/pubring.kbx' created
gpg: /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/trustdb.gpg: trustdb created
gpg: key 9147B477339A9B86: public key "Vinay Sajip (CODE SIGNING KEY) <vinay_sajip@yahoo.co.uk>" imported
gpg: Total number processed: 1
gpg:               imported: 1
+ gpgv --homedir /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg --keyring /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/pubring.kbx /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/python_gnupg-0.5.2-py2.py3-none-any.whl.asc /var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/python_gnupg-0.5.2-py2.py3-none-any.whl
gpgv: can't allocate lock for '/var/folders/kx/2fp3kfgj4dj7rx9s5mlb52640000gp/T/tmp.qc6P8CF2/gnupg/pubring.kbx'
gpgv: verify signatures failed: Unknown system error
+ [[ 2 -ne 0 ]]
+ echo 'ERROR: Invalid PGP signature!'
ERROR: Invalid PGP signature!
+ exit 1
maltfield@host buskill-app %

...

maltfield@host tmp.qc6P8CF2 % du -sh *
 12K	gnupg
  0B	python_gnupg-0.5.2-py2.py3-none-any.whl
  0B	python_gnupg-0.5.2-py2.py3-none-any.whl.asc
maltfield@host tmp.qc6P8CF2 %

 * also switched source of libusb1 to GitHub
  • Loading branch information
maltfield committed Mar 7, 2024
1 parent e4405a0 commit dd65a7b
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions build/mac/buildDmg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ signature_url='https://github.com/vsajip/python-gnupg/releases/download/0.5.2/py
#wget "${signature_url}"
# switching from wget to curl to avoid "dyld Library not loaded" brew issues
# * https://github.com/BusKill/buskill-app/issues/70
curl --remote-name "${file_url}"
curl --location --remote-name "${file_url}"
filename="`ls -1 | head -n1`"
curl --remote-name "${signature_url}"
curl --location --remote-name "${signature_url}"

mkdir gnupg
chmod 0700 gnupg
Expand All @@ -226,12 +226,20 @@ rm -rf "${tmpDir}"
# * https://github.com/BusKill/buskill-app/issues/17
tmpDir="`mktemp -d`" || exit 1
pushd "${tmpDir}"
${PIP_PATH} download libusb1
filename="`ls -1 | head -n1`"
signature_url=`curl -s https://pypi.org/simple/libusb1/ | grep -oE "https://.*${filename}#" | sed 's/#/.asc/'`

# changing to use the files on GitHub, since the sigs are no longer available
# from PyPI
# * https://github.com/BusKill/buskill-app/issues/78
# TODO: update this to query the GitHub API and grab the latest release
#${PIP_PATH} download libusb1
file_url='https://github.com/vpelletier/python-libusb1/releases/download/3.1.0/libusb1-3.1.0-py3-none-any.whl'
signature_url='https://github.com/vpelletier/python-libusb1/releases/download/3.1.0/libusb1-3.1.0-py3-none-any.whl.asc'

#wget "${signature_url}"
# switching from wget to curl to avoid "dyld Library not loaded" brew issues
# * https://github.com/BusKill/buskill-app/issues/70
curl --location --remote-name "${file_url}"
filename="`ls -1 | head -n1`"
curl --remote-name "${signature_url}"

mkdir gnupg
Expand Down

0 comments on commit dd65a7b

Please sign in to comment.