Skip to content

Commit

Permalink
navidrome: initial package release
Browse files Browse the repository at this point in the history
- add navidrome 0.47.5
- patch taglib wrapper c++ code for DSM 6
  • Loading branch information
hgy59 committed Jul 30, 2022
1 parent f823679 commit 9d43691
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 0 deletions.
38 changes: 38 additions & 0 deletions cross/navidrome/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
PKG_NAME = navidrome
PKG_VERS = 0.47.5
PKG_EXT = tar.gz
PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/navidrome/navidrome/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

BUILD_DEPENDS = native/go native/nodejs
DEPENDS = cross/taglib

# C++11 compiler required
UNSUPPORTED_ARCHS = $(ARMv5_ARCHS)
# go does not support ppc archs
UNSUPPORTED_ARCHS += $(PPC_ARCHS)

HOMEPAGE = https://www.navidrome.org/
COMMENT = ������☁ Modern Music Server and Streamer compatible with Subsonic/Airsonic.
LICENSE = GPL-3.0 License

PRE_COMPILE_TARGET = navidrome_pre_compile
COMPILE_TARGET = navidrome_compile

CGO_ENABLED = 1
GO_BIN_DIR = $(WORK_DIR)/$(PKG_DIR)/$(PKG_NAME)

include ../../mk/spksrc.cross-go.mk

ENV += NPM_CONFIG_USER=root
PATH := $(WORK_DIR)/../../../native/nodejs/work-native/node/bin:$(PATH)

.PHONY: navidrome_pre_compile
navidrome_pre_compile:
@$(RUN) $(MAKE) setup

.PHONY: navidrome_compile
navidrome_compile:
@$(RUN) $(MAKE) buildall
1 change: 1 addition & 0 deletions cross/navidrome/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin:bin/navidrome
3 changes: 3 additions & 0 deletions cross/navidrome/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
navidrome-0.47.5.tar.gz SHA1 9df716b6ca6f6497fca264f2a40f38d193a9f1b4
navidrome-0.47.5.tar.gz SHA256 68f9f013d8e17a769770cdd7a1f4d9fc279b3d5e83418bbb54018781de96ab76
navidrome-0.47.5.tar.gz MD5 5012c0fbd543be2fb044ee688df12b32
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# fix for older gcc (like 4.9.x)
# - mp3 tags: use explicit type for mp3File->ID3v2Tag()->frameListMap()
# as older gcc cannot dereference std::initializer_list correctly
# - mp4 tags: use mp4File->tag()->item instead of mp4File->tag()->itemMap() to access covers
# as side effect this fixes the build with older gcc
#
--- scanner/metadata/taglib/taglib_wrapper.cpp.orig 2022-01-22 01:35:19.000000000 +0100
+++ scanner/metadata/taglib/taglib_wrapper.cpp 2022-07-30 13:44:25.711760171 +0200
@@ -95,7 +95,7 @@
if (TagLib::MPEG::File *
mp3File{dynamic_cast<TagLib::MPEG::File *>(f.file())}) {
if (mp3File->ID3v2Tag()) {
- const auto &frameListMap{mp3File->ID3v2Tag()->frameListMap()};
+ const TagLib::ID3v2::FrameListMap &frameListMap{mp3File->ID3v2Tag()->frameListMap()};
hasCover = !frameListMap["APIC"].isEmpty();
}
}
@@ -107,8 +107,11 @@
// ----- MP4
else if (TagLib::MP4::File *
mp4File{dynamic_cast<TagLib::MP4::File *>(f.file())}) {
- auto &coverItem{mp4File->tag()->itemMap()["covr"]};
- TagLib::MP4::CoverArtList coverArtList{coverItem.toCoverArtList()};
+ if (!mp4File->tag()->itemMap().contains("covr")) {
+ return false;
+ }
+ auto const &coverItem = mp4File->tag()->item("covr");
+ auto const coverArtList = coverItem.toCoverArtList();
hasCover = !coverArtList.isEmpty();
}
// ----- Ogg
41 changes: 41 additions & 0 deletions spk/navidrome/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
SPK_NAME = navidrome
SPK_VERS = 0.47.5
SPK_REV = 1
SPK_ICON = src/navidrome.png

