improve flatpak Makefile

This commit is contained in:
Unrud 2018-12-31 15:45:06 +01:00
parent a06707c5e9
commit 0aa1ecfe33
2 changed files with 17 additions and 10 deletions

9
flatpak/.gitignore vendored
View file

@ -1,4 +1,5 @@
/RemoteTouchpad
/repo
/.flatpak-builder
/RemoteTouchpad-*.flatpak
Makefile
.flatpak-builder
repo
build
*.flatpak

View file

@ -1,26 +1,32 @@
ARCH = $(shell flatpak --default-arch)
APP_ID = com.github.unrud.RemoteTouchpad
APP_NAME = RemoteTouchpad
APP_NAME = $(shell echo $(APP_ID) | rev | cut --delimiter=. --fields=1 | rev)
FORMAT = $(shell ls -1 $(APP_ID).json $(APP_ID).yaml 2>/dev/null | tail -n1 | rev | cut -d. -f1 | rev)
BRANCH = master
.PHONY: all
all: bundle
.PHONY: build
build:
flatpak-builder --arch=$(ARCH) --force-clean $(APP_NAME) $(APP_ID).json
mkdir -p build
flatpak-builder --arch=$(ARCH) --force-clean build/$(APP_NAME) $(APP_ID).$(FORMAT)
.PHONY: repo
repo:
flatpak-builder --arch=$(ARCH) --force-clean $(APP_NAME) $(APP_ID).json --repo=repo
mkdir -p build repo
flatpak-builder --arch=$(ARCH) --force-clean build/$(APP_NAME) $(APP_ID).$(FORMAT) --repo=repo/$(APP_NAME)
.PHONY: bundle
bundle: repo
flatpak build-bundle --arch=$(ARCH) repo $(APP_NAME)-$(ARCH).flatpak $(APP_ID)
flatpak build-bundle --arch=$(ARCH) repo/$(APP_NAME) $(APP_NAME)-$(ARCH).flatpak $(APP_ID) $(BRANCH)
.PHONY: clean
clean:
rm -rf $(APP_NAME) $(APP_NAME)-*.flatpak repo .flatpak-builder || true
rm -rf $(APP_NAME)-*.flatpak build/$(APP_NAME) repo/$(APP_NAME) .flatpak-builder || true
rmdir build || true
rmdir repo || true
.PHONY: install
install:
@ -28,4 +34,4 @@ install:
.PHONY: uninstall
uninstall:
flatpak uninstall --user $(APP_ID)
flatpak uninstall --user $(APP_ID)/$(ARCH)/$(BRANCH)