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

WIP: gmime3: init at 3.0.1 #28796

Closed
wants to merge 2 commits into from
Closed

Conversation

afrepues
Copy link
Contributor

Motivation for this change

Personal motivation is for using it with notmuch, but as it is the latest and stable release of the library, seems to be good idea to have it in the repository.

I have used the same maintainer as there is for 2.6, but I would be glad to be the maintainer.

cc @chaoflow

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
    • Linux
  • 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.

@@ -8105,6 +8105,8 @@ with pkgs;

gmime = callPackage ../development/libraries/gmime { };

gmime3 = callPackage ../development/libraries/gmime/3.0.nix { };
Copy link
Member

@Mic92 Mic92 Aug 31, 2017

Choose a reason for hiding this comment

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

Is it incompatible to gmime2? Or does it break applications using gmime2?

Copy link
Contributor Author

@afrepues afrepues Aug 31, 2017

Choose a reason for hiding this comment

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

There might be breakage, yes. They have a porting document for migrating code from v2 API to v3 API:

https://github.com/jstedfast/gmime/blob/master/PORTING

E.g.: the notmuch project just went through that, so it has to be checked on a per-project basis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will add an explanation to the commit message.

{ stdenv, fetchurl, pkgconfig, glib, gpgme, zlib, libgpgerror, libidn, gobjectIntrospection }:

stdenv.mkDerivation rec {
# TODO: libidn support, PGP/MIME support, S/MIME support
Copy link
Member

Choose a reason for hiding this comment

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

Are you want to address the TODO items before the merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, probably should have said so in the description. From a birdview it seems to me that it should be working, all the dependencies are there at least. Do you see anything missing, or that could be taken away?

Copy link
Member

Choose a reason for hiding this comment

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

According to configure this is already enabled:

  PGP/MIME support:     yes (via GpgME)
  S/MIME support:       yes (via GpgME)
  libidn support:       yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Saw that here too.

meta = {
homepage = https://github.com/jstedfast/gmime/;
description = "A C/C++ library for creating, editing and parsing MIME messages and structures";
maintainers = [ stdenv.lib.maintainers.chaoflow ];
Copy link
Member

Choose a reason for hiding this comment

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

You can add yourself as maintainer too, if you want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do that then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Though I'd like to have some coordination with @chaoflow first.

Copy link
Member

Choose a reason for hiding this comment

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

I have not seen anything from chaoflow, since I am maintainer. You can actually only add yourself as maintainer.

outputs = [ "out" "dev" ];

buildInputs = [
pkgconfig glib gpgme zlib libgpgerror libidn gobjectIntrospection
Copy link
Member

Choose a reason for hiding this comment

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

pkgconfig is already in nativeBuildInputs.

@afrepues
Copy link
Contributor Author

The reason for having the propagatedBuildInputs was that when I went to build notmuch GMime 3 would not be detected, what I found weird, but well.

@Mic92
Copy link
Member

Mic92 commented Aug 31, 2017

Can you provide an example? This is pretty unusual.

@afrepues
Copy link
Contributor Author

afrepues commented Aug 31, 2017

I am trying to build one with:

nix-shell -E 'with import <nixpkgs> { }; runCommand "dummy" { buildInputs = [ (notmuch.override { gmime = gmime3 ; }) ]; }' -I "nixpkgs=$PWD"

but keep getting the error

error: expression does not evaluate to a derivation (or a set or list of those)

So I added to pkgs/top-level/all-packages.nix:

  notmuchGMime3 = callPackage ../applications/networking/mailreaders/notmuch {  gmime = gmime3; };

And then ran nix-shell -A notmuchGMime3 -I "nixpkgs=$PWD" and it can't find GMime 3.

I just so happens that it needs GLib anyways, and if I add it to the build inputs there GMime 3 does get detected, but I suspect that packages that don't depend directly on GLib will need propagatedNativeBuildInputs or similar.

@Mic92
Copy link
Member

Mic92 commented Sep 1, 2017

notmuch explicitly requested glib:

*** Error: The dependencies of notmuch could not be satisfied. You will
need to install the following packages before being able to compile
notmuch:

  GMime 2.6 library >= 2.6.7
(including development files such as headers)
  http://spruce.sourceforge.net/gmime/

  Glib library >= 2.22 (including development
      files such as headers)
  http://ftp.gnome.org/pub/gnome/sources/glib/

So I added it.

@afrepues
Copy link
Contributor Author

afrepues commented Sep 1, 2017

I looked at the definition of GMime 2.6 and it has the propagateBuildInputs with glib in it. Then I checked out the release-17.03 branch, removed that line from GMime, tried building notmuch 0.23.5, and it can't detect neither GMime 2.6 nor GLib.

The option was introduced in f4c84b3, but nothing in the commit explains why it was introduced. At that moment notmuch still had a glib as a dependency, but it was lost in the transition from 0.20 to 0.22 in commit 58771c0, with no explanation.

The correct solution seems to be getting rid of propagateBuildDependencies in gmime and fix every package that might break, but I would settle with gmime3 being as it is for now and fix packages that use it.

What do you think?

@Mic92
Copy link
Member

Mic92 commented Sep 1, 2017

That is the problem of propagateBuildDependencies, it hide dependencies. You can use nox-review, if you want to what breaks, if remove propagateBuildDependencies from gmime.

@oxij
Copy link
Member

oxij commented Sep 5, 2017 via email

@afrepues
Copy link
Contributor Author

afrepues commented Sep 5, 2017

Seems we did some duplicate work here (I came here from notmuch ML discussion).

Yes, I recognize your username :)

Notable differences I see from my expression

  • I dropped libgpgerror from the buildInputs as there were no references to it in the source.

I hadn't looked into this, will now.

  • I left gobjectIntrospection in nativeBuildInputs in my expression. I'm not sure about which is the correct way.

That's the right way.

Also, I think changes to notmuch should be in a separate PR.

+1

My changes there are much bigger (all the tests pass!) but I'm not satisfied with them yet (see discussion in notmuch ML).

Can you create a MR or point to the branch where you have these changes, please?

@afrepues afrepues changed the title gmime3: init at 3.0.1 WIP: gmime3: init at 3.0.1 Sep 5, 2017
@oxij
Copy link
Member

oxij commented Sep 5, 2017 via email

@oxij oxij mentioned this pull request Sep 15, 2017
8 tasks
@joachifm
Copy link
Contributor

Has been merged elsewhere

@joachifm joachifm closed this Sep 17, 2017
@afrepues afrepues deleted the gmime-3-init branch October 31, 2017 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants