Skip to content
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

Merged
merged 3 commits into from May 15, 2018

Conversation

lukateras
Copy link
Member

@lukateras lukateras commented Apr 26, 2018

Motivation for this change

After this commit, GNOME Music will properly display FLAC tracks.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@lukateras lukateras requested a review from jtojnar April 26, 2018 09:54
@GrahamcOfBorg GrahamcOfBorg added 6.topic: GNOME GNOME desktop environment and its underlying platform 10.rebuild-darwin: 0 10.rebuild-linux: 11-100 labels Apr 26, 2018
@@ -51,6 +84,18 @@ in stdenv.mkDerivation rec {
};
};

postPatch = ''
substituteInPlace src/tracker-extract/10-flac.rule --replace audio/x-flac audio/flac
Copy link
Contributor

@jtojnar jtojnar Apr 26, 2018

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -24,18 +20,55 @@ in stdenv.mkDerivation rec {

enableParallelBuilding = true;
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Member Author

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 :-(

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thank you :-)

Copy link
Contributor

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
Copy link
Contributor

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"
Copy link
Contributor

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.

@lukateras lukateras force-pushed the 20180426.094748/tracker-miners branch from 0158095 to 7c5c4a3 Compare April 26, 2018 11:12

patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit (gnome3) tracker;
})
(fetchurl {
url = https://bugzilla.gnome.org/attachment.cgi?id=371422;
Copy link
Contributor

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

@lukateras lukateras force-pushed the 20180426.094748/tracker-miners branch from 7c5c4a3 to 1af1ac1 Compare April 26, 2018 11:29
@@ -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
Copy link
Contributor

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.

Copy link
Member Author

@lukateras lukateras Apr 26, 2018

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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
Copy link
Contributor

@jtojnar jtojnar Apr 26, 2018

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?

Copy link
Member Author

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")
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukateras lukateras force-pushed the 20180426.094748/tracker-miners branch from 1af1ac1 to 9a9aaf0 Compare April 26, 2018 11:42

nativeBuildInputs = [ vala pkgconfig intltool itstool libxslt wrapGAppsHook ];
# TODO: add libgrss, libenca, libosinfo
# TODO: add libgrss, libenca
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to libosinfo?

Copy link
Member Author

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 ];
Copy link
Contributor

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?

Copy link
Member Author

@lukateras lukateras Apr 26, 2018

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'"
Copy link
Contributor

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.

Copy link
Member Author

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.

@lukateras lukateras force-pushed the 20180426.094748/tracker-miners branch 3 times, most recently from cda6902 to 10ef5ac Compare April 26, 2018 12:22
After this commit, GNOME Music should identify FLAC tracks.
@lukateras lukateras force-pushed the 20180426.094748/tracker-miners branch from 10ef5ac to b67ff94 Compare April 26, 2018 12:30
@lukateras
Copy link
Member Author

Thanks a lot for your thorough review! I've sent all patches upstream. LIBRARY_PATH workaround still remains, but I've opened #39547 and linked to it.

];

LANG = "en_US.UTF-8"; # for running tests

doCheck = true;
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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

@jtojnar
Copy link
Contributor

jtojnar commented Apr 27, 2018

$out/share/tracker/miners/org.freedesktop.Tracker1.Miner.RSS.service probably should not be installed.

@lukateras
Copy link
Member Author

Probably (should be considered a minor upstream bug?).

@jtojnar
Copy link
Contributor

jtojnar commented May 15, 2018

Could you please report it and add a comment with the link?

@lukateras
Copy link
Member Author

Done. Can I squash and merge this?

@lukateras lukateras merged commit edbce18 into NixOS:master May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: GNOME GNOME desktop environment and its underlying platform 10.rebuild-darwin: 0 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants