New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tracker-miners: switch to meson, some tweaks #39534
tracker-miners: switch to meson, some tweaks #39534
Conversation
@@ -51,6 +84,18 @@ in stdenv.mkDerivation rec { | |||
}; | |||
}; | |||
|
|||
postPatch = '' | |||
substituteInPlace src/tracker-extract/10-flac.rule --replace audio/x-flac audio/flac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, is this why GNOME Music does not see my FLAC music? Edit: Right, should have read the OP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some comments to each of this replacements so we know why it is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, this was done to prioritize GStreamer extractor: https://git.gnome.org/browse/tracker-miners/commit/?id=b830fdf96a97e6f37a25a4bb58106748c585d8e3
@@ -24,18 +20,55 @@ in stdenv.mkDerivation rec { | |||
|
|||
enableParallelBuilding = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not be needed with meson.
''; | ||
|
||
postFixup = '' | ||
${glib.dev}/bin/glib-compile-schemas $out/share/gsettings-schemas/${name}/glib-2.0/schemas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Schema compilation traditionally belongs to postInstall
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving to postInstall
causes this error:
Error opening directory “/nix/store/xck0468mbapjd98bg9dvavwx5gfyw80c-tracker-miners-2.0.4/share/gsettings-schemas/tracker-miners-2.0.4/glib-2.0/schemas”: No such file or directory
So, this path doesn't exist until fixupPhase
:-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is moved in preFixup
by glib setup hook. You would use glib-compile-schemas $out/share/glib-2.0/schemas
.
postFixup = '' | ||
${glib.dev}/bin/glib-compile-schemas $out/share/gsettings-schemas/${name}/glib-2.0/schemas | ||
wrapProgram $out/libexec/tracker-writeback \ | ||
--prefix LD_LIBRARY_PATH : $out/lib/tracker-miners-2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird too. Why does meson not produce a correct rpath? Is there an upstream bug report?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why, but it doesn't. I don't think there is an upstream bug report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like tracker-writeback
is missing install_rpath
. Shall I open a bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thank you :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libtiff libuuid libvorbis libxml2 poppler taglib upower gexiv2 | ||
mesonFlags = [ | ||
"-Ddbus_services=share/dbus-1/services" | ||
"-Dminer_rss=false" # needs libgrss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gif and jpeg seem to be missing in the new directory tree.
json-glib libcue libexif libgsf libiptcdata libjpeg libpng libseccomp libsoup | ||
libtiff libuuid libvorbis libxml2 poppler taglib upower gexiv2 | ||
mesonFlags = [ | ||
"-Ddbus_services=share/dbus-1/services" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to produce dangling symlinks in share/tracker/miners/
. We really need #37693 and ${placeholder "out"}
. For now, we could use the horrendous
preConfigure = ''
mesonFlagsArray+("-Ddbus_services=$out/share/dbus-1/services")
'';
@@ -51,6 +84,18 @@ in stdenv.mkDerivation rec { | |||
}; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
0158095
to
7c5c4a3
Compare
|
||
patches = [ | ||
(substituteAll { | ||
src = ./fix-paths.patch; | ||
inherit (gnome3) tracker; | ||
}) | ||
(fetchurl { | ||
url = https://bugzilla.gnome.org/attachment.cgi?id=371422; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you at least add a link to the tracking bug, see #39392
7c5c4a3
to
1af1ac1
Compare
@@ -51,11 +86,33 @@ in stdenv.mkDerivation rec { | |||
}; | |||
}; | |||
|
|||
postPatch = '' | |||
# audio/flac is the proper MIME type for FLAC audio (fixes GNOME Music): | |||
substituteInPlace src/tracker-extract/10-flac.rule --replace audio/x-flac audio/flac |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make more sense to investigate why the GStreamer extractor does not work. Maybe we need to add gst-plugins-good
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This incorrect MIME type still is an upstream bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But intentional one, see https://git.gnome.org/browse/tracker-miners/commit/?id=b830fdf96a97e6f37a25a4bb58106748c585d8e3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make any sense :-) libflac extractor does work, and this commit deliberately breaks it. Would make more sense to put it behind a switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, GStreamer extractor is supposed to work better according to the commit. If we manage to fix the bug, that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe open an upstream bug about this as well.
|
||
# bug (typo) in upstream meson.build | ||
substituteInPlace src/tracker-extract/meson.build \ | ||
--replace tracker_common_dep tracker_miners_common_dep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you open an upstream bug with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
''; | ||
|
||
preConfigure = '' | ||
mesonFlagsArray+=("-Ddbus_services=$out/share/dbus-1/services") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add todo comment so that we do not forget to replace it with placeholder when they are available.
|
||
patches = [ | ||
(substituteAll { | ||
src = ./fix-paths.patch; | ||
inherit (gnome3) tracker; | ||
}) | ||
# https://github.com/NixOS/nixpkgs/issues/39392 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I meant https://bugzilla.gnome.org/show_bug.cgi?id=795573.
1af1ac1
to
9a9aaf0
Compare
|
||
nativeBuildInputs = [ vala pkgconfig intltool itstool libxslt wrapGAppsHook ]; | ||
# TODO: add libgrss, libenca, libosinfo | ||
# TODO: add libgrss, libenca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to libosinfo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oversight, I'm not sure why I didn't have that.
|
||
src = fetchurl { | ||
url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz"; | ||
sha256 = "0mp9m2waii583sjgr61m1ni6py6dry11r0rzidgvw1g4cxhn89j6"; | ||
}; | ||
|
||
NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler"; | ||
LIBRARY_PATH = stdenv.lib.makeLibraryPath [ giflib ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not like this, how did this work before? Do we need to open an upstream bug?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that is an issue with our Meson hooks. We should check how autoconf AC_CHECK_LIB
handles this.
--replace tracker_common_dep tracker_miners_common_dep | ||
|
||
# fix libjpeg discovery | ||
substituteInPlace meson.build --replace "cc.find_library('libjpeg'" "dependency('libjpeg'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bah, the same thing as gif.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be upstreamed. If I put libjpeg
on LIBRARY_PATH
, build fails with exit code 1.
cda6902
to
10ef5ac
Compare
After this commit, GNOME Music should identify FLAC tracks.
10ef5ac
to
b67ff94
Compare
Thanks a lot for your thorough review! I've sent all patches upstream. |
]; | ||
|
||
LANG = "en_US.UTF-8"; # for running tests | ||
|
||
doCheck = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to the tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See libdazzle for an example how to run tests under dbus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, adding
for f in tests/functional-tests/*.py; do
patchShebangs "$f"
done
to postPatch
might be enough. We need to force python2, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue about it, we can probably ignore the tests for now https://bugzilla.gnome.org/show_bug.cgi?id=795594
|
Probably (should be considered a minor upstream bug?). |
Could you please report it and add a comment with the link? |
Done. Can I squash and merge this? |
Motivation for this change
After this commit, GNOME Music will properly display FLAC tracks.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)