While developing with Vala I found myself writing some stuff over and over again. So I decided to make a library out of it: Libbutter. Currently only available via git on http://github.com/phako/butter
Butter
June 29th, 2009Unverständnis …
June 17th, 2009… strahlt einem oft entgegen, wenn man erzählt, dass man jeden Tag die 1,5km von der Bahnstation zur Firma läuft. Und das auch noch freiwillig.
Herr, schmeiß Hirn vom Himmel…
June 12th, 2009Liebe CDU,
in Zeiten, in denen Ihr unsere Grundrechte gerne mal mit Füßen tretet und euer Innenminister wahrscheinlich am liebsten Kameras in jedem Privathaushalt installieren würde, sorgt IHR EUCH UM EURE Sicherheit und Privatsphäre? Ihr seid peinlich, ernsthaft…
Mir ist schleierhaft, warum euch eigentlich immer noch Leute freiwillig wählen.
Mit nicht ganz so freundlichen Grüßen
Samba as AD client
May 18th, 2009If net ads join ever again fails with Failed to join domain: failed to find DC for domain just throw the stupid NetBIOS name of the ActiveDirectory server into the hosts file, will you? Sheesh…
GUPnP on windows howto
May 15th, 2009I threw together some instructions on how to build the GUPnP stack on windows:
Trekstor Vibez & Jaunty
May 8th, 2009If you use one of the famous beta firmwares for your Trekstor vibez and have jaunty installed, you may experience some weird behaviour if you plugin in your player and hope that a folder pops up showing you your device’s contents.
If you configured your device’s transfer mode to “Mass Storage only” it is likely that the device will not show up and crash on shutdown at the “Saving Settings” screen with a bold “Saving”.
Reason is: in /etc/udev/rules.d/45-libmtp7.rules this device’s USB id is hard-wired to be an MTP device. Just comment the two lines with {idVendor}=="066f" and everything is fine again.
On the other hand the MTP transfer mode seems to work quite well now.
gupnp on win32
April 26th, 2009KWT
April 17th, 2009Heute ist der Tag des großen Medienkotzens, großer Falschinformation und Feierei
Return of the struggle
April 16th, 2009If you ever wondered what parameters you could pass in that funny xmllet <GnupgKeyParms></GnupgKeyParms> when using gpgme_op_genkey:
The answer to that is
- in the gnupg source, file
g10/keygen.c, line 2363 - at http://lists.gnupg.org/pipermail/gnupg-users/2007-February/030330.html
- at
doc/DETAILS, line 716.
Eternal struggle
April 16th, 2009My current task is evaluation crypto (here: OpenPGP) solutions for Microsoft Windows; of course including GnuPG.
Well, what do I say. While there is a nice installer for GnuPG on Windows available (either here or here), try to find one for the gpgme supporting library… (including header and .lib import files for Visual Studio, that is).
You can guess… It’s all about build-your-own-stuff. It basically boils down to this:
Preparations
- Create a directory to collect all the stuff you will need (e.g.
C:\gpgmewithbin,includeandlibsub folders) - Get mingw and install it
- Get MSYS and install it
- Download libgpg-error and extract it
- Download gpgme and extract it
Compiling libgpg-error
- In the MSYS bash, change to the directory you extracted libgpg-error into and run
./configure --prefix=/mingw && make install - Call
strip src/.libs/libgpg-error-0.dll src/gpg-error.exeas MSVC can’t use gcc’s debug info anyway - Copy
src/gpg-error.exe and src/.libs/libgpg-error-0.dllto the bin directory created above - Copy
src/.libs/libgpg-error-0.dll.deftolib/libgpg-error-0.def(note the renaming; otherwise your program will look for alibgpg-error-0.dll.dll) - Open the Visual Studio Command Prompt
- Call
lib /machine:i386 /def:lib\libgpg-error-0.def /out:lib\libgpg-error-0.libto create the import library - Copy
include/gpg-error.hto include
Compiling gpgme
- In the MSYS bash, run
./configure --prefix=/mingw && make - Call
strip src/gpgme-w32spawn.exe src/.libs/libgpgme-11.dll - Copy
src/gpgme-w32spawn.exetobinNote: To use the gpgme library, this binary has to live either in the installation dir of gpg (set in windows registry keyHKLM\Software\GNU\GnuPG\Installation Directory) or in%PROGRAMFILES%\GNU\GnuPG. Otherwise gpgme will not work! - Copy
src/.libs/libgpgme-11.dllto bin andsrc/.libs/libgpgme-11.dll.deftolib/libgpgme-11.def(Once again, note the renaming) - Call
lib /machine:i386 /def:lib\libgpgme-11.def /out:lib\libgpgme-11.libto create the import library - Copy
include/gpgme.htoinclude
Optional: Creating the documentation
I was not able to create the documentation properly using cygwin so I did this on a Linux host. Install a TeX distribution of your choice as well as texinfo (for Debian Lenny this would mean installing the packages texinfo, texi2html and texlive). Call make pdf in the doc subdir to generate the PDF documentation and manually call texi2html gpgme.texi for a HTML document.
Summary
Now you can add the lib dir to your Visual Studio linker settings and the include dir to your C/C++ common settings. To make gpgme work, be sure you have the gpgme-w32spawn.exe installed properly as noted above.
I hope this helps to guide one or another through the struggle of getting gpgme on windows.
Q&A
-
Q: gpgme does not find libgpg-error
A: You did not call
make installafter compiling it -
Q: My program is looking for
{libgpg-error-0.dll.dll|libgpgme-11.dll.dll}A: You did not rename the .def file before calling
lib.exe -
Q: I did everything you said, but when I run my program,
gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP)fails withGPG_ERR_INV_ENGINE. If I check the engine info,info->versionis emptyA: First of all, check if you copied
gpgme-w32spawn.exeto the correct directory. If this is the case, actually, I have no idea what went wrong