-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (103 loc) · 3.12 KB
/
Makefile
File metadata and controls
120 lines (103 loc) · 3.12 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
# Directories
FLATPAK_DIR := .flatpak
BUILD_DIR := build
REPO_DIR := $(FLATPAK_DIR)/repo
STATE_DIR := $(FLATPAK_DIR)/flatpak-builder
BUNDLE_DIR := $(FLATPAK_DIR)/finalized-repo
# Application info
APP_ID := io.github.ppvan.tarug
MANIFEST := pkgs/flatpak/$(APP_ID).yml
SDK := org.gnome.Sdk
PLATFORM := org.gnome.Platform
VERSION := 47
# Common builder flags
BUILDER_FLAGS := --ccache \
--force-clean \
--disable-updates \
--state-dir=$(STATE_DIR) \
--stop-at=tarug
# Run flatpak app without install, a lot of hack since flatpak not realy support this (wtf?)
# Reference: https://github.com/flatpak/flatpak/issues/408
RUNNER_FLAGS := --with-appdir \
--allow=devel \
--env=AT_SPI_BUS_ADDRESS=unix:path=/run/flatpak/at-spi-bus \
--env=DESKTOP_SESSION=$(DESKTOP_SESSION) \
--env=LANG=$(LANG) \
--env=G_MESSAGES_DEBUG=Tarug \
--env=WAYLAND_DISPLAY=$(WAYLAND_DISPLAY) \
--env=XDG_CURRENT_DESKTOP=$(XDG_CURRENT_DESKTOP) \
--env=XDG_SESSION_DESKTOP=$(XDG_SESSION_DESKTOP) \
--env=XDG_SESSION_TYPE=$(XDG_SESSION_TYPE) \
--bind-mount=/run/host/fonts=/usr/share/fonts \
--bind-mount=/run/host/fonts-cache=/var/cache/fontconfig \
--bind-mount=/run/host/user-fonts-cache=$(HOME)/.cache/fontconfig \
--bind-mount=/run/host/font-dirs.xml=$(HOME)/.cache/font-dirs.xml \
--bind-mount=/run/flatpak/at-spi-bus=/run/user/1000/at-spi/bus \
--filesystem=$(HOME)/.local/share/fonts:ro \
--filesystem=$(HOME)/.cache/fontconfig:ro \
--share=network \
--share=ipc \
--socket=fallback-x11 \
--socket=wayland \
--talk-name="org.freedesktop.portal.*" \
--talk-name=org.a11y.Bus \
--device=dri
init:
flatpak build-init $(REPO_DIR) $(APP_ID) $(SDK) $(PLATFORM) $(VERSION)
download:
flatpak-builder \
$(BUILDER_FLAGS) \
--download-only \
$(REPO_DIR) \
$(MANIFEST)
build-deps: download
flatpak-builder \
$(BUILDER_FLAGS) \
--disable-download \
--build-only \
--keep-build-dirs \
$(REPO_DIR) \
$(MANIFEST)
configure: build-deps
flatpak build \
--share=network \
--filesystem=$(PWD) \
--filesystem=$(PWD)/$(REPO_DIR) \
--filesystem=$(PWD)/$(BUILD_DIR) \
$(REPO_DIR) \
meson setup $(BUILD_DIR) --prefix=/app
build: configure
flatpak build \
--share=network \
--filesystem=$(PWD) \
--filesystem=$(PWD)/$(REPO_DIR) \
--filesystem=$(PWD)/$(BUILD_DIR) \
$(REPO_DIR) \
ninja -C $(BUILD_DIR)
install: build
flatpak build \
--share=network \
--filesystem=$(PWD) \
--filesystem=$(PWD)/$(REPO_DIR) \
--filesystem=$(PWD)/$(BUILD_DIR) \
$(REPO_DIR) \
ninja -C $(BUILD_DIR) install
run: install
flatpak build \
$(RUNNER_FLAGS) \
$(REPO_DIR) tarug
bundle: build
cp -r $(REPO_DIR) $(BUNDLE_DIR)
flatpak build-export $(FLATPAK_DIR)/ostree-repo $(BUNDLE_DIR)
flatpak build-bundle $(FLATPAK_DIR)/ostree-repo $(APP_ID).flatpak $(APP_ID)
lsp:
flatpak build $(RUNNER_FLAGS) $(REPO_DIR) /usr/lib/sdk/vala/bin/vala-language-server
meson:
flatpak build $(RUNNER_FLAGS) $(REPO_DIR) /usr/bin/meson
shell:
flatpak build $(RUNNER_FLAGS) $(REPO_DIR) /usr/bin/bash
test:
flatpak build $(RUNNER_FLAGS) $(REPO_DIR) /usr/bin/meson test -C $(BUILD_DIR)
clean:
rm -rf $(BUILD_DIR)
rm -rf $(REPO_DIR)