18 version = "2019-04-23";
19 rev = "ef4524e2239ddbb60f26e05bfba1f4f28cb7b54f";
20 sha256 = "0dl2qp686vbs160b3i9qypb7sv37phy2wn21kgzljbk3wnci3yv4";
43 src = fetchFromGitHub {
44 owner = "UltraStar-Deluxe";
45 repo = "UltraStar-Manager";
50 name = "${src.name}-patched";
56 # we don’t want prebuild binaries checked into version control!
59 # fix up main project file
60 sed -e 's|-L.*unix.*lbass.*$|-lbass|' \
61 -e "/QMAKE_POST_LINK/d" \
62 -e "s|../include/bass|${lib.getLib libbass}/include|g" \
63 -e "s|../include/taglib|${lib.getLib taglib}/include|g" \
64 -e "s|../include/mediainfo|${lib.getLib libmediainfo}/include|g" \
65 -i src/UltraStar-Manager.pro
67 # if more plugins start depending on ../../../include,
68 # it should be abstracted out for all .pro files
69 sed -e "s|../../../include/taglib|${lib.getLib taglib}/include/taglib|g" \
70 -i src/plugins/audiotag/audiotag.pro
77 patchApplicationPath = file: path: ''
78 sed -e "s|QCore.*applicationDirPath()|QString(\"${path}\")|" -i "${file}"
84 name = "ultrastar-manager-${name}-plugin-${version}";
87 buildInputs = [ qmake ] ++ buildInputs;
90 sed -e "s|DESTDIR = .*$|DESTDIR = $out|" \
91 -i src/plugins/${name}/${name}.pro
93 # plugins use the application’s binary folder (wtf)
94 for f in $(grep -lr "QCoreApplication::applicationDirPath" src/plugins); do
95 ${patchApplicationPath "$f" "\$out"}
100 cd src/plugins/${name}
104 builtPlugins = symlinkJoin {
105 name = "ultrastar-manager-plugins-${version}";
106 paths = map buildPlugin plugins;
111 pname = "ultrastar-manager";
116 sed -e "s|DESTDIR =.*$|DESTDIR = $out/bin|" \
117 -i src/UltraStar-Manager.pro
118 # patch plugin manager to point to the collected plugin folder
119 ${patchApplicationPath "src/plugins/QUPluginManager.cpp" builtPlugins}
123 find -path './src/plugins/*' -prune -type d -print0 \
124 | xargs -0 -i'{}' basename '{}' \
125 | sed -e '/shared/d' \
127 ${diffPlugins plugins "found_plugins"}
129 cd src && qmake && make
132 # is not installPhase so that qt post hooks can run
137 nativeBuildInputs = [ pkg-config ];
141 description = "Ultrastar karaoke song manager";
142 homepage = "https://github.com/UltraStar-Deluxe/UltraStar-Manager";
143 license = licenses.gpl2Only;
144 maintainers = with maintainers; [ Profpatsch ];