Ultrastar (#26524)
* ultrastardx-beta: init at 1.3.5 * libbass, libbass_fx: init at 24 * ultrastar-creator: init at 2017-04-12 * buildSupport/plugins.nix: add diffPlugins Helper function to compare expected plugin lists to the found plugins. * ultrastar-manager: init at 2017-05-24 The plugins are built in their own derivations, speeding up (re-)compilation. The `diffPlugins` function from `beets` is reused to test for changes in the plugin list on updates. * beets: switch to diffPlugins The function is basically just extracted for better reusability.
This commit is contained in:
committed by
Joachim Schiele
parent
f6fbbabcb7
commit
79dd4deda5
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchFromGitHub, writeScript, glibcLocales
|
||||
{ stdenv, fetchFromGitHub, writeScript, glibcLocales, diffPlugins
|
||||
, pythonPackages, imagemagick, gobjectIntrospection, gst_all_1
|
||||
|
||||
, enableAcousticbrainz ? true
|
||||
@@ -158,20 +158,13 @@ in pythonPackages.buildPythonApplication rec {
|
||||
doCheck = true;
|
||||
|
||||
preCheck = ''
|
||||
(${concatMapStrings (s: "echo \"${s}\";") allPlugins}) \
|
||||
| sort -u > plugins_defined
|
||||
find beetsplug -mindepth 1 \
|
||||
\! -path 'beetsplug/__init__.py' -a \
|
||||
\( -name '*.py' -o -path 'beetsplug/*/__init__.py' \) -print \
|
||||
| sed -n -re 's|^beetsplug/([^/.]+).*|\1|p' \
|
||||
| sort -u > plugins_available
|
||||
|
||||
if ! mismatches="$(diff -y plugins_defined plugins_available)"; then
|
||||
echo "The the list of defined plugins (left side) doesn't match" \
|
||||
"the list of available plugins (right side):" >&2
|
||||
echo "$mismatches" >&2
|
||||
exit 1
|
||||
fi
|
||||
${diffPlugins allPlugins "plugins_available"}
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
|
||||
41
pkgs/tools/misc/ultrastar-creator/default.nix
Normal file
41
pkgs/tools/misc/ultrastar-creator/default.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ stdenv, fetchFromGitHub
|
||||
, qmakeHook, qtbase, makeQtWrapper
|
||||
, pkgconfig, taglib, libbass, libbass_fx }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ultrastar-creator-${version}";
|
||||
version = "2017-04-12";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "UltraStar-Deluxe";
|
||||
repo = "UltraStar-Creator";
|
||||
rev = "ac519a003f8283bfbe5e2d8e9cdff3a3faf97001";
|
||||
sha256 = "00idr8a178gvmylq722n13bli59kpxlsy5d8hlplqn7fih48mnzi";
|
||||
};
|
||||
|
||||
postPatch = with stdenv.lib; ''
|
||||
# we don’t want prebuild binaries checked into version control!
|
||||
rm -rf lib include
|
||||
sed -e "s|DESTDIR =.*$|DESTDIR = $out/bin|" \
|
||||
-e 's|-L".*unix"||' \
|
||||
-e "/QMAKE_POST_LINK/d" \
|
||||
-e "s|../include/bass|${getLib libbass}/include|g" \
|
||||
-e "s|../include/bass_fx|${getLib libbass_fx}/include|g" \
|
||||
-e "s|../include/taglib|${getLib taglib}/include|g" \
|
||||
-i src/UltraStar-Creator.pro
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
cd src
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ qmakeHook makeQtWrapper pkgconfig ];
|
||||
buildInputs = [ qtbase taglib libbass libbass_fx ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Ultrastar karaoke song creation tool";
|
||||
homepage = https://github.com/UltraStar-Deluxe/UltraStar-Creator;
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ profpatsch ];
|
||||
};
|
||||
}
|
||||
121
pkgs/tools/misc/ultrastar-manager/default.nix
Normal file
121
pkgs/tools/misc/ultrastar-manager/default.nix
Normal file
@@ -0,0 +1,121 @@
|
||||
{ stdenv, fetchFromGitHub, pkgconfig, symlinkJoin, qmakeHook, diffPlugins
|
||||
, qtbase, qtmultimedia, makeQtWrapper
|
||||
, taglib, libmediainfo, libzen, libbass }:
|
||||
|
||||
let
|
||||
version = "2017-05-24";
|
||||
rev = "eed5dc41c849ab29b2dee37d97852fffdb45e390";
|
||||
sha256 = "1ymdgaffazndg9vhh47qqjr5873ld7j066hycp670r08bm519ysg";
|
||||
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;
|
||||
};
|
||||
in stdenv.mkDerivation {
|
||||
name = "${src.name}-patched";
|
||||
inherit src;
|
||||
phases = [ "unpackPhase" "patchPhase" ];
|
||||
|
||||
patchPhase = with stdenv.lib; ''
|
||||
# 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}"
|
||||
'';
|
||||
|
||||
buildPlugin = name: stdenv.mkDerivation {
|
||||
name = "ultrastar-manager-${name}-plugin-${version}";
|
||||
src = patchedSrc;
|
||||
|
||||
buildInputs = [ qmakeHook ] ++ buildInputs;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
name = "ultrastar-manager-${version}";
|
||||
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
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ makeQtWrapper pkgconfig ];
|
||||
inherit buildInputs;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Ultrastar karaoke song manager";
|
||||
homepage = https://github.com/UltraStar-Deluxe/UltraStar-Manager;
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ profpatsch ];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user