DEPENDS = cross/navidrome

# C++11 compiler required
UNSUPPORTED_ARCHS = $(ARMv5_ARCHS)
# go does not support ppc archs
UNSUPPORTED_ARCHS += $(PPC_ARCHS)

SPK_DEPENDS = "ffmpeg"

MAINTAINER = hgy59
HOMEPAGE = https://www.navidrome.org/
DESCRIPTION = 🎧☁ Modern Music Server and Streamer compatible with Subsonic/Airsonic. It gives you freedom to listen to your music collection from any browser or mobile device.
LICENSE = GPLv3
DISPLAY_NAME = Navidrome
CHANGELOG = "Initial package release"

STARTABLE = yes
SERVICE_SETUP = src/service-setup.sh

SERVICE_USER = auto
SERVICE_PORT = 4533
SERVICE_PORT_TITLE = Navidrome (HTTP)
ADMIN_PORT = $(SERVICE_PORT)

WIZARDS_DIR = src/wizard
SERVICE_WIZARD_SHARE = wizard_music_folder
USE_DATA_SHARE_WORKER = yes

POST_STRIP_TARGET = navidrome_extra_install

include ../../mk/spksrc.spk.mk

.PHONY: navidrome_extra_install
navidrome_extra_install:
install -d -m 755 $(STAGING_DIR)/var
install -m 644 src/navidrome.toml $(STAGING_DIR)/var/
Binary file added spk/navidrome/src/navidrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions spk/navidrome/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

CONFIG_FILE="${SYNOPKG_PKGVAR}/navidrome.toml"
SERVICE_COMMAND="${SYNOPKG_PKGDEST}/bin/navidrome --port ${SERVICE_PORT} --configfile=${CONFIG_FILE}"
SVC_WRITE_PID=y
SVC_BACKGROUND=y

# navidrome executable does not contain rpath
export LD_LIBRARY_PATH="${SYNOPKG_PKGDEST}/lib"

service_postinst ()
{
# update config with values from wizard variables
sed -e "s|@@wizard_music_folder@@|${wizard_music_volume}/${wizard_music_folder}|g" \
-i "${CONFIG_FILE}"
}
57 changes: 57 additions & 0 deletions spk/navidrome/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[{
"step_title": "Basic configuration",
"items": [{
"type": "combobox",
"desc": "Please select a volume to use for the music folder",
"subitems": [{
"key": "wizard_music_volume",
"desc": "Volume name",
"displayField": "display_name",
"valueField": "volume_path",
"editable": false,
"mode": "remote",
"api_store": {
"api": "SYNO.Core.Storage.Volume",
"method": "list",
"version": 1,
"baseParams": {
"limit": -1,
"offset": 0,
"location": "internal"
},
"root": "volumes",
"idProperty": "volume_path",
"fields": [
"display_name",
"volume_path"
]
},
"validator": {
"fn": "{console.log(arguments);return true;}"
}
}
]
}, {
"type": "textfield",
"desc": "Shared music folder. This must be a name for the shared folder only, without any path. This share is created at installation when it does not already exist.",
"subitems": [{
"key": "wizard_music_folder",
"desc": "Shared music folder",
"defaultValue": "music",
"validator": {
"allowBlank": false,
"regex": {
"expr": "/^[^<>: */?\"]*/",
"errorText": "Share name must be a folder name only. Path separators, spaces and other special chars are not allowed."
}
}
}
]
}, {
"desc": ""
}, {
"desc": "Navidrome runs as internal service user <b>'sc-navidrome'</b> in DSM. The shared music folder above is configured at installation time to be accessible by this user.<p>If you manually change the music folder, make sure 'sc-navidrome' has permissions to access it.<p>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
}
]
}
]

0 comments on commit 9d43691

Please sign in to comment.