Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
251 lines (215 loc) · 5.93 KB
/
Copy pathMakefile
File metadata and controls
251 lines (215 loc) · 5.93 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
.DEFAULT_GOAL := all
SHELL := /bin/bash
SCRIPTS := $(CURDIR)/scripts
.PHONY: clean test all
clean:
rm -rf build/
rm -rf dist/
rm -rf .eggs/
rm -rf .logs/
rm -rf .cache/
rm -rf .tox/
rm -rf htmlcov/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
rm -f .coverage
find . -name '*.egg-info' -exec rm -rf {} +
find . -name '*.egg' -exec rm -rf {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
test:
@case `uname` in \
Darwin) arch -x86_64 python3 -m tox -vv;; \
*) xvfb-run --auto-servernum python3 -m tox -vv;; \
esac
test-integration:
@case `uname` in \
Darwin) arch -x86_64 python3 -m tox -vv -e integration ;; \
*) xvfb-run --auto-servernum python3 -m tox -vv -e integration ;; \
esac
pngs:
mkdir -p build/frames
for i in images/gridsync*.svg; do \
convert -scale 1024x1024 \
-gravity center \
-extent 1024x1024 \
-background transparent \
$$i build/$$(basename -s .svg $$i).png; \
done
for i in images/frames/frame*.svg; do \
convert -scale 1024x1024 \
-gravity center \
-extent 1024x1024 \
-background transparent \
$$i build/frames/$$(basename -s .svg $$i).png; \
done
for i in images/frames/onion-frame*.svg; do \
convert -scale 1024x1024 \
-gravity center \
-extent 1024x1024 \
-background transparent \
$$i build/frames/$$(basename -s .svg $$i).png; \
done
ico: pngs
mkdir -p build/ico
for i in 16 32 48 256; do \
convert \
-scale $$i\x$$i \
-gravity center \
-extent $$i\x$$i \
-background transparent \
images/gridsync.svg \
build/ico/gridsync-$$i\-$$i.png; \
done
# from 'icoutils' debian package
icotool --create \
build/ico/gridsync-16-16.png \
build/ico/gridsync-32-32.png \
build/ico/gridsync-48-48.png \
build/ico/gridsync-256-256.png \
-o images/gridsync.ico
icns: pngs
#png2icns images/gridsync.icns build/icon*x*.png
mkdir -p build/gridsync.iconset
# OS X only
sips \
-s format png \
--resampleWidth 1024 \
build/gridsync.png \
--out build/gridsync.iconset/icon_512x512@2x.png
sips \
-s format png \
--resampleWidth 512 \
build/gridsync.png \
--out build/gridsync.iconset/icon_512x512.png
cp build/gridsync.iconset/icon_512x512.png \
build/gridsync.iconset/icon_256x256@2x.png
sips \
-s format png \
--resampleWidth 256 \
build/gridsync.png \
--out build/gridsync.iconset/icon_256x256.png
cp build/gridsync.iconset/icon_256x256.png \
build/gridsync.iconset/icon_128x128@2x.png
sips \
-s format png \
--resampleWidth 128 \
build/gridsync.png \
--out build/gridsync.iconset/icon_128x128.png
sips \
-s format png \
--resampleWidth 64 \
build/gridsync.png \
--out build/gridsync.iconset/icon_32x32@2x.png
sips \
-s format png \
--resampleWidth 32 \
build/gridsync.png \
--out build/gridsync.iconset/icon_32x32.png
cp build/gridsync.iconset/icon_32x32.png \
build/gridsync.iconset/icon_16x16@2x.png
sips \
-s format png \
--resampleWidth 16 \
build/gridsync.png \
--out build/gridsync.iconset/icon_16x16.png
iconutil -c icns build/gridsync.iconset
gif: pngs
convert \
-resize 256x256 \
-dispose 2 \
-delay 8 \
-loop 0 \
build/frames/frame*.png build/gridsync.gif
convert \
-resize 256x256 \
-dispose 2 \
-delay 8 \
-loop 0 \
build/frames/onion-frame*.png build/onion-sync.gif
convert \
-resize 256x256 \
-dispose 2 \
-delay 7 \
-loop 0 \
images/frames/waiting-*.png build/waiting.gif
convert \
-dispose 2 \
-delay 4 \
-loop 0 \
images/frames/sync-*.png build/sync.gif
install:
python3 -m pip install --upgrade .
pyinstaller-separate:
python3 -m tox -vv -e pyinstaller-tahoe
python3 -m tox -vv -e pyinstaller-magic-folder
python3 -m tox -vv -e pyinstaller-gridsync
pyinstaller-merged:
python3 -m tox -vv -e pyinstaller
pyinstaller:
$(MAKE) pyinstaller-merged
zip:
python3 scripts/update_permissions.py dist
python3 scripts/update_timestamps.py dist
python3 scripts/make_zip.py
test-determinism:
python3 scripts/test_determinism.py
dmg:
python3 -m virtualenv --clear build/venv-dmg
source build/venv-dmg/bin/activate && \
python3 -m pip install -r requirements/dmgbuild.txt && \
python3 scripts/call_dmgbuild.py
check-outdated:
python3 scripts/check_outdated.py
vagrant-build-linux:
vagrant up centos-7
vagrant provision --provision-with devtools,test,build centos-7
vagrant-build-macos:
vagrant up --provision-with devtools,test,build macos-11
vagrant-build-windows:
vagrant up --provision-with devtools,test,build windows-10
container-image:
podman build --timestamp 1651072070 \
--tag gridsync-builder-qt6 \
--file Containerfile
push-container-image:
podman login docker.io && \
podman push --digestfile misc/gridsync-builder-qt6.digest \
gridsync-builder-qt6 \
docker.io/gridsync/gridsync-builder-qt6
in-container:
$${CONTAINER_RUNTIME:-podman} run --rm \
--mount type=bind,src=$$(pwd),target=/gridsync \
-w /gridsync --env QT_API="$${QT_API:-pyqt6}" \
--env GRIDSYNC_FEATURES_ZKAPAUTHORIZER="$${GRIDSYNC_FEATURES_ZKAPAUTHORIZER}" \
--env GRIDSYNC_REQUIREMENTS_DIR="$${GRIDSYNC_REQUIREMENTS_DIR:-requirements}" \
docker.io/gridsync/gridsync-builder-qt6@$$(cat misc/gridsync-builder-qt6.digest)
# https://developer.apple.com/library/archive/technotes/tn2206/_index.html
codesign-app:
python3 scripts/codesign.py app
codesign-dmg:
python3 scripts/codesign.py dmg
notarize-app:
python3 scripts/notarize.py app
notarize-dmg:
python3 scripts/notarize.py dmg
dist-macos:
$(MAKE) codesign-app notarize-app dmg codesign-dmg notarize-dmg
appimage:
python3 scripts/make_appimage.py
all:
@case `uname` in \
Darwin) arch -x86_64 $(MAKE) pyinstaller zip dmg ;; \
*) $(MAKE) pyinstaller zip appimage ;; \
esac
python3 scripts/sha256sum.py dist/*.*
gpg-sign:
python3 scripts/gpg.py --sign
gpg-verify:
python3 scripts/gpg.py --verify
pypi-release:
SOURCE_DATE_EPOCH=$$(git log -1 --pretty=%ct) python -m build
twine upload --verbose dist/gridsync-*.*
uninstall:
python3 -m pip uninstall -y gridsync