-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
79 lines (61 loc) · 2.47 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
SHELL := /bin/bash
APP_ID := com.github.avojak.warble
ELEMENTARY_FLATPAK_REMOTE_URL := https://flatpak.elementary.io/repo.flatpakrepo
ELEMENTARY_FLATPAK_REMOTE_NAME := appcenter
ELEMENTARY_PLATFORM_VERSION := 7
FLATHUB_FLATPAK_REMOTE_URL := https://flathub.org/repo/flathub.flatpakrepo
FLATHUB_FLATPAK_REMOTE_NAME := flathub
FLATHUB_PLATFORM_VERSION := 42
BUILD_DIR := build
NINJA_BUILD_FILE := $(BUILD_DIR)/build.ninja
FLATPAK_BUILDER_FLAGS := --user --install --force-clean
ifdef OFFLINE_BUILD
FLATPAK_BUILDER_FLAGS += --disable-download
endif
# Check for executables which are assumed to already be present on the system
EXECUTABLES = flatpak flatpak-builder
K := $(foreach exec,$(EXECUTABLES),\
$(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
.DEFAULT_GOAL := flatpak
.PHONY: all
all: translations flatpak
# Fetch the Flatpak dependencies for building for AppCenter
.PHONY: flatpak-init
flatpak-init:
flatpak remote-add --if-not-exists --user $(ELEMENTARY_FLATPAK_REMOTE_NAME) $(ELEMENTARY_FLATPAK_REMOTE_URL)
flatpak install -y --user $(ELEMENTARY_FLATPAK_REMOTE_NAME) io.elementary.Platform//$(ELEMENTARY_PLATFORM_VERSION)
flatpak install -y --user $(ELEMENTARY_FLATPAK_REMOTE_NAME) io.elementary.Sdk//$(ELEMENTARY_PLATFORM_VERSION)
# Fetch the dependencies locally so that the IDE will be able to locate packages outside of Flatpak
.PHONY: dev-init
dev-init:
sudo apt install -y libadwaita-1-dev libgranite-7-dev sassc
.PHONY: init
init: flatpak-init dev-init
# Builds the Flatpak application for AppCenter
.PHONY: flatpak
flatpak:
flatpak-builder build $(APP_ID).yml $(FLATPAK_BUILDER_FLAGS)
# Fetch the Flatpak dependencies for building for Flathub
.PHONY: flathub-init
flathub-init:
flatpak remote-add --if-not-exists --user $(FLATHUB_FLATPAK_REMOTE_NAME) $(FLATHUB_FLATPAK_REMOTE_URL)
flatpak install -y --user $(FLATHUB_FLATPAK_REMOTE_NAME) org.gnome.Platform//$(FLATHUB_PLATFORM_VERSION)
flatpak install -y --user $(FLATHUB_FLATPAK_REMOTE_NAME) org.gnome.Sdk//$(FLATHUB_PLATFORM_VERSION)
# Builds the Flatpak application for Flathub
.PHONY: flathub
flathub:
flatpak-builder build flathub/$(APP_ID).yml --user --install --force-clean
.PHONY: lint
lint:
io.elementary.vala-lint ./src
$(NINJA_BUILD_FILE):
meson build --prefix=/user
.PHONY: translations
translations: $(NINJA_BUILD_FILE)
ninja -C build $(APP_ID)-pot
ninja -C build $(APP_ID)-update-po
.PHONY: clean
clean:
rm -rf ./.flatpak-builder/
rm -rf ./build/
rm -rf ./builddir/