From 50586a744c55e2786e6865fea3bbea877f349141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Janou=C5=A1ek?= Date: Sat, 4 Feb 2017 11:03:12 +0100 Subject: [PATCH] Port to Nuvola SDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * https://github.com/tiliado/nuvolasdk * https://groups.google.com/d/msg/nuvola-player-devel/NVsbGtIZf6A/x9MtIkSfDAAJ Signed-off-by: Jiří Janoušek --- .gitignore | 7 +++ CHANGELOG.md | 5 +++ Makefile | 113 ----------------------------------------------- README.md | 21 +++------ configure | 3 ++ metadata.in.json | 20 +++++++++ metadata.json | 13 ------ svg-convert.sh | 67 ---------------------------- svg-optimize.sh | 53 ---------------------- 9 files changed, 41 insertions(+), 261 deletions(-) delete mode 100644 Makefile create mode 100755 configure create mode 100644 metadata.in.json delete mode 100644 metadata.json delete mode 100755 svg-convert.sh delete mode 100755 svg-optimize.sh diff --git a/.gitignore b/.gitignore index 30af5fe..0e0bdca 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,8 @@ icons +Makefile +amazon_cloud_player.tar.gz +eu.tiliado.NuvolaAppAmazonCloudPlayer.appdata.xml +eu.tiliado.NuvolaAppAmazonCloudPlayer.data.service +eu.tiliado.NuvolaAppAmazonCloudPlayer.desktop +metadata.json +nuvola-app-amazon-cloud-player diff --git a/CHANGELOG.md b/CHANGELOG.md index f6bf6a2..7848857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Changelog ========= +5.3 - unreleased +---------------- + + * Ported to Nuvola SDK. + 5.2 - October 22, 2016 ---------------------- diff --git a/Makefile b/Makefile deleted file mode 100644 index ff31b6f..0000000 --- a/Makefile +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2014-2016 Jiří Janoušek -# Copyright 2016 Patrick Burroughs (Celti) -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# Service integration id -APP_ID = amazon_cloud_player -# Default installation destination -DEST ?= $(HOME)/.local/share/nuvolaplayer3/web_apps -# Files to be installed -INSTALL_FILES = metadata.json integrate.js -LICENSES = LICENSE -# Icon set -SOURCE_ICON ?= icons/icon.svg -SOURCE_ICON_XS ?= icons/icon-xs.svg -SOURCE_ICON_SM ?= icons/icon-sm.svg -ICON_SIZES ?= 16 22 24 32 48 64 128 256 -ICONS_DIR ?= icons -PNG_ICONS = $(foreach size,$(ICON_SIZES),$(ICONS_DIR)/$(size).png) -SCALABLE_ICON = $(ICONS_DIR)/scalable.svg - -help: - @echo "make build - build files (graphics, etc.)" - @echo "make clean - clean source directory" - @echo "make install - install to user's local directory (~/.local)" - @echo "make install DEST=/path - install to '/path' directory" - @echo "make uninstall - uninstall from user's local directory (~/.local)" - -build: $(PNG_ICONS) $(SCALABLE_ICON) - -# Create icons dir -$(ICONS_DIR): - mkdir -p $@ - -# Optimize SVG icons -$(ICONS_DIR)/%.svg: src/%.svg | $(ICONS_DIR) - ./svg-optimize.sh $< $@ - -# Generate icon 16 -$(ICONS_DIR)/16.png: $(SOURCE_ICON_XS) | $(ICONS_DIR) - ./svg-convert.sh $< 16 $@ - -# Generate icon 22 -$(ICONS_DIR)/22.png : $(SOURCE_ICON_XS) | $(ICONS_DIR) - ./svg-convert.sh $< 22 $@ - -# Generate icon 24 -$(ICONS_DIR)/24.png : $(SOURCE_ICON_XS) | $(ICONS_DIR) - ./svg-convert.sh $< 24 $@ - -# Generate icon 32 -$(ICONS_DIR)/32.png : $(SOURCE_ICON_SM) | $(ICONS_DIR) - ./svg-convert.sh $< 32 $@ - -# Generate icon 48 -$(ICONS_DIR)/48.png : $(SOURCE_ICON_SM) | $(ICONS_DIR) - ./svg-convert.sh $< 48 $@ - -# Generate icons 64 128 256 -$(ICONS_DIR)/%.png : $(SOURCE_ICON) | $(ICONS_DIR) - ./svg-convert.sh $< $* $@ - -# Copy scalable icon -$(SCALABLE_ICON) : $(SOURCE_ICON) | $(ICONS_DIR) - cp $< $@ - -# Clean built files -clean: - rm -rf icons - -# Install files -install: $(LICENSES) $(INSTALL_FILES) $(PNG_ICONS) $(SCALABLE_ICON) - # Install data - install -vCd $(DEST)/$(APP_ID)/$(ICONS_DIR) - install -vC -t $(DEST)/$(APP_ID) $(LICENSES) $(INSTALL_FILES) - install -vC -t $(DEST)/$(APP_ID)/$(ICONS_DIR) $(PNG_ICONS) $(SCALABLE_ICON) - - # Create symlinks to icons - mkdir -pv $(DEST)/../../icons/hicolor/scalable/apps || true - ln -s -f -v -T ../../../../nuvolaplayer3/web_apps/$(APP_ID)/$(SCALABLE_ICON) \ - $(DEST)/../../icons/hicolor/scalable/apps/nuvolaplayer3_$(APP_ID).svg; - for size in $(ICON_SIZES); do \ - mkdir -pv $(DEST)/../../icons/hicolor/$${size}x$${size}/apps || true ; \ - ln -s -f -v -T ../../../../nuvolaplayer3/web_apps/$(APP_ID)/$(ICONS_DIR)/$$size.png \ - $(DEST)/../../icons/hicolor/$${size}x$${size}/apps/nuvolaplayer3_$(APP_ID).png; \ - done - - -# Uninstall files -uninstall: - rm -fv $(DEST)/../../icons/hicolor/scalable/apps/nuvolaplayer3_$(APP_ID).svg - for size in $(ICON_SIZES); do \ - rm -fv $(DEST)/../../icons/hicolor/$${size}x$${size}/apps/nuvolaplayer3_$(APP_ID).png; \ - done - rm -rfv $(DEST)/$(APP_ID) diff --git a/README.md b/README.md index aa572aa..8be09dc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -Amazon Cloud Player for Nuvola Player 3 -======================================= +Amazon Cloud Player (Nuvola app) +================================ Integration of Amazon Cloud Player into your linux desktop via [Nuvola Player](https://github.com/tiliado/nuvolaplayer). @@ -10,27 +10,18 @@ Support * Report bugs and issues at . * Known issues can be found at . -Dependencies ------------- - - * GNU Make - * SVG optimizer: [Scour](https://github.com/codedread/scour) - * SVG converter: Lasem, librsvg, GraphicsMagick, ImageMagick - Installation ------------ - * Execute ``make help`` to get help. - * Execute ``make build`` to build graphics. - * Execute ``make install`` to install files to user's local directory. - * Don't execute ``make uninstall``. Why would you do that? +This project uses [Nuvola SDK](https://github.com/tiliado/nuvolasdk#create-new-project). Please refer to +the [Build a Project Using Nuvola SDK](https://github.com/tiliado/nuvolasdk#build-a-project-using-nuvola-sdk) +page in order to obtain information about dependencies and installation instructions. Copyright --------- - Copyright 2015-2016 Stephen Herbein - Copyright 2015 Steffen Coenen - - Copyright 2014-2016 Jiří Janoušek + - Copyright 2014-2017 Jiří Janoušek - Copyright 2012-2015 Alexander King - - Copyright 2016 Patrick Burroughs (Celti) - License: [2-Clause BSD-license](./LICENSE) diff --git a/configure b/configure new file mode 100755 index 0000000..799fb01 --- /dev/null +++ b/configure @@ -0,0 +1,3 @@ +#!/usr/bin/env python3 +import nuvolasdk +nuvolasdk.gen_makefile() diff --git a/metadata.in.json b/metadata.in.json new file mode 100644 index 0000000..21c9cb2 --- /dev/null +++ b/metadata.in.json @@ -0,0 +1,20 @@ +{ + "id": "amazon_cloud_player", + "name": "Amazon Cloud Player", + "maintainer_name": "Jiří Janoušek", + "maintainer_link": "https://github.com/fenryxo", + "version_major": 5, + "version_minor": 2, + "api_major": 3, + "api_minor": 0, + "categories": "AudioVideo;Audio;", + "license": "2-Clause BSD-license", + "allowed_uri": "^https?://music.amazon.[a-z.]+/#?.*$", + "build": { + "icons": [ + "src/icon.svg SCALABLE 64 128 256", + "src/icon-xs.svg 16 22 24", + "src/icon-sm.svg 32 48" + ] + } +} \ No newline at end of file diff --git a/metadata.json b/metadata.json deleted file mode 100644 index 4c37244..0000000 --- a/metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": "amazon_cloud_player", - "name": "Amazon Cloud Player", - "maintainer_name": "Jiří Janoušek", - "maintainer_link": "https://github.com/fenryxo", - "version_major": 5, - "version_minor": 2, - "api_major": 3, - "api_minor": 0, - "categories": "AudioVideo;Audio;", - "license": "2-Clause BSD-license", - "allowed_uri" : "^https?://music.amazon.[a-z.]+/#?.*$" -} diff --git a/svg-convert.sh b/svg-convert.sh deleted file mode 100755 index a51d985..0000000 --- a/svg-convert.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh -# -# Copyright 2016 Patrick Burroughs (Celti) -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -source_file="$1" -dest_size="$2" -dest_file="$3" - -exists () { - type "$1" >/dev/null 2>/dev/null -} - -divide () { - echo - | awk "{ print $1 / $2 }" -} - -if exists lasem-render; then # GNOME/Lasem - CONVERT=lasem-render -elif exists lasem-render-0.4; then # GNOME/Lasem (current version May 2016) - CONVERT=lasem-render-0.4 -elif exists rsvg-convert; then # librsvg (broken on Arch Linux as of May 2016) - CONVERT=rsvg-convert -elif exists gm; then # GraphicsMagick - CONVERT=gm -elif exists convert; then # ImageMagick - CONVERT=convert -else - echo "No supported SVG converter found! (Tried: Lasem, librsvg, GraphicsMagick, ImageMagick)" >&2 - exit 1 -fi - -case $CONVERT in - lasem-render*) - source_size=$($CONVERT --debug render "${source_file}" -o /dev/null | awk '/width/ { print $3 }') - zoom_factor=$(divide ${dest_size} ${source_size}) - $CONVERT -z ${zoom_factor} "${source_file}" -o "${dest_file}" - ;; - rsvg-convert) - $CONVERT -w ${dest_size} -h ${dest_size} "${source_file}" -o "${dest_file}" - ;; - gm) - $CONVERT convert "${source_file}" -resize ${dest_size} "${dest_file}" - ;; - convert) - $CONVERT "${source_file}" -resize ${dest_size} "${dest_file}" - ;; -esac diff --git a/svg-optimize.sh b/svg-optimize.sh deleted file mode 100755 index 309c2ad..0000000 --- a/svg-optimize.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# -# Copyright 2016 Patrick Burroughs (Celti) -# Copyright 2016 Jiří Janoušek -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -source_file="$1" -dest_file="$2" - -exists () { - type "$1" >/dev/null 2>/dev/null -} - -if exists scour; then # Scour: https://github.com/codedread/scour - CONVERT=scour -# svgo doesn't work well :-( -elif test ! -z "$SVGO_ENABLED" && exists svgo; then # svgo: https://github.com/svg/svgo - CONVERT=svgo -else - echo "No supported SVG optimizer found! Tried: " >&2 - echo "- scour: https://github.com/codedread/scour" >&2 - test ! -z "$SVGO_ENABLED" && echo "- svgo: https://github.com/svg/svgo" >&2 - exit 1 -fi - -case $CONVERT in - scour) - $CONVERT -i "${source_file}" -o "${dest_file}" --enable-viewboxing --enable-id-stripping \ - --enable-comment-stripping --shorten-ids --indent=none --remove-metadata - ;; - svgo) - $CONVERT -i "${source_file}" -o "${dest_file}" - ;; -esac