flatpak: deprecate official support

See #309
This commit is contained in:
Sumner Evans
2021-05-30 22:40:10 -06:00
parent cd2450a838
commit 2ed4106e5e
16 changed files with 10 additions and 399 deletions

View File

@@ -1,27 +0,0 @@
image: archlinux
packages:
- dbus
- flatpak
- flatpak-builder
- gobject-introspection
- gtk3
- mpv
- python-cairo
- python-gobject
- python-pip
- python-poetry
- xorg-server-xvfb
sources:
- https://git.sr.ht/~sumner/sublime-music
environment:
REPO_NAME: sublime-music
artifacts:
- sublime-music/flatpak/sublime-music.flatpak
# triggers:
# - action: email
# condition: failure
# to: ~sumner/sublime-music-devel@lists.sr.ht
tasks:
- build-flatpak: |
cd ${REPO_NAME}/flatpak
sudo REPO=repo ./flatpak_build.sh

3
.gitignore vendored
View File

@@ -1,7 +1,4 @@
.direnv .direnv
flatpak/flatpak_build_dir/
flatpak/sublime-music.flatpak
flatpak/repo
# Created by https://www.gitignore.io/api/python # Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python # Edit at https://www.gitignore.io/?templates=python

View File

@@ -53,16 +53,6 @@ build:
- dist/* - dist/*
expire_in: 7 days expire_in: 7 days
build_flatpak:
image: registry.gitlab.com/sublime-music/sublime-music/flatpak-build:latest
stage: build
script:
- cd flatpak
- ./flatpak_build.sh
artifacts:
paths:
- flatpak/sublime-music.flatpak
# Deploy documenation and code coverage to GitLab Pages # Deploy documenation and code coverage to GitLab Pages
pages: pages:
only: only:
@@ -91,21 +81,6 @@ publish_release:
# Scheduled Jobs # Scheduled Jobs
# ============================================================================= # =============================================================================
# Create the Docker image for Flatpak builds.
flatpak_docker:
image: docker:1.13
stage: build-containers
only:
variables:
- $REBUILD_FLATPAK_DOCKER == "True"
services:
- docker:dind
script:
- docker version
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/flatpak-build:latest ./cicd/flatpak-build
- docker push $CI_REGISTRY_IMAGE/flatpak-build
# Create the Docker image for Python testing/builds. # Create the Docker image for Python testing/builds.
python_docker: python_docker:
image: docker:1.13 image: docker:1.13

View File

@@ -1,3 +1,10 @@
v0.11.13
========
**Deprecations**
* Official Flatpak support has been dropped (#309)
v0.11.12 v0.11.12
======== ========

View File

@@ -87,17 +87,6 @@ If you do not want to activate the Poetry virtual environment, you can use:
$ poetry run sublime-music $ poetry run sublime-music
``` ```
### Building the flatpak
- A flatpak-builder environment must be setup on the build machine to do a
flatpak build. This includes `org.gnome.SDK//3.36` and
`org.gnome.Platform//3.36`.
- The `flatpak` folder contains the required files to build a flatpak package.
- The script `flatpak_build.sh` will run the required commands to grab the
remaining dependencies and build the flatpak.
- You can install the Flatpak using: `flatpak install sublime-music.flatpak` and
run it using `flatpak run app.sublimemusic.SublimeMusic`.
### Code Style ### Code Style
This project follows [PEP-8](https://www.python.org/dev/peps/pep-0008/) This project follows [PEP-8](https://www.python.org/dev/peps/pep-0008/)
@@ -201,7 +190,6 @@ application to PyPi. A brief description of each of the stages is as follows:
`build` `build`
* Builds the Python dist tar file * Builds the Python dist tar file
* Builds the flatpak.
`deploy` `deploy`

View File

@@ -135,30 +135,6 @@ the package with::
sudo apt install sublime-music sudo apt install sublime-music
**Via Flatpak**:
In the future, you will be able to install via Flathub. For now, if you want to
try the Flatpak, you will have to install it manually by visiting the Releases_
page and downloading the ``.flatpak`` file from there.
Next, install the dependencies for Sublime Music. If you haven't already, follow
the instructions to setup ``flathub`` here:
https://docs.flatpak.org/en/latest/using-flatpak.html#add-a-remote
Then, install the dependencies of Sublime Music::
sudo flatpak install -y org.gnome.Platform//3.38 org.gnome.Sdk//3.38
And finally, install Sublime Music with::
sudo flatpak install sublime-music.flatpak
To run Sublime, use the following command::
flatpak run app.sublimemusic.SublimeMusic
.. _Releases: https://gitlab.com/sublime-music/sublime-music/-/releases
**Via PyPi**:: **Via PyPi**::
pip install sublime-music pip install sublime-music

View File

@@ -1,17 +0,0 @@
FROM fedora:30
LABEL maintainer robozman "https://gitlab.com/robozman"
VOLUME [ "/sys/fs/cgroup", "/tmp", "/run" ]
RUN dnf -y update && \
dnf install -y flatpak flatpak-builder ostree fuse wget curl elfutils dconf git bzip2 bzr python3 python3-pip && \
dnf clean all
RUN flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
RUN flatpak install -y org.gnome.Platform//3.38 && \
flatpak install -y org.gnome.Sdk//3.38
RUN pip3 install requirements-parser

View File

@@ -48,29 +48,6 @@ if [[ "${milestone}" != "" ]]; then
milestones=",\"milestones\":[\"${milestone}\"]" milestones=",\"milestones\":[\"${milestone}\"]"
fi fi
# Determine whether or not to include the Flatpak build.
set +e
failed=$(curl \
--header "PRIVATE-TOKEN: ${RELEASE_PUBLISH_TOKEN}" \
--request GET \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs?scope[]=failed" \
| grep '"name":"build_flatpak"')
set -e
assets=""
if [[ $failed == "" ]]; then
assets=",
\"assets\": {
\"links\": [
{
\"name\": \"sublime-music-${CI_COMMIT_TAG}.flatpak\",
\"url\": \"${CI_PROJECT_URL}/-/jobs/artifacts/${CI_COMMIT_TAG}/raw/flatpak/sublime-music.flatpak?job=build_flatpak\"
}
]
}
"
fi
url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases" url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases"
data=" data="
{ {

View File

@@ -109,30 +109,6 @@ the package with::
sudo apt install sublime-music sudo apt install sublime-music
**Via Flatpak**:
In the future, you will be able to install via Flathub. For now, if you want to
try the Flatpak, you will have to install it manually by visiting the Releases_
page and downloading the ``.flatpak`` file from there.
Next, install the dependencies for Sublime Music. If you haven't already, follow
the instructions to setup ``flathub`` here:
https://docs.flatpak.org/en/latest/using-flatpak.html#add-a-remote
Then, install the dependencies of Sublime Music::
sudo flatpak install -y org.gnome.Platform//3.38 org.gnome.Sdk//3.38
And finally, install Sublime Music with::
sudo flatpak install sublime-music.flatpak
To run Sublime, use the following command::
flatpak run app.sublimemusic.SublimeMusic
.. _Releases: https://gitlab.com/sublime-music/sublime-music/-/releases
**Via PyPi**:: **Via PyPi**::
pip install sublime-music pip install sublime-music

3
flatpak/.gitignore vendored
View File

@@ -1,3 +0,0 @@
.flatpak-builder/
flatpak-builder-tools/
pypi-dependencies.json

View File

@@ -1,197 +0,0 @@
{
"app-id": "app.sublimemusic.SublimeMusic",
"runtime": "org.gnome.Platform",
"runtime-version": "3.38",
"sdk": "org.gnome.Sdk",
"command": "sublime-music",
"rename-icon": "sublime-music",
"rename-desktop-file": "sublime-music.desktop",
"rename-appdata-file": "sublime-music.metainfo.xml",
"add-extentions": {
"org.freedesktop.Platform.ffmpeg-full": {
"directory": "lib/ffmpeg",
"version": "19.08",
"add-ld-path": "."
}
},
"finish-args": [
"--share=ipc",
"--socket=fallback-x11",
"--socket=wayland",
"--share=network",
"--socket=pulseaudio",
"--talk-name=org.freedesktop.Notifications",
"--own-name=org.mpris.MediaPlayer2.sublimemusic",
"--filesystem=xdg-config/sublime-music",
"--filesystem=xdg-cache/sublime-music",
"--filesystem=xdg-data/sublime-music",
"--env=TMPDIR=/tmp"
],
"modules": [
{
"name": "icons-and-metadata",
"buildsystem": "simple",
"build-commands": [
"install -Dm644 16.png /app/share/icons/hicolor/16x16/apps/sublime-music.png",
"install -Dm644 22.png /app/share/icons/hicolor/22x22/apps/sublime-music.png",
"install -Dm644 32.png /app/share/icons/hicolor/32x32/apps/sublime-music.png",
"install -Dm644 36.png /app/share/icons/hicolor/36x36/apps/sublime-music.png",
"install -Dm644 48.png /app/share/icons/hicolor/48x48/apps/sublime-music.png",
"install -Dm644 64.png /app/share/icons/hicolor/64x64/apps/sublime-music.png",
"install -Dm644 72.png /app/share/icons/hicolor/72x72/apps/sublime-music.png",
"install -Dm644 96.png /app/share/icons/hicolor/96x96/apps/sublime-music.png",
"install -Dm644 128.png /app/share/icons/hicolor/128x128/apps/sublime-music.png",
"install -Dm644 192.png /app/share/icons/hicolor/192x192/apps/sublime-music.png",
"install -Dm644 512.png /app/share/icons/hicolor/512x512/apps/sublime-music.png",
"install -Dm644 sublime-music.desktop /app/share/applications/sublime-music.desktop",
"install -Dm644 sublime-music.metainfo.xml /app/share/metainfo/sublime-music.metainfo.xml"
],
"sources": [
{
"type": "dir",
"path": "../logo/rendered"
},
{
"type": "file",
"path": "../sublime-music.desktop"
},
{
"type": "file",
"path": "../sublime-music.metainfo.xml"
}
]
},
{
"name": "sublime",
"buildsystem": "simple",
"build-commands": [
"pip3 install --prefix=/app ."
],
"build-options": {
"build-args": [
"--share=network"
]
},
"sources": [
{
"type": "dir",
"path": ".."
}
],
"modules": [
"pypi-dependencies.json",
{
"name": "libmpv",
"cleanup": [
"/include",
"/lib/pkgconfig",
"/share/man"
],
"buildsystem": "simple",
"build-commands": [
"python3 waf configure --prefix=/app --enable-libmpv-shared --disable-cplayer --disable-build-date --disable-oss-audio --disable-alsa",
"python3 waf build",
"python3 waf install"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/mpv-player/mpv/archive/v0.30.0.tar.gz",
"sha256": "33a1bcb7e74ff17f070e754c15c52228cf44f2cefbfd8f34886ae81df214ca35"
},
{
"type": "file",
"url": "https://waf.io/waf-2.0.12",
"sha256": "0979ca87f45928e0d752049ab2f43be8551249be73dc5563b944ec54f8871d1f",
"dest-filename": "waf"
}
],
"modules": [
{
"name": "luajit",
"no-autogen": true,
"cleanup": [
"/bin",
"/lib/*.a",
"/include",
"/lib/pkgconfig",
"/share/man"
],
"sources": [
{
"type": "archive",
"url": "http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz",
"sha256": "1ad2e34b111c802f9d0cdf019e986909123237a28c746b21295b63c9e785d9c3"
},
{
"type": "shell",
"commands": [
"sed -i 's|/usr/local|/app|' ./Makefile"
]
}
]
},
{
"name": "libass",
"cleanup": [
"/include",
"/lib/*.la",
"/lib/pkgconfig"
],
"config-opts": [
"--disable-static"
],
"sources": [
{
"type": "archive",
"url": "https://github.com/libass/libass/releases/download/0.14.0/libass-0.14.0.tar.xz",
"sha256": "881f2382af48aead75b7a0e02e65d88c5ebd369fe46bc77d9270a94aa8fd38a2"
}
]
},
{
"name": "uchardet",
"buildsystem": "cmake-ninja",
"config-opts": [
"-DCMAKE_BUILD_TYPE=Release",
"-DBUILD_STATIC=0"
],
"cleanup": [
"/bin",
"/include",
"/lib/pkgconfig",
"/share/man"
],
"sources": [
{
"type": "archive",
"url": "https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.6.tar.xz",
"sha256": "8351328cdfbcb2432e63938721dd781eb8c11ebc56e3a89d0f84576b96002c61"
}
]
}
]
},
{
"name": "libhandy",
"buildsystem": "meson",
"builddir": true,
"config-opts": [
"-Dexamples=false",
"-Dglade_catalog=disabled",
"-Dintrospection=disabled",
"-Dtests=false",
"-Dvapi=false"
],
"sources": [
{
"type": "git",
"branch": "flap-handle",
"url": "https://gitlab.gnome.org/BenjaminSchaaf/libhandy.git"
}
]
}
]
}
]
}

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env bash
set -xe
ARCH=${ARCH:""}
REPO=${REPO:-/repo}
APPID=app.sublimemusic.SublimeMusic
if [ -z "$ARCH" ]; then
ARCH_ARG=""
else
ARCH_ARG="--arch=$ARCH"
fi
pip3 install toml
flatpak install -y org.gnome.Platform/$ARCH/3.38
flatpak install -y org.gnome.Sdk/$ARCH/3.38
rm -rf flatpak-builder-tools
git clone https://github.com/flatpak/flatpak-builder-tools.git
python3 ./flatpak-builder-tools/poetry/flatpak-poetry-generator.py \
../poetry.lock \
--production \
-o pypi-dependencies.json
mkdir -p $REPO
flatpak-builder --force-clean $ARCH_ARG --repo=$REPO flatpak_build_dir ${APPID}.json
flatpak build-bundle $ARCH_ARG $REPO sublime-music.flatpak $APPID

View File

@@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "sublime_music" name = "sublime_music"
version = "0.11.12" version = "0.11.13"
description = "A native GTK *sonic client." description = "A native GTK *sonic client."
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
authors = ["Sumner Evans <inquiries@sumnerevans.com>"] authors = ["Sumner Evans <inquiries@sumnerevans.com>"]
@@ -74,10 +74,3 @@ server = ["bottle"]
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"
[tool.black]
exclude = '''
(
/flatpak/
)
'''

View File

@@ -1,6 +1,6 @@
[flake8] [flake8]
extend-ignore = E203, E402, E722, E731, W503, ANN002, ANN003, ANN101, ANN102, ANN204 extend-ignore = E203, E402, E722, E731, W503, ANN002, ANN003, ANN101, ANN102, ANN204
exclude = .git,__pycache__,build,dist,flatpak,.venv exclude = .git,__pycache__,build,dist,.venv
max-line-length = 88 max-line-length = 88
suppress-none-returning = True suppress-none-returning = True
suppress-dummy-args = True suppress-dummy-args = True
@@ -56,7 +56,6 @@ log_cli_level = 10
addopts = addopts =
-vvv -vvv
--doctest-modules --doctest-modules
--ignore-glob='flatpak'
--ignore-glob='cicd' --ignore-glob='cicd'
--cov=sublime_music --cov=sublime_music
--cov-report html --cov-report html

View File

@@ -28,8 +28,6 @@ pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
bashInteractive bashInteractive
flatpak
flatpak-builder
gcc gcc
git git
glib glib

View File

@@ -1 +1 @@
__version__ = "0.11.12" __version__ = "0.11.13"