-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
79 lines (58 loc) · 1.63 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
NULL=
ID=com.mojang.Minecraft
BUNDLE=minecraft.flatpak
RUNTIME=org.gnome.Platform
SDK=org.gnome.Sdk
VERSION=3.20
SDK_REPO=gnome
SDK_LOCATION=https://sdk.gnome.org/repo/
SDK_KEY=gnome-sdk.gpg
SDK_KEY_URL=https://sdk.gnome.org/keys/gnome-sdk.gpg
USER=--user
MANIFEST=$(ID).json
BUILD_DIR=tmp
REPO=repo
INSTALL_REPO=minecraft-repo
BUILD_DEPS= \
$(MANIFEST) \
jre-Makefile \
minecraft-Makefile \
$(NULL)
define GITIGNORE_CONTENT :=
.gitignore
.flatpak-builder
$(BUNDLE)
$(SDK_KEY)
$(BUILD_DIR)
$(REPO)
endef
all: .gitignore $(BUNDLE)
.gitignore:
$(file > $(@),$(GITIGNORE_CONTENT))
$(SDK_KEY):
wget $(SDK_KEY_URL)
install-sdk-repo: $(SDK_KEY)
flatpak $(USER) remote-add --gpg-import=$(SDK_KEY) $(SDK_REPO) $(SDK_LOCATION)
# Depends on 'install-sdk-repo'
install-runtime:
flatpak $(USER) install $(SDK_REPO) $(RUNTIME) $(VERSION) || flatpak $(USER) update $(RUNTIME) $(VERSION)
# Depends on 'install-sdk-repo'
install-sdk:
flatpak $(USER) install $(SDK_REPO) $(SDK) $(VERSION) || flatpak $(USER) update $(SDK) $(VERSION)
build: $(BUILD_DEPS) install-runtime install-sdk
flatpak-builder --force-clean --repo=$(REPO) $(BUILD_DIR) $(MANIFEST)
$(BUNDLE): build
flatpak build-bundle $(REPO) $(BUNDLE) $(ID)
prepare-install:
flatpak $(USER) remote-add --no-gpg-verify $(INSTALL_REPO) $(REPO)
install:
flatpak $(USER) install --bundle $(BUNDLE)
uninstall:
flatpak $(USER) uninstall $(ID)
run:
flatpak run $(ID)
clean-build:
rm -Rf $(BUILD_DIR)
clean:
rm -Rf .gitignore $(BUNDLE) $(BUILD_DIR) $(REPO) $(SDK_KEY)
.PHONY: all install-sdk-repo install-runtime install-sdk build prepare-install install uninstall run clean-build clean .gitignore