-
Notifications
You must be signed in to change notification settings - Fork 32
/
Makefile
95 lines (79 loc) · 5.41 KB
/
Makefile
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
VERSION = v1.7.7
PREFIX = /usr
APPPREFIX = $(PREFIX)/share/applications
ICONPREFIX = $(PREFIX)/share/icons/hicolor
GO = go
GO_LDFLAGS = -s -w -X main.Version=$(VERSION)
ROBLOX_ICONS = \
assets/icons/128/roblox-player.png assets/icons/128/roblox-studio.png \
assets/icons/16/roblox-player.png assets/icons/16/roblox-studio.png \
assets/icons/32/roblox-player.png assets/icons/32/roblox-studio.png \
assets/icons/48/roblox-player.png assets/icons/48/roblox-studio.png \
assets/icons/64/roblox-player.png assets/icons/64/roblox-studio.png
VINEGAR_ICON = splash/vinegar.png
all: vinegar
icons: $(ROBLOX_ICONS) $(VINEGAR_ICON)
install: install-vinegar install-desktop install-icons
vinegar:
$(GO) build $(GOFLAGS) -ldflags="$(GO_LDFLAGS)" ./cmd/vinegar
$(ROBLOX_ICONS): assets/roblox-player.svg assets/roblox-studio.svg
rm -rf assets/icons
mkdir assets/icons
convert -density 384 -background none $^ -resize 16x16 -set filename:f '%w/%t' 'assets/icons/%[filename:f].png'
convert -density 384 -background none $^ -resize 32x32 -set filename:f '%w/%t' 'assets/icons/%[filename:f].png'
convert -density 384 -background none $^ -resize 48x48 -set filename:f '%w/%t' 'assets/icons/%[filename:f].png'
convert -density 384 -background none $^ -resize 64x64 -set filename:f '%w/%t' 'assets/icons/%[filename:f].png'
convert -density 384 -background none $^ -resize 128x128 -set filename:f '%w/%t' 'assets/icons/%[filename:f].png'
$(VINEGAR_ICON): assets/vinegar.svg
# -fuzz 1% -trim +repage removes empty space, makes the image 44x64
convert -density 384 -background none icons/vinegar.svg -resize 64x64 -fuzz 1% -trim +repage splash/vinegar.png
install-vinegar: vinegar assets/org.vinegarhq.Vinegar.metainfo.xml
install -Dm755 vinegar $(DESTDIR)$(PREFIX)/bin/vinegar
install -Dm644 assets/org.vinegarhq.Vinegar.metainfo.xml -t $(DESTDIR)$(PREFIX)/share/metainfo
install-desktop:
install -Dm644 assets/desktop/vinegar.desktop $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.desktop
install -Dm644 assets/desktop/roblox-app.desktop $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.app.desktop
install -Dm644 assets/desktop/roblox-player.desktop $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.player.desktop
install -Dm644 assets/desktop/roblox-studio.desktop $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.studio.desktop
install-icons: icons
install -Dm644 assets/vinegar.svg $(DESTDIR)$(ICONPREFIX)/scalable/apps/org.vinegarhq.Vinegar.svg
install -Dm644 assets/icons/16/roblox-player.png $(DESTDIR)$(ICONPREFIX)/16x16/apps/org.vinegarhq.Vinegar.player.png
install -Dm644 assets/icons/16/roblox-studio.png $(DESTDIR)$(ICONPREFIX)/16x16/apps/org.vinegarhq.Vinegar.studio.png
install -Dm644 assets/icons/32/roblox-player.png $(DESTDIR)$(ICONPREFIX)/32x32/apps/org.vinegarhq.Vinegar.player.png
install -Dm644 assets/icons/32/roblox-studio.png $(DESTDIR)$(ICONPREFIX)/32x32/apps/org.vinegarhq.Vinegar.studio.png
install -Dm644 assets/icons/48/roblox-player.png $(DESTDIR)$(ICONPREFIX)/48x48/apps/org.vinegarhq.Vinegar.player.png
install -Dm644 assets/icons/48/roblox-studio.png $(DESTDIR)$(ICONPREFIX)/48x48/apps/org.vinegarhq.Vinegar.studio.png
install -Dm644 assets/icons/64/roblox-player.png $(DESTDIR)$(ICONPREFIX)/64x64/apps/org.vinegarhq.Vinegar.player.png
install -Dm644 assets/icons/64/roblox-studio.png $(DESTDIR)$(ICONPREFIX)/64x64/apps/org.vinegarhq.Vinegar.studio.png
install -Dm644 assets/icons/128/roblox-player.png $(DESTDIR)$(ICONPREFIX)/128x128/apps/org.vinegarhq.Vinegar.player.png
install -Dm644 assets/icons/128/roblox-studio.png $(DESTDIR)$(ICONPREFIX)/128x128/apps/org.vinegarhq.Vinegar.studio.png
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/vinegar
rm -f $(DESTDIR)$(PREFIX)/share/metainfo/org.vinegarhq.Vinegar.metainfo.xml
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.desktop
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.app.desktop
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.player.desktop
rm -f $(DESTDIR)$(APPPREFIX)/org.vinegarhq.Vinegar.studio.desktop
rm -f $(DESTDIR)$(ICONPREFIX)/scalable/apps/org.vinegarhq.Vinegar.svg
rm -f $(DESTDIR)$(ICONPREFIX)/16x16/apps/org.vinegarhq.Vinegar.player.png
rm -f $(DESTDIR)$(ICONPREFIX)/16x16/apps/org.vinegarhq.Vinegar.studio.png
rm -f $(DESTDIR)$(ICONPREFIX)/32x32/apps/org.vinegarhq.Vinegar.player.png
rm -f $(DESTDIR)$(ICONPREFIX)/32x32/apps/org.vinegarhq.Vinegar.studio.png
rm -f $(DESTDIR)$(ICONPREFIX)/48x48/apps/org.vinegarhq.Vinegar.player.png
rm -f $(DESTDIR)$(ICONPREFIX)/48x48/apps/org.vinegarhq.Vinegar.studio.png
rm -f $(DESTDIR)$(ICONPREFIX)/64x64/apps/org.vinegarhq.Vinegar.player.png
rm -f $(DESTDIR)$(ICONPREFIX)/64x64/apps/org.vinegarhq.Vinegar.studio.png
rm -f $(DESTDIR)$(ICONPREFIX)/128x128/apps/org.vinegarhq.Vinegar.player.png
rm -f $(DESTDIR)$(ICONPREFIX)/128x128/apps/org.vinegarhq.Vinegar.studio.png
mime:
xdg-mime default org.vinegarhq.Vinegar.player.desktop x-scheme-handler/roblox-player
xdg-mime default org.vinegarhq.Vinegar.player.desktop x-scheme-handler/roblox
xdg-mime default org.vinegarhq.Vinegar.studio.desktop x-scheme-handler/roblox-studio
xdg-mime default org.vinegarhq.Vinegar.studio.desktop x-scheme-handler/roblox-studio-auth
xdg-mime default org.vinegarhq.Vinegar.studio.desktop application/x-roblox-rbxl
xdg-mime default org.vinegarhq.Vinegar.studio.desktop application/x-roblox-rbxlx
tests:
$(GO) test $(GOFLAGS) ./...
clean:
rm -f vinegar
.PHONY: all install install-vinegar install-desktop install-icons uninstall icons mime tests clean