2021-01-17 03:51:22 +00:00
|
|
|
|
{ lib, mkDerivation, fetchFromGitHub, pkg-config, symlinkJoin, qmake, diffPlugins
|
2017-06-18 21:38:33 +00:00
|
|
|
|
, qtbase, qtmultimedia, taglib, libmediainfo, libzen, libbass }:
|
2017-06-14 09:29:31 +00:00
|
|
|
|
|
|
|
|
|
let
|
2019-05-06 23:33:18 +00:00
|
|
|
|
version = "2019-04-23";
|
|
|
|
|
rev = "ef4524e2239ddbb60f26e05bfba1f4f28cb7b54f";
|
|
|
|
|
sha256 = "0dl2qp686vbs160b3i9qypb7sv37phy2wn21kgzljbk3wnci3yv4";
|
2017-06-14 09:29:31 +00:00
|
|
|
|
buildInputs = [ qtbase qtmultimedia taglib libmediainfo libzen libbass ];
|
|
|
|
|
|
|
|
|
|
plugins = [
|
|
|
|
|
"albumartex"
|
|
|
|
|
"amazon"
|
|
|
|
|
"audiotag"
|
|
|
|
|
"cleanup"
|
|
|
|
|
"freecovers"
|
|
|
|
|
"lyric"
|
|
|
|
|
"preparatory"
|
|
|
|
|
"rename"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
patchedSrc =
|
|
|
|
|
let src = fetchFromGitHub {
|
|
|
|
|
owner = "UltraStar-Deluxe";
|
|
|
|
|
repo = "UltraStar-Manager";
|
|
|
|
|
inherit rev sha256;
|
|
|
|
|
};
|
2019-10-08 11:08:45 +00:00
|
|
|
|
in mkDerivation {
|
2017-06-14 09:29:31 +00:00
|
|
|
|
name = "${src.name}-patched";
|
|
|
|
|
inherit src;
|
2021-07-20 15:21:05 +00:00
|
|
|
|
|
|
|
|
|
dontInstall = true;
|
2017-06-14 09:29:31 +00:00
|
|
|
|
|
2019-10-08 11:08:45 +00:00
|
|
|
|
patchPhase = with lib; ''
|
2017-06-14 09:29:31 +00:00
|
|
|
|
# we don’t want prebuild binaries checked into version control!
|
|
|
|
|
rm -rf lib include
|
|
|
|
|
|
|
|
|
|
# fix up main project file
|
|
|
|
|
sed -e 's|-L.*unix.*lbass.*$|-lbass|' \
|
|
|
|
|
-e "/QMAKE_POST_LINK/d" \
|
|
|
|
|
-e "s|../include/bass|${getLib libbass}/include|g" \
|
|
|
|
|
-e "s|../include/taglib|${getLib taglib}/include|g" \
|
|
|
|
|
-e "s|../include/mediainfo|${getLib libmediainfo}/include|g" \
|
|
|
|
|
-i src/UltraStar-Manager.pro
|
|
|
|
|
|
|
|
|
|
# if more plugins start depending on ../../../include,
|
|
|
|
|
# it should be abstracted out for all .pro files
|
|
|
|
|
sed -e "s|../../../include/taglib|${getLib taglib}/include/taglib|g" \
|
|
|
|
|
-i src/plugins/audiotag/audiotag.pro
|
|
|
|
|
|
|
|
|
|
mkdir $out
|
|
|
|
|
mv * $out
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
patchApplicationPath = file: path: ''
|
|
|
|
|
sed -e "s|QCore.*applicationDirPath()|QString(\"${path}\")|" -i "${file}"
|
|
|
|
|
'';
|
|
|
|
|
|
2019-10-08 11:08:45 +00:00
|
|
|
|
buildPlugin = name: mkDerivation {
|
2017-06-14 09:29:31 +00:00
|
|
|
|
name = "ultrastar-manager-${name}-plugin-${version}";
|
|
|
|
|
src = patchedSrc;
|
|
|
|
|
|
2017-06-18 17:32:51 +00:00
|
|
|
|
buildInputs = [ qmake ] ++ buildInputs;
|
2017-06-14 09:29:31 +00:00
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
sed -e "s|DESTDIR = .*$|DESTDIR = $out|" \
|
|
|
|
|
-i src/plugins/${name}/${name}.pro
|
|
|
|
|
|
|
|
|
|
# plugins use the application’s binary folder (wtf)
|
|
|
|
|
for f in $(grep -lr "QCoreApplication::applicationDirPath" src/plugins); do
|
|
|
|
|
${patchApplicationPath "$f" "\$out"}
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
cd src/plugins/${name}
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
builtPlugins =
|
|
|
|
|
symlinkJoin {
|
|
|
|
|
name = "ultrastar-manager-plugins-${version}";
|
|
|
|
|
paths = map buildPlugin plugins;
|
|
|
|
|
};
|
|
|
|
|
|
2019-10-08 11:08:45 +00:00
|
|
|
|
in mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
|
pname = "ultrastar-manager";
|
|
|
|
|
inherit version;
|
2017-06-14 09:29:31 +00:00
|
|
|
|
src = patchedSrc;
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
sed -e "s|DESTDIR =.*$|DESTDIR = $out/bin|" \
|
|
|
|
|
-i src/UltraStar-Manager.pro
|
|
|
|
|
# patch plugin manager to point to the collected plugin folder
|
|
|
|
|
${patchApplicationPath "src/plugins/QUPluginManager.cpp" builtPlugins}
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
|
find -path './src/plugins/*' -prune -type d -print0 \
|
|
|
|
|
| xargs -0 -i'{}' basename '{}' \
|
|
|
|
|
| sed -e '/shared/d' \
|
|
|
|
|
> found_plugins
|
|
|
|
|
${diffPlugins plugins "found_plugins"}
|
|
|
|
|
|
|
|
|
|
cd src && qmake && make
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# is not installPhase so that qt post hooks can run
|
|
|
|
|
preInstall = ''
|
|
|
|
|
make install
|
|
|
|
|
'';
|
|
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-06-14 09:29:31 +00:00
|
|
|
|
inherit buildInputs;
|
|
|
|
|
|
2019-10-08 11:08:45 +00:00
|
|
|
|
meta = with lib; {
|
2017-06-14 09:29:31 +00:00
|
|
|
|
description = "Ultrastar karaoke song manager";
|
2020-04-01 01:11:51 +00:00
|
|
|
|
homepage = "https://github.com/UltraStar-Deluxe/UltraStar-Manager";
|
2017-06-14 09:29:31 +00:00
|
|
|
|
license = licenses.gpl2;
|
2018-02-12 06:18:12 +00:00
|
|
|
|
maintainers = with maintainers; [ Profpatsch ];
|
2017-06-14 09:29:31 +00:00
|
|
|
|
};
|
|
|
|
|
}
|