Skip to content

Commit

Permalink
Flatpak 😒
Browse files Browse the repository at this point in the history
Added pikepdf dependency, the worst possible way
  • Loading branch information
piegamesde committed Jul 8, 2023
1 parent aa43c88 commit a7022a9
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "com.github.jeromerobert.pdfarranger"]
path = com.github.jeromerobert.pdfarranger
url = https://github.com/flathub/com.github.jeromerobert.pdfarranger
1 change: 1 addition & 0 deletions com.github.jeromerobert.pdfarranger
1 change: 1 addition & 0 deletions de.piegames.dinoscore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ modules:
- type: archive
url: "https://github.com/PortMidi/portmidi/archive/refs/tags/v2.0.3.zip"
sha256: "bdeecf9968689d270c0883fabdd22d79039c982b7afda475665573b8e66bdcc5"
- pikepdf.yml
- name: dinoscore
buildsystem: simple
build-commands:
Expand Down
8 changes: 7 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
build:
flatpak-builder builder de.piegames.dinoscore.yml --force-clean --sandbox
flatpak-builder --user builder de.piegames.dinoscore.yml --force-clean --sandbox

update:
# Pin cargo dependencies
python generator.py -o cargo-sources.json # TODO fix

# Flatpak doesn't do any dependency sharing, and instead we are expected to copy-paste some other application's dependencies
# and manually maintain them.
# So we do the only sensible thing, and automate that part by jq-ing the relevant snippet from the other application
yq -y '.modules | .[] | objects | select(.name == "pikepdf-src") | .modules[0] = "com.github.jeromerobert.pdfarranger/" + .modules[0] | .modules[1] = "com.github.jeromerobert.pdfarranger/" + .modules[1]' com.github.jeromerobert.pdfarranger/com.github.jeromerobert.pdfarranger.yaml > pikepdf.yml
26 changes: 26 additions & 0 deletions pikepdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pikepdf-src
buildsystem: simple
build-commands:
- pip3 install --no-index --prefix=${FLATPAK_DEST} --no-build-isolation .
sources:
- url: https://files.pythonhosted.org/packages/8d/0a/a964edab0bdb29ceae4ef4309f4448f52e71e8228748760d5edc9c3c0d7e/pikepdf-7.2.0.tar.gz
sha256: ad82b836faed0376c725e19d0f8a7c7bef389e8c46683c11bbfc70410bc2e3ee
type: archive
x-checker-data:
type: pypi
name: pikepdf
modules:
- com.github.jeromerobert.pdfarranger/python3-lxml.yaml
- com.github.jeromerobert.pdfarranger/python3-pikepdf-deps.yaml
- name: qpdf
buildsystem: cmake-ninja
builddir: true
sources:
- url: https://github.com/qpdf/qpdf/releases/download/v11.4.0/qpdf-11.4.0.tar.gz
sha256: b0180971cc1b79b2dfe02ffe28e2c88c47f735888a3a2543dd42b9054ef146e1
type: archive
x-checker-data:
type: anitya
project-id: 5542
stable-only: true
url-template: https://github.com/qpdf/qpdf/releases/download/v$version/qpdf-$version.tar.gz
2 changes: 2 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs; [
just
jq
yq
flatpak
flatpak-builder
(python3.withPackages (pypkgs: with pypkgs; [
Expand Down

0 comments on commit a7022a9

Please sign in to comment.