diff options
author | John Stebbins <[email protected]> | 2018-06-06 16:20:34 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2018-06-06 16:23:03 -0700 |
commit | 93a153eee436a5ca71561dd40c4f128e51e4d47a (patch) | |
tree | b9aa093a59c9c83b2eabebbf69777ac0672c5691 /pkg/linux | |
parent | 73649f092fc8da27f256bbf99f8fea0c4aa243fd (diff) |
scripts: add script for creating flatpak manifests
This script can generate manifests that are suitable for submitting to
flathub for publishing to their repository. It can also be used for
generating manifests suitable for building local flatpak bundles and is
used during 'make pkg.create.flatpak'
Diffstat (limited to 'pkg/linux')
-rw-r--r-- | pkg/linux/flatpak/fr.handbrake.HandBrakeCLI.json | 2 | ||||
-rw-r--r-- | pkg/linux/flatpak/fr.handbrake.ghb.json | 5 | ||||
-rw-r--r-- | pkg/linux/module.defs | 13 | ||||
-rw-r--r-- | pkg/linux/module.rules | 33 |
4 files changed, 23 insertions, 30 deletions
diff --git a/pkg/linux/flatpak/fr.handbrake.HandBrakeCLI.json b/pkg/linux/flatpak/fr.handbrake.HandBrakeCLI.json index ae64f64f5..5acef796f 100644 --- a/pkg/linux/flatpak/fr.handbrake.HandBrakeCLI.json +++ b/pkg/linux/flatpak/fr.handbrake.HandBrakeCLI.json @@ -5,9 +5,7 @@ "sdk": "org.gnome.Sdk", "command": "HandBrakeCLI", "finish-args": [ - /* Needs video */ "--filesystem=xdg-videos", - /* Home */ "--filesystem=home" ], "modules": [ diff --git a/pkg/linux/flatpak/fr.handbrake.ghb.json b/pkg/linux/flatpak/fr.handbrake.ghb.json index 0b5aea05f..27947def0 100644 --- a/pkg/linux/flatpak/fr.handbrake.ghb.json +++ b/pkg/linux/flatpak/fr.handbrake.ghb.json @@ -5,16 +5,11 @@ "sdk": "org.gnome.Sdk", "command": "ghb", "finish-args": [ - /* X11 + XShm access */ "--share=ipc", "--socket=x11", - /* Wayland access */ "--socket=wayland", - /* Needed for dconf to work */ "--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro", "--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf", - /* Needs video */ "--filesystem=xdg-videos", - /* Home */ "--filesystem=home" ], "modules": [ diff --git a/pkg/linux/module.defs b/pkg/linux/module.defs index ad4f559bc..b17aaa377 100644 --- a/pkg/linux/module.defs +++ b/pkg/linux/module.defs @@ -18,6 +18,15 @@ ifneq ($(PGP_ID),) PGPSIGN = --gpg-sign=$(PGP_ID) endif +ifneq ($(FP_RUNTIME),) + FPRUNTIME = -r $(FP_RUNTIME) +endif + +ifneq ($(HB_URL),) +ifneq ($(HB_SHA256),) + FLATHUB_MANIFEST = $(PKG.gui.flathub.manifest) $(PKG.cli.flathub.manifest) +endif +endif ############################################################################### @@ -48,8 +57,8 @@ PKG.rpm.stamp = $(PKG.out/).rpm.stamp PKG.out.flatpak/ = $(PKG.out/)flatpak/ STAGE.out.flatpak/ = $(STAGE.out/)flatpak/ -PKG.src.flatpak = $(STAGE.out.flatpak/)handbrake.tar.bz2 -PKG.contrib.flatpak = $(STAGE.out.flatpak/)download.tgz +PKG.gui.flathub.manifest = $(PKG.out.flatpak/)/fr.handbrake.ghb.json +PKG.cli.flathub.manifest = $(PKG.out.flatpak/)/fr.handbrake.HandBrakeCLI.json PKG.gui.manifest.flatpak = $(PKG.flatpak/)fr.handbrake.ghb.json PKG.cli.manifest.flatpak = $(PKG.flatpak/)fr.handbrake.HandBrakeCLI.json PKG.gui.build.flatpak = $(STAGE.out.flatpak/)$(HB.name)-$(HB.version)-$(BUILD.machine).build diff --git a/pkg/linux/module.rules b/pkg/linux/module.rules index 757698687..dcbc36289 100644 --- a/pkg/linux/module.rules +++ b/pkg/linux/module.rules @@ -1,4 +1,5 @@ -pkg.create.flatpak:: contrib.fetch $(PKG.gui.flatpak) $(PKG.cli.flatpak) +pkg.create.flatpak:: contrib.fetch $(PKG.gui.flatpak) $(PKG.cli.flatpak) $(FLATHUB_MANIFEST) +pkg.create.flathub:: $(FLATHUB_MANIFEST) pkg.create.deb:: $(PKG.gui.deb) $(PKG.cli.deb) pkg.create.rpm:: $(PKG.rpm.stamp) pkg.create.src.deb:: $(PKG.src.deb.stamp) @@ -9,7 +10,6 @@ DEBIAN_CHANGELOG_DATE = $(shell date -R) # # CLI Tar Package # - $(PKG.cli.tar): | $(dir $(PKG.cli.tar)) $(PKG.cli.tar): | $(STAGE.out.cli/) cd $(STAGE.out.cli/) && $(TAR.exe) cjf $(call fn.ABSOLUTE,$(PKG.cli.tar)) . @@ -61,32 +61,23 @@ $(PKG.rpm.stamp): $(PKG.native.rpm.stamp) # # Flatpak binary package rules # -$(PKG.src.flatpak): $(PKG.src.tar.bz2) - $(MKDIR.exe) -p $(STAGE.out.flatpak/) - -$(RM.exe) -rf $(BUILD/).flatpak-builder - $(CP.exe) $(PKG.src.tar.bz2) $(PKG.src.flatpak) +$(PKG.gui.flathub.manifest): + $(SRC/)scripts/create_flatpak_manifest.py -a "$(HB_URL)" -s "$(HB_SHA256)" -t $(PKG.gui.manifest.flatpak) $(foreach m,$(CONTRIBS),-c "$(word 1,$($m.FETCH.url))" -s "$(word 1,$($m.FETCH.sha256))") $(FPRUNTIME) $(PKG.gui.flathub.manifest) -$(PKG.contrib.flatpak): - $(MKDIR.exe) -p $(STAGE.out.flatpak/) - $(TAR.exe) -C $(SRC/) -czf $(PWD)/$(PKG.contrib.flatpak) download +$(PKG.cli.flathub.manifest): + $(SRC/)scripts/create_flatpak_manifest.py -a "$(HB_URL)" -s "$(HB_SHA256)" -t $(PKG.cli.manifest.flatpak) $(foreach m,$(CONTRIBS),-c "$(word 1,$($m.FETCH.url))" -s "$(word 1,$($m.FETCH.sha256))") $(FPRUNTIME) $(PKG.cli.flathub.manifest) -$(PKG.gui.flatpak): GNUmakefile $(PKG.src.flatpak) $(PKG.contrib.flatpak) - make contrib.fetch +$(PKG.gui.flatpak): GNUmakefile $(PKG.src.tar.bz2) + $(MKDIR.exe) -p $(STAGE.out.flatpak/) $(MKDIR.exe) -p $(PKG.out.flatpak/) - # Relative paths in the manifest are relative to the location - # of the manifest. So put it where we have staged the files that - # it needs. - $(CP.exe) $(PKG.gui.manifest.flatpak) $(STAGE.out.flatpak/)fr.handbrake.ghb.json + $(SRC/)scripts/create_flatpak_manifest.py -a "$(abspath $(PKG.src.tar.bz2))" -t $(PKG.gui.manifest.flatpak) $(foreach m,$(CONTRIBS),-c "$(abspath $(CONTRIB.download/)$($m.FETCH.basename))") $(STAGE.out.flatpak/)fr.handbrake.ghb.json flatpak-builder --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.gui.build.flatpak) $(STAGE.out.flatpak/)fr.handbrake.ghb.json flatpak build-bundle $(PKG.repo.flatpak) $(PKG.gui.flatpak) fr.handbrake.ghb -$(PKG.cli.flatpak): GNUmakefile $(PKG.src.flatpak) $(PKG.contrib.flatpak) - make contrib.fetch +$(PKG.cli.flatpak): GNUmakefile $(PKG.src.tar.bz2) + $(MKDIR.exe) -p $(STAGE.out.flatpak/) $(MKDIR.exe) -p $(PKG.out.flatpak/) - # Relative paths in the manifest are relative to the location - # of the manifest. So put it where we have staged the files that - # it needs. - $(CP.exe) $(PKG.cli.manifest.flatpak) $(STAGE.out.flatpak/)fr.handbrake.HandBrakeCLI.json + $(SRC/)scripts/create_flatpak_manifest.py -a "$(abspath $(PKG.src.tar.bz2))" -t $(PKG.cli.manifest.flatpak) $(foreach m,$(CONTRIBS),-c "$(abspath $(CONTRIB.download/)$($m.FETCH.basename))") $(STAGE.out.flatpak/)fr.handbrake.HandBrakeCLI.json flatpak-builder --force-clean $(PGPSIGN) --repo=$(PKG.repo.flatpak) $(PKG.cli.build.flatpak) $(STAGE.out.flatpak/)fr.handbrake.HandBrakeCLI.json flatpak build-bundle $(PKG.repo.flatpak) $(PKG.cli.flatpak) fr.handbrake.HandBrakeCLI |