Build the GPGME library and terminal pinentry for Vinix
@@ -0,0 +1,34 @@
1+defpkgbuild(gpgme,
2+ #:pkgname, "gpgme",
3+ #:pkgver, "1.24.1",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "GnuPG cryptography API for package signature verification",
6+ #:arch, [#:x86-64, #:aarch64],
7+ #:url, "https://gnupg.org/software/gpgme/",
8+ #:license, "LGPL-2.1-or-later",
9+ #:depends, ["musl", "libgpg-error", "libassuan"],
10+ ; The vpac runtime adds GnuPG for the OpenPGP engine.
11+ #:source, ["https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.24.1.tar.bz2",
12+ "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/community/gpgme/lfs64.patch", "context.c"],
13+ #:sha256sums, ["ea05d0258e71061d61716584ec34cef59330a91340571edc46b78374973ba85f",
14+ "12bebd3d827910a58d4348cd107e0698ed4bb89a2a704cae950548f10b1a0b78",
15+ "dc13a94a479b1fdeb3bb2062b72748a3f6e22f9dd5ffaa3cee235c00c5efe883"],
16+ #:prepare, fn() {
17+ run("patch", "--batch", "-d", "gpgme-1.24.1", "-p1", "-i", "../lfs64.patch")
18+ },
19+ #:build, fn() {
20+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
21+ run("vinix-configure", "gpgme-1.24.1/configure", "--enable-languages=", "--disable-gpg-test",
22+ string-append("--with-libgpg-error-prefix=", root, "/usr"), string-append("--with-libassuan-prefix=", root, "/usr"))
23+ run("make")
24+ },
25+ #:check, fn() {
26+ run("vinix-cc", "-Isrc", "context.c", "-Lsrc/.libs", "-lgpgme", "-o", "context")
27+ run("vinix-run", "--library-path", "src/.libs", "./context")
28+ },
29+ #:package, fn() {
30+ run("make", "install", string-append("DESTDIR=", pkgdir()))
31+ run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir"))
32+ run("find", pkgdir(), "-name", "*.la", "-delete")
33+ run("install", "-Dm644", "gpgme-1.24.1/COPYING.LESSER", string-append(pkgdir(), "/usr/share/licenses/gpgme/COPYING.LESSER"))
34+ })
@@ -0,0 +1,15 @@
1+#include <gpgme.h>
2+#include <string.h>
3+
4+int main(void)
5+{
6+ gpgme_data_t data;
7+ char bytes[5];
8+ if (gpgme_check_version("1.24.1") == NULL ||
9+ gpgme_data_new_from_mem(&data, "Vinix", sizeof(bytes), 1))
10+ return 1;
11+ const int failed = gpgme_data_read(data, bytes, sizeof(bytes)) != sizeof(bytes) ||
12+ memcmp(bytes, "Vinix", sizeof(bytes)) != 0;
13+ gpgme_data_release(data);
14+ return failed;
15+}
@@ -0,0 +1,28 @@
1+defpkgbuild(pinentry,
2+ #:pkgname, "pinentry",
3+ #:pkgver, "1.3.1",
4+ #:pkgrel, 1,
5+ #:pkgdesc, "Terminal PIN and passphrase prompt for GnuPG",
6+ #:arch, [#:x86-64, #:aarch64],
7+ #:url, "https://gnupg.org/related_software/pinentry/",
8+ #:license, "GPL-2.0-or-later",
9+ #:depends, ["musl", "libassuan", "libgpg-error", "libcap", "ncurses"],
10+ #:source, ["https://gnupg.org/ftp/gcrypt/pinentry/pinentry-1.3.1.tar.bz2"],
11+ #:sha256sums, ["bc72ee27c7239007ab1896c3c2fae53b076e2c9bd2483dc2769a16902bce8c04"],
12+ #:build, fn() {
13+ root := get-environment-variable("VPAC_MAKEPKG_ROOT")
14+ run("vinix-configure", "pinentry-1.3.1/configure", "--enable-pinentry-tty", "--enable-pinentry-curses",
15+ "--disable-libsecret", "--disable-pinentry-qt5", "--disable-pinentry-qt", "--disable-pinentry-gtk2",
16+ "--disable-pinentry-gnome3", "--disable-pinentry-fltk", string-append("--with-libgpg-error-prefix=", root, "/usr"),
17+ string-append("--with-libassuan-prefix=", root, "/usr"))
18+ run("make")
19+ },
20+ #:check, fn() {
21+ run("vinix-run", "tty/pinentry-tty", "--version")
22+ },
23+ #:package, fn() {
24+ run("make", "install", string-append("DESTDIR=", pkgdir()))
25+ run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir"))
26+ run("find", pkgdir(), "-name", "*.la", "-delete")
27+ run("install", "-Dm644", "pinentry-1.3.1/COPYING", string-append(pkgdir(), "/usr/share/licenses/pinentry/COPYING"))
28+ })