Merge pull request #3119 from awiouy/librespot-114

librespot: minor fixes
This commit is contained in:
CvH 2019-01-17 13:09:01 +01:00 committed by GitHub
commit 40c4ebd82b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 18 additions and 128 deletions

View File

@ -2,7 +2,7 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="rust"
PKG_VERSION="1.30.0"
PKG_VERSION="1.31.1"
PKG_LICENSE="MIT"
PKG_SITE="https://www.rust-lang.org"
PKG_DEPENDS_TARGET="toolchain rustup.rs"

View File

@ -2,8 +2,8 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="rustup.rs"
PKG_VERSION="1.3.0"
PKG_SHA256="c0ca06b70104fed8f1de5a6f5ecfd8478e8bc03f15add8d7896b86b3b15e81e3"
PKG_VERSION="1.16.0"
PKG_SHA256="8c4ffeda2088dbdd5ea2eac8acef5ddd57dfcfe1f06a503e3da790f93161e1a6"
PKG_LICENSE="MIT"
PKG_SITE="https://www.rust-lang.org"
PKG_URL="https://github.com/rust-lang-nursery/rustup.rs/archive/$PKG_VERSION.tar.gz"

View File

@ -1,115 +0,0 @@
From 299427ade578adb04a761ebbe7aacc07367fe37a Mon Sep 17 00:00:00 2001
From: TitanSnow <sweeto@live.cn>
Date: Sat, 21 Oct 2017 13:08:33 +0800
Subject: [PATCH 1/2] fallbacks to wget if curl not installed
modify 'rustup-init.sh' to support wget
if curl not installed. This situation
often happens on some linux distribution.
---
rustup-init.sh | 28 ++++++++++++++++++++++++----
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/rustup-init.sh b/rustup-init.sh
index 7e089a1fb..a33a31377 100755
--- a/rustup-init.sh
+++ b/rustup-init.sh
@@ -9,8 +9,8 @@
# option. This file may not be copied, modified, or distributed
# except according to those terms.
-# This is just a little script that can be curled from the internet to
-# install rustup. It just does platform detection, curls the installer
+# This is just a little script that can be downloaded from the internet to
+# install rustup. It just does platform detection, downloads the installer
# and runs it.
set -u
@@ -41,8 +41,8 @@ EOF
}
main() {
+ downloader --check
need_cmd uname
- need_cmd curl
need_cmd mktemp
need_cmd chmod
need_cmd mkdir
@@ -100,7 +100,7 @@ main() {
fi
ensure mkdir -p "$_dir"
- ensure curl -sSfL "$_url" -o "$_file"
+ ensure downloader "$_url" "$_file"
ensure chmod u+x "$_file"
if [ ! -x "$_file" ]; then
printf '%s\n' "Cannot execute $_file (likely because of mounting /tmp as noexec)." 1>&2
@@ -359,4 +359,24 @@ ignore() {
"$@"
}
+# This wraps curl or wget. Try curl first, if not installed,
+# use wget instead.
+downloader() {
+ if command -v curl > /dev/null 2>&1
+ then _dld=curl
+ elif command -v wget > /dev/null 2>&1
+ then _dld=wget
+ else _dld='curl or wget' # to be used in error message of need_cmd
+ fi
+
+ if [ "$1" = --check ]
+ then need_cmd "$_dld"
+ elif [ "$_dld" = curl ]
+ then curl -sSfL "$1" -o "$2"
+ elif [ "$_dld" = wget ]
+ then wget "$1" -O "$2"
+ else err "Unknown downloader" # should not reach here
+ fi
+}
+
main "$@" || exit 1
From faa08bd786b7282500cc4162a2f428484c891130 Mon Sep 17 00:00:00 2001
From: Tibo <delor.thibault@gmail.com>
Date: Thu, 8 Mar 2018 16:41:19 +1100
Subject: [PATCH 2/2] Avoid duplication of command -v
---
rustup-init.sh | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/rustup-init.sh b/rustup-init.sh
index a33a31377..e874aa7a3 100755
--- a/rustup-init.sh
+++ b/rustup-init.sh
@@ -331,11 +331,16 @@ err() {
}
need_cmd() {
- if ! command -v "$1" > /dev/null 2>&1
+ if ! check_cmd "$1"
then err "need '$1' (command not found)"
fi
}
+check_cmd() {
+ command -v "$1" > /dev/null 2>&1
+ return $?
+}
+
need_ok() {
if [ $? != 0 ]; then err "$1"; fi
}
@@ -362,9 +367,9 @@ ignore() {
# This wraps curl or wget. Try curl first, if not installed,
# use wget instead.
downloader() {
- if command -v curl > /dev/null 2>&1
+ if check_cmd curl
then _dld=curl
- elif command -v wget > /dev/null 2>&1
+ elif check_cmd wget
then _dld=wget
else _dld='curl or wget' # to be used in error message of need_cmd
fi

View File

@ -1,3 +1,7 @@
114
- Fix discovery mode setting
- Start after Kodi
113
- Update to 96557b4

View File

@ -5,7 +5,8 @@
PKG_NAME="librespot"
PKG_VERSION="96557b4ec1c45413cdf34673695f1269f99e3545"
PKG_SHA256="09fe8f8de50d25e460bdc75d02239961336ac4db837509386ac17057b00cc49a"
PKG_REV="113"
PKG_VERSION_DATE="2018-11-07"
PKG_REV="114"
PKG_ARCH="any"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/librespot-org/librespot/"
@ -13,7 +14,7 @@ PKG_URL="https://github.com/librespot-org/librespot/archive/$PKG_VERSION.zip"
PKG_DEPENDS_TARGET="toolchain avahi pulseaudio pyalsaaudio rust"
PKG_SECTION="service"
PKG_SHORTDESC="Librespot: play Spotify through LibreELEC using a Spotify app as a remote"
PKG_LONGDESC="Librespot ($PKG_VERSION) plays Spotify through LibreELEC using the open source librespot library using a Spotify app as a remote."
PKG_LONGDESC="Librespot ($PKG_VERSION_DATE) plays Spotify through LibreELEC using the open source librespot library using a Spotify app as a remote."
PKG_TOOLCHAIN="manual"
PKG_IS_ADDON="yes"

View File

@ -63,7 +63,7 @@ init_alsa() {
case "$LIBREELEC_ARCH" in
RPi*.arm)
[ "$(readlink /proc/asound/ALSA)" == "card$index" ] && [ "$pcm_3" ] &&
[ "$(readlink /proc/asound/ALSA)" = "card$index" ] && [ "$pcm_3" ] &&
amixer -c "$index" cset name="PCM Playback Route" "$pcm_3"
;;
esac
@ -82,13 +82,13 @@ if [ -n "$ls_b" -a "$ls_b" != "-" ]; then
LIBRESPOT="$LIBRESPOT --bitrate $ls_b"
fi
if [ -n "$ls_p" -a -n "$ls_u" ]; then
if [ "$ls_a" = "true" -a -n "$ls_p" -a -n "$ls_u" ]; then
LIBRESPOT="$LIBRESPOT --disable-discovery \
--password \"$ls_p\" \
--username \"$ls_u\""
fi
if [ "$ls_m" == "Kodi" ]; then
if [ "$ls_m" = "Kodi" ]; then
LIBRESPOT="$LIBRESPOT --backend pulseaudio --device-type TV"
else
init_alsa

View File

@ -48,7 +48,7 @@ msgid "Password"
msgstr ""
msgctxt "#30112"
msgid "Discovery mode"
msgid "User mode"
msgstr ""
msgctxt "#30113"

View File

@ -7,5 +7,5 @@
<setting id="ls_b" label="30102" type="labelenum" lvalues="30103|30104|30105|30106" />
<setting id="ls_a" label="30112" type="bool" default="false" />
<setting id="ls_u" label="30110" type="text" subsetting="true" visible="eq(-1,true)" default="" />
<setting id="ls_p" label="30111" type="text" subsetting="true" visible="eq(-2,true)" default="" />
<setting id="ls_p" label="30111" type="text" subsetting="true" visible="eq(-2,true)" default="" option="hidden" />
</settings>

View File

@ -1,7 +1,7 @@
[Unit]
Description=librespot
After=kodi.service network-online.target sound.target
Requires=kodi.service network-online.target sound.target
Wants=kodi.service
After=kodi.service
[Service]
EnvironmentFile=/storage/.kodi/addons/service.librespot/bin/librespot.env
@ -10,4 +10,4 @@ ExecStopPost=/usr/bin/pactl suspend-sink "$LS_SINK" 1
Restart=on-failure
[Install]
WantedBy=kodi.target
WantedBy=kodi.service