blob: b2a62306a4e18f216c5c6557665559042b4f6468 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/bin/bash
# Build psycopg2-binary wheel packages for Apple M1 (cpNNN-macosx_arm64)
#
# This script is designed to run on a local machine: it will clone the repos
# remotely and execute the `build_macos_arm64.sh` script remotely, then will
# download the built packages. A tag to build must be specified.
#
# In order to run the script, the `m1` host must be specified in
# `~/.ssh/config`; for instance:
#
# Host m1
# User m1
# HostName 1.2.3.4
set -euo pipefail
# set -x
tag=${1:-}
if [[ ! "${tag}" ]]; then
echo "Usage: $0 TAG" >&2
exit 2
fi
rdir=psycobuild
# Clone the repos
ssh m1 rm -rf "${rdir}"
ssh m1 git clone https://github.com/psycopg/psycopg2.git --branch ${tag} "${rdir}"
# Allow sudoing without password, to allow brew to install
ssh -t m1 bash -c \
'test -f /etc/sudoers.d/m1 || echo "m1 ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/m1'
# Build the wheel packages
ssh m1 "${rdir}/scripts/build/build_macos_arm64.sh"
# Transfer the packages locally
scp -r "m1:${rdir}/wheelhouse" .
|