Makefile RawHistoryFolder
1.PHONY: install test test-installer lint mocks demo remote-acceptance
2
3install:
4 go install .
5 @bin="$$(go env GOBIN)"; \
6 if [ -z "$$bin" ]; then bin="$$(go env GOPATH)/bin"; fi; \
7 mkdir -p "$$bin"; \
8 install -m 0755 scripts/vev-bar-top-right scripts/vev-bar-bottom-right "$$bin"
9
10test:
11 go test ./... -race
12
13test-installer:
14 sh scripts/install_platform_test.sh
15
16lint:
17 @test -z "$$(goimports -l .)"
18 go vet ./...
19
20mocks:
21 @version="$$(mockery version 2>/dev/null || true)"; \
22 if [ "$$version" != "v3.7.1" ]; then \
23 echo "mockery v3.7.1 required; install with: go install github.com/vektra/mockery/v3@v3.7.1" >&2; \
24 exit 1; \
25 fi
26 mockery
27
28remote-acceptance:
29 scripts/remote-picker-harness/run.sh
30
31demo:
32 docker build -f scripts/demo/Dockerfile -t vev-demo .
33 ./scripts/demo/run.sh demo.tape
34 # vhs cannot emit a transparent margin, so cut the window out after the
35 # fact: everything outside the rounded window rect becomes GIF
36 # transparency, plus a 2px edge stroked along the window. The geometry
37 # mirrors demo.tape (1200x750 canvas, margin 20, border radius 10); keep
38 # them in sync. ffmpeg streams the clip frame by frame, so peak memory
39 # stays flat; the previous imagemagick -coalesce pipeline needed the whole
40 # ~22GiB uncompressed clip at once and either crawled for an hour on its
41 # disk cache or got OOM-killed — do not go back to it.
42 docker run --rm --entrypoint magick -v "$(CURDIR)/scripts/demo/out:/out" vev-demo \
43 -size 1200x750 xc:none -fill none -stroke "#30363D" -strokewidth 2 \
44 -draw "roundrectangle 21,21 1178,728 9,9" /out/border.png
45 docker run --rm --entrypoint magick -v "$(CURDIR)/scripts/demo/out:/out" vev-demo \
46 -size 1200x750 xc:black -fill white \
47 -draw "roundrectangle 20,20 1179,729 10,10" /out/mask.png
48 # alphamerge applies the mask after the border overlay so the mask clips
49 # the stroke's antialiased overflow, which a GIF's 1-bit alpha cannot
50 # represent; paletteuse's alpha_threshold folds the rest into that 1-bit
51 # alpha (palettegen reserves the transparent slot).
52 docker run --rm --entrypoint ffmpeg -v "$(CURDIR)/scripts/demo/out:/out" vev-demo \
53 -y -v error -i /out/demo.gif -i /out/border.png -i /out/mask.png \
54 -filter_complex "[0:v][1:v]overlay=0:0[bordered];[2:v]format=gray[m];[bordered][m]alphamerge,split[a][b];[a]palettegen=reserve_transparent=1[p];[b][p]paletteuse=alpha_threshold=128" \
55 /out/demo-masked.gif
56 # Keep the final GIF lossless: the streaming FFmpeg pass has already
57 # bounded memory, and preserving terminal chrome avoids color banding.
58 docker run --rm --entrypoint gifsicle -v "$(CURDIR)/scripts/demo/out:/out" vev-demo --no-conserve-memory -O3 -o /out/demo.gif /out/demo-masked.gif
59 # Temp files are owned by the container's subuid, so remove them from
60 # inside a container rather than the host.
61 docker run --rm --entrypoint sh -v "$(CURDIR)/scripts/demo/out:/out" vev-demo -c 'rm /out/demo-masked.gif /out/mask.png /out/border.png'
62 mkdir -p docs/assets
63 cp scripts/demo/out/demo.gif docs/assets/demo.gif