Compiling GnuPG 2.0.1 on MacOS X
Peter Pentchev
roam at ringlet.net
Wed Feb 14 09:22:19 CET 2007
On Tue, Feb 13, 2007 at 07:03:24PM +0000, Benjamin Donnachie wrote:
> Benjamin Donnachie wrote:
> > How embarrassing... my mistake - I was still using the old patched version!
>
> Ah-ha! That's better! As a quick test I threw together the following
> helper application:
>
> /*
> ** Mac OS fails to process bundle information correctly
> ** for pinentry-mac.
> **
> ** This quick hack attempts to address that.
> **
> */
>
> #include <stdio.h>
>
> int main()
> {
> return system
> ("/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac");
> }
Is there any reason for not using execv(3)?
(disclaimer: not tested on PPC or MacOS X or, really, anything besides
FreeBSD/i386 and Debian/i386...)
#include <stdio.h>
#include <unistd.h>
#ifndef __unused
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
#define __unused __attribute__((unused))
#else /* __GNUC__ */
#if defined(__INTEL_COMPILER)
#define __unused __attribute__((__unused__))
#else /* __INTEL_COMPILER */
#define __unused
#endif /* __INTEL_COMPILER */
#endif /* __GNUC__ */
#endif /* __unused */
#define APP "/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac"
int main(int argc __unused, char * const argv[])
{
execv(APP, argv);
perror("execv");
return (1);
}
Of course, you may skip the whole __unused dance if you know that you
are only ever going to compile it on a single OS/arch/compiler - or if
you don't care about compiler warnings :)
> Compile this using "gcc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch
> i386 -arch ppc pinentry-helper.c -o pinentry-helper" (Or download from
> http://www.py-soft.co.uk/~benjamin/download/mac-gpg/pinentry-helper) and
> copy it to "/Applications/pinentry-mac.app/Contents/MacOS/pinentry-helper".
>
> Then add the following to ~/.gnupg/gpg-agent.conf:
>
> pinentry-program
> "/Applications/pinentry-mac.app/Contents/MacOS/pinentry-helper"
>
> Unpatched gpg-agent (admittedly v1.9.21) correctly invokes pinentry-mac,
> reading the GUI bundle information correctly.
>
> It needs more work to achieve a tidy solution - especially since the
> location of pinentry-mac is fixed and it fails to pass any command line
> arguments.
The above will take care of passing command-line arguments; the executable
location might be handled by a symlink or something.
> Plus I might still use NSTask instead.
G'luck,
Peter
--
Peter Pentchev roam at ringlet.net roam at cnsys.bg roam at FreeBSD.org
PGP key: http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553
Nostalgia ain't what it used to be.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : /pipermail/attachments/20070214/4b6be4f0/attachment-0001.pgp
More information about the Gnupg-devel
mailing list