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
claws-mail: add support for python plugin #41357
Conversation
@@ -41,18 +41,19 @@ stdenv.mkDerivation rec { | |||
|
|||
outputs = [ "out" "dev" ]; | |||
|
|||
patches = [ ./mime.patch ]; | |||
patches = [ ./mime.patch ./disable-python-detection.patch ]; |
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 happens without the patch?
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.
Without the patch, it checks for python and tries to dlopen libpython27.so during configure
and fails, therefore disables the python plugin.
Without this check, it still compiles and works fine. The better way might be fixing the check, but on the other hand, we know python will be there, since it's a dependency.
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 can provide you the config.log, if you want to. The relevant part looks something like:
| #include <dlfcn.h>
| #define PYTHON_SO_FILE "libpython2.7.so"
|
| int
| main ()
| {
| if (!dlopen(PYTHON_SO_FILE, RTLD_NOW | RTLD_GLOBAL)) return 1; return 0;
| ;
| return 0;
| }
|
configure:22304: result: no
configure:22306: WARNING: Could not find Python shared libary: libpython2.7.so. Maybe you need to install development packages for Python.```
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.
Ok then the following snippet will be slightly shorter and do not require to maintain a patch:
preConfigure = ''
# autotools check tries to dlopen libpython as a requirement for the python plugin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${python}/lib
'';
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.
Done. Thanks for all your input! This is definitely cleaner.
, curl, dbus, dbus-glib, enchant, gtk2, gnutls, gnupg, gpgme, hicolor-icon-theme | ||
, libarchive, libcanberra-gtk2, libetpan, libnotify, libsoup, libxml2, networkmanager | ||
, openldap , perl, pkgconfig, poppler, python, shared-mime-info, webkitgtk24x-gtk2 | ||
, openldap, perl, pkgconfig, poppler, python2Packages, shared-mime-info, webkitgtk24x-gtk2 |
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.
python2Packages
is the same as python.pkgs
, please use python
for Python and python.pkgs
instead of python2Packages
.
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.
done
|
||
postPatch = '' | ||
substituteInPlace src/procmime.c \ | ||
--subst-var-by MIMEROOTDIR ${shared-mime-info}/share | ||
''; | ||
|
||
nativeBuildInputs = [ pkgconfig wrapGAppsHook ]; | ||
nativeBuildInputs = [ autoreconfHook pkgconfig wrapGAppsHook python2Packages.wrapPython ]; | ||
propagatedBuildInputs = with python2Packages; [ python ] ++ optional enablePluginPython [ pygtk pygobject2 ]; |
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.
You should use optionals
with lists.
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.
and done, I think. Maybe I misunderstood you.
Thanks! |
Motivation for this change
I personally use this plugin, since the distribution I migrated from supported it.
Also, it was marked as TODO, so someone wanted to do this at some point but did not get around to it.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)Admittedly, the solution I chose, patching out their python detection and enabling it anyways, is not very elegant, but it works.