From 2ed4106e5ec6b95e10d82d99eae945a406040ad4 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sun, 30 May 2021 22:40:10 -0600 Subject: [PATCH] flatpak: deprecate official support See #309 --- .builds/build-flatpak.yml | 27 --- .gitignore | 3 - .gitlab-ci.yml | 25 --- CHANGELOG.rst | 7 + CONTRIBUTING.md | 12 -- README.rst | 24 --- cicd/flatpak-build/Dockerfile | 17 -- cicd/publish-gitlab-release.sh | 23 --- docs/index.rst | 24 --- flatpak/.gitignore | 3 - flatpak/app.sublimemusic.SublimeMusic.json | 197 --------------------- flatpak/flatpak_build.sh | 31 ---- pyproject.toml | 9 +- setup.cfg | 3 +- shell.nix | 2 - sublime_music/__init__.py | 2 +- 16 files changed, 10 insertions(+), 399 deletions(-) delete mode 100644 .builds/build-flatpak.yml delete mode 100644 cicd/flatpak-build/Dockerfile delete mode 100644 flatpak/.gitignore delete mode 100644 flatpak/app.sublimemusic.SublimeMusic.json delete mode 100755 flatpak/flatpak_build.sh diff --git a/.builds/build-flatpak.yml b/.builds/build-flatpak.yml deleted file mode 100644 index 1dd10dd..0000000 --- a/.builds/build-flatpak.yml +++ /dev/null @@ -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 diff --git a/.gitignore b/.gitignore index 9e43bfe..dae84ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,4 @@ .direnv -flatpak/flatpak_build_dir/ -flatpak/sublime-music.flatpak -flatpak/repo # Created by https://www.gitignore.io/api/python # Edit at https://www.gitignore.io/?templates=python diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cc45e70..a068377 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -53,16 +53,6 @@ build: - dist/* 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 pages: only: @@ -91,21 +81,6 @@ publish_release: # 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. python_docker: image: docker:1.13 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e96d612..4e42bf3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,10 @@ +v0.11.13 +======== + +**Deprecations** + +* Official Flatpak support has been dropped (#309) + v0.11.12 ======== diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 480571f..c0b79fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -87,17 +87,6 @@ If you do not want to activate the Poetry virtual environment, you can use: $ 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 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` * Builds the Python dist tar file -* Builds the flatpak. `deploy` diff --git a/README.rst b/README.rst index e8d9673..bf81c79 100644 --- a/README.rst +++ b/README.rst @@ -135,30 +135,6 @@ the package with:: 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**:: pip install sublime-music diff --git a/cicd/flatpak-build/Dockerfile b/cicd/flatpak-build/Dockerfile deleted file mode 100644 index 2b17e96..0000000 --- a/cicd/flatpak-build/Dockerfile +++ /dev/null @@ -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 diff --git a/cicd/publish-gitlab-release.sh b/cicd/publish-gitlab-release.sh index 524ed65..9e1fbaf 100755 --- a/cicd/publish-gitlab-release.sh +++ b/cicd/publish-gitlab-release.sh @@ -48,29 +48,6 @@ if [[ "${milestone}" != "" ]]; then milestones=",\"milestones\":[\"${milestone}\"]" 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" data=" { diff --git a/docs/index.rst b/docs/index.rst index c66474a..01129a1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -109,30 +109,6 @@ the package with:: 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**:: pip install sublime-music diff --git a/flatpak/.gitignore b/flatpak/.gitignore deleted file mode 100644 index fa3d881..0000000 --- a/flatpak/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.flatpak-builder/ -flatpak-builder-tools/ -pypi-dependencies.json diff --git a/flatpak/app.sublimemusic.SublimeMusic.json b/flatpak/app.sublimemusic.SublimeMusic.json deleted file mode 100644 index e693920..0000000 --- a/flatpak/app.sublimemusic.SublimeMusic.json +++ /dev/null @@ -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" - } - ] - } - ] - } - ] -} diff --git a/flatpak/flatpak_build.sh b/flatpak/flatpak_build.sh deleted file mode 100755 index a277df6..0000000 --- a/flatpak/flatpak_build.sh +++ /dev/null @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 1d99c2a..797e190 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "sublime_music" -version = "0.11.12" +version = "0.11.13" description = "A native GTK *sonic client." license = "GPL-3.0-or-later" authors = ["Sumner Evans "] @@ -74,10 +74,3 @@ server = ["bottle"] [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" - -[tool.black] -exclude = ''' -( - /flatpak/ -) -''' diff --git a/setup.cfg b/setup.cfg index 9117008..2b7a0d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [flake8] 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 suppress-none-returning = True suppress-dummy-args = True @@ -56,7 +56,6 @@ log_cli_level = 10 addopts = -vvv --doctest-modules - --ignore-glob='flatpak' --ignore-glob='cicd' --cov=sublime_music --cov-report html diff --git a/shell.nix b/shell.nix index c405ffc..1892749 100644 --- a/shell.nix +++ b/shell.nix @@ -28,8 +28,6 @@ pkgs.mkShell { buildInputs = with pkgs; [ bashInteractive - flatpak - flatpak-builder gcc git glib diff --git a/sublime_music/__init__.py b/sublime_music/__init__.py index 1eb533c..665f56d 100644 --- a/sublime_music/__init__.py +++ b/sublime_music/__init__.py @@ -1 +1 @@ -__version__ = "0.11.12" +__version__ = "0.11.13"