From 652e2126be59ade6d2e16767fe52d8356f24e4c4 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 02:17:54 +0100 Subject: [PATCH] Build the GPGME library and terminal pinentry for Vinix --- gpgme/PKGBUILD.vile | 34 ++++++++++++++++++++++++++++++++++ gpgme/context.c | 15 +++++++++++++++ pinentry/PKGBUILD.vile | 28 ++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 gpgme/PKGBUILD.vile create mode 100644 gpgme/context.c create mode 100644 pinentry/PKGBUILD.vile diff --git a/gpgme/PKGBUILD.vile b/gpgme/PKGBUILD.vile new file mode 100644 index 0000000..acf18a0 --- /dev/null +++ b/gpgme/PKGBUILD.vile @@ -0,0 +1,34 @@ +defpkgbuild(gpgme, + #:pkgname, "gpgme", + #:pkgver, "1.24.1", + #:pkgrel, 1, + #:pkgdesc, "GnuPG cryptography API for package signature verification", + #:arch, [#:x86-64, #:aarch64], + #:url, "https://gnupg.org/software/gpgme/", + #:license, "LGPL-2.1-or-later", + #:depends, ["musl", "libgpg-error", "libassuan"], + ; The vpac runtime adds GnuPG for the OpenPGP engine. + #:source, ["https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.24.1.tar.bz2", + "https://raw.githubusercontent.com/alpinelinux/aports/a7de3e63cc8015474a4feadd8bb7c0ecc097b1fa/community/gpgme/lfs64.patch", "context.c"], + #:sha256sums, ["ea05d0258e71061d61716584ec34cef59330a91340571edc46b78374973ba85f", + "12bebd3d827910a58d4348cd107e0698ed4bb89a2a704cae950548f10b1a0b78", + "dc13a94a479b1fdeb3bb2062b72748a3f6e22f9dd5ffaa3cee235c00c5efe883"], + #:prepare, fn() { + run("patch", "--batch", "-d", "gpgme-1.24.1", "-p1", "-i", "../lfs64.patch") + }, + #:build, fn() { + root := get-environment-variable("VPAC_MAKEPKG_ROOT") + run("vinix-configure", "gpgme-1.24.1/configure", "--enable-languages=", "--disable-gpg-test", + string-append("--with-libgpg-error-prefix=", root, "/usr"), string-append("--with-libassuan-prefix=", root, "/usr")) + run("make") + }, + #:check, fn() { + run("vinix-cc", "-Isrc", "context.c", "-Lsrc/.libs", "-lgpgme", "-o", "context") + run("vinix-run", "--library-path", "src/.libs", "./context") + }, + #:package, fn() { + run("make", "install", string-append("DESTDIR=", pkgdir())) + run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir")) + run("find", pkgdir(), "-name", "*.la", "-delete") + run("install", "-Dm644", "gpgme-1.24.1/COPYING.LESSER", string-append(pkgdir(), "/usr/share/licenses/gpgme/COPYING.LESSER")) + }) diff --git a/gpgme/context.c b/gpgme/context.c new file mode 100644 index 0000000..de785bb --- /dev/null +++ b/gpgme/context.c @@ -0,0 +1,15 @@ +#include +#include + +int main(void) +{ + gpgme_data_t data; + char bytes[5]; + if (gpgme_check_version("1.24.1") == NULL || + gpgme_data_new_from_mem(&data, "Vinix", sizeof(bytes), 1)) + return 1; + const int failed = gpgme_data_read(data, bytes, sizeof(bytes)) != sizeof(bytes) || + memcmp(bytes, "Vinix", sizeof(bytes)) != 0; + gpgme_data_release(data); + return failed; +} diff --git a/pinentry/PKGBUILD.vile b/pinentry/PKGBUILD.vile new file mode 100644 index 0000000..7ec69f0 --- /dev/null +++ b/pinentry/PKGBUILD.vile @@ -0,0 +1,28 @@ +defpkgbuild(pinentry, + #:pkgname, "pinentry", + #:pkgver, "1.3.1", + #:pkgrel, 1, + #:pkgdesc, "Terminal PIN and passphrase prompt for GnuPG", + #:arch, [#:x86-64, #:aarch64], + #:url, "https://gnupg.org/related_software/pinentry/", + #:license, "GPL-2.0-or-later", + #:depends, ["musl", "libassuan", "libgpg-error", "libcap", "ncurses"], + #:source, ["https://gnupg.org/ftp/gcrypt/pinentry/pinentry-1.3.1.tar.bz2"], + #:sha256sums, ["bc72ee27c7239007ab1896c3c2fae53b076e2c9bd2483dc2769a16902bce8c04"], + #:build, fn() { + root := get-environment-variable("VPAC_MAKEPKG_ROOT") + run("vinix-configure", "pinentry-1.3.1/configure", "--enable-pinentry-tty", "--enable-pinentry-curses", + "--disable-libsecret", "--disable-pinentry-qt5", "--disable-pinentry-qt", "--disable-pinentry-gtk2", + "--disable-pinentry-gnome3", "--disable-pinentry-fltk", string-append("--with-libgpg-error-prefix=", root, "/usr"), + string-append("--with-libassuan-prefix=", root, "/usr")) + run("make") + }, + #:check, fn() { + run("vinix-run", "tty/pinentry-tty", "--version") + }, + #:package, fn() { + run("make", "install", string-append("DESTDIR=", pkgdir())) + run("rm", "-f", string-append(pkgdir(), "/usr/share/info/dir")) + run("find", pkgdir(), "-name", "*.la", "-delete") + run("install", "-Dm644", "pinentry-1.3.1/COPYING", string-append(pkgdir(), "/usr/share/licenses/pinentry/COPYING")) + }) -- 2.56.1