From patchwork Sat Jan 1 19:49:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Huntwork X-Patchwork-Id: 2005 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [2a01:4f9:c010:3052::1] by patchwork.archlinux.org with IMAP (fetchmail-6.4.25) for (single-drop); Sat, 01 Jan 2022 19:50:14 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id oFN9DHaw0GH4qgcAK+/4rw (envelope-from ) for ; Sat, 01 Jan 2022 19:50:14 +0000 Received: from lists.archlinux.org (lists.archlinux.org [IPv6:2a01:4f9:c010:9eb4::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id 557CBBD5DE8; Sat, 1 Jan 2022 19:50:13 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 0B70EB5DF16; Sat, 1 Jan 2022 19:50:08 +0000 (UTC) X-Original-To: pacman-dev@lists.archlinux.org Delivered-To: pacman-dev@lists.archlinux.org Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lists.archlinux.org (Postfix) with ESMTPS id A9150B5DF02 for ; Sat, 1 Jan 2022 19:50:05 +0000 (UTC) Received: by mail-qv1-xf34.google.com with SMTP id h5so27388698qvh.8 for ; Sat, 01 Jan 2022 11:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=merelinux-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VZSFhkYjktee/bJdZ4FmRczU3BLgraXNHhFLAfI4wvU=; b=OnGV1kirS0uV9pJMFy5aTjlIz5CMhtJyGcwQayKhxY9Rp/Jc/8MVKZbazSEcB+UJkC qs+5qKo2SvnLV5GFJJsge/+h6x1gs7W50TamhevyEQMB6s/fA2atYh1VebUVHPp97c+x WoiiRwf3Ek2CJ9BrEKjeBnDNHaSY8BY8i71pLsSMrXUHitOSaRDXIBJjirqG09c0Etas q51x7btUxycKTz7Ha5Vt97YOON7je/D2VAAJbSbWim/WjtdMIGh1X22KXECsQgzOWSeN OU36gFDyAztF2Nd26he41Ob2gVPdVVptC1amvX/WMM2CnPVB51bgiE5Gyuyht04j6XGs pQ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VZSFhkYjktee/bJdZ4FmRczU3BLgraXNHhFLAfI4wvU=; b=B6SlLLGE99lwkxy+2AZphQNSRwAL+wF/grj0O3VS7QTDUF19n6ntBQToZ8D7zHe58Z 6gvfLOsXgZDJw8t6J3oBIe+uEb+pADQA6dt7CMP57cVN/N4ZnPMvxM1AoGiMUXV1MjUf UWaxj+ngik3pVYbZvKy4e5KtEcMzduSTGIlK7fE/kuDT9ZIg0N00suIdglpvjVtPdPGP IVlB50g45DJh/PavdCDCpZHT3gj3ytW8uEB9ZgMbeTma8CDY0BZ8IkuyXZpQSB+79Brr u7350bqA+M/ZHf2PDce2LoJEzS2YlhAzxQqnG0olWdf+zHZCplvvfza/WtCnKms1BbkL ipQA== X-Gm-Message-State: AOAM531o4gYLYXTeu3+iWPRj7T3Vvb2i2a6DcTdtyUOQZiodQItDEPBs 1R3D41sKO5sQS1HsKRkObgXDVs+u676pnsDK X-Google-Smtp-Source: ABdhPJxmRMBjhMcvyz6GXUUFKsrXf21lxdUUkq7L1pfUpPfoVc/bRe+F/xv+z38FeWopMp2SQN/BJA== X-Received: by 2002:a05:6214:500f:: with SMTP id jo15mr37178193qvb.64.1641066604034; Sat, 01 Jan 2022 11:50:04 -0800 (PST) Received: from localhost.localdomain ([208.74.141.240]) by smtp.gmail.com with ESMTPSA id s3sm24743353qkp.93.2022.01.01.11.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jan 2022 11:50:03 -0800 (PST) From: Jeremy Huntwork To: pacman-dev@lists.archlinux.org Cc: Jeremy Huntwork Subject: [PATCH 4/4] Update meson for asignify Date: Sat, 1 Jan 2022 14:49:34 -0500 Message-Id: <20220101194934.8229-5-jeremy@merelinux.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220101194934.8229-1-jeremy@merelinux.org> References: <20220101194934.8229-1-jeremy@merelinux.org> MIME-Version: 1.0 X-BeenThere: pacman-dev@lists.archlinux.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pacman-dev-bounces@lists.archlinux.org Sender: "pacman-dev" Authentication-Results: mail.archlinux.org; dkim=pass header.d=merelinux-org.20210112.gappssmtp.com header.s=20210112 header.b=OnGV1kir; dmarc=none; spf=pass (mail.archlinux.org: domain of pacman-dev-bounces@lists.archlinux.org designates 2a01:4f9:c010:9eb4::1 as permitted sender) smtp.mailfrom=pacman-dev-bounces@lists.archlinux.org X-Rspamd-Queue-Id: 557CBBD5DE8 X-Spamd-Result: default: False [-3.91 / 15.00]; REPLY(-4.00)[]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; MAILLIST(-0.20)[mailman]; R_DKIM_ALLOW(-0.20)[merelinux-org.20210112.gappssmtp.com:s=20210112]; RCVD_IN_DNSWL_MED(-0.20)[2a01:4f9:c010:9eb4::1:from]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f9:c010:9eb4::1:c]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; DMARC_NA(0.00)[merelinux.org]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f34:received]; PREVIOUSLY_DELIVERED(0.00)[pacman-dev@lists.archlinux.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f9::/32, country:DE]; FROM_NEQ_ENVFROM(0.00)[jeremy@merelinux.org,pacman-dev-bounces@lists.archlinux.org]; RCPT_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[merelinux-org.20210112.gappssmtp.com:+]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM(-0.00)[-1.000]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org Change the meson configuration so that only one signature method, either gpgme or asignify, is supported at build time. Signed-off-by: Jeremy Huntwork --- meson.build | 33 ++++++++++++++++++++++++--------- meson_options.txt | 4 ++-- test/pacman/meson.build | 2 +- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 76b9d2aa..112a2cc5 100644 --- a/meson.build +++ b/meson.build @@ -70,6 +70,7 @@ conf.set_quoted('SYSHOOKDIR', join_paths(DATAROOTDIR, 'libalpm/hooks/')) conf.set_quoted('CONFFILE', join_paths(SYSCONFDIR, 'pacman.conf')) conf.set_quoted('DBPATH', join_paths(LOCALSTATEDIR, 'lib/pacman/')) conf.set_quoted('GPGDIR', join_paths(SYSCONFDIR, 'pacman.d/gnupg/')) +conf.set_quoted('ASIGNIFYDIR', join_paths(SYSCONFDIR, 'pacman.d/asignify/')) conf.set_quoted('LOGFILE', join_paths(LOCALSTATEDIR, 'log/pacman.log')) conf.set_quoted('CACHEDIR', join_paths(LOCALSTATEDIR, 'cache/pacman/pkg/')) conf.set_quoted('HOOKDIR', join_paths(SYSCONFDIR, 'pacman.d/hooks/')) @@ -97,13 +98,24 @@ libcurl = dependency('libcurl', static : get_option('buildstatic')) conf.set('HAVE_LIBCURL', libcurl.found()) -needed_gpgme_version = '>=1.3.0' -gpgme = dependency('gpgme', - version : needed_gpgme_version, - required : get_option('gpgme'), - static : get_option('buildstatic'), - not_found_message : 'gpgme @0@ is needed for GPG signature support'.format(needed_gpgme_version)) -conf.set('HAVE_LIBGPGME', gpgme.found()) +want_signature = get_option('signature') +if want_signature == 'gpgme' + needed_gpgme_version = '>=1.3.0' + gpgme = dependency('gpgme', + version : needed_gpgme_version, + static : get_option('buildstatic'), + not_found_message : 'gpgme @0@ is needed for GPG signature support'.format(needed_gpgme_version)) + signature_provider = gpgme + conf.set10('HAVE_LIBGPGME', gpgme.found()) +elif want_signature == 'asignify' + libasignify = dependency('libasignify', + static : get_option('buildstatic'), + not_found_message : 'libasignify is needed for asignify signature support') + signature_provider = libasignify + conf.set10('HAVE_LIBASIGNIFY', libasignify.found()) +else + error('unhandled signature value @0@'.format(want_signature)) +endif want_crypto = get_option('crypto') if want_crypto == 'openssl' @@ -305,7 +317,7 @@ libcommon = static_library( gnu_symbol_visibility : 'hidden', install : false) -alpm_deps = [crypto_provider, libarchive, libcurl, libintl, gpgme] +alpm_deps = [crypto_provider, signature_provider, libarchive, libcurl, libintl] libalpm_a = static_library( 'alpm_objlib', @@ -454,7 +466,10 @@ message('\n '.join([ ' Build docs : @0@'.format(build_doc), ' debug build : @0@'.format(get_option('buildtype') == 'debug'), ' Use libcurl : @0@'.format(conf.get('HAVE_LIBCURL')), - ' Use GPGME : @0@'.format(conf.get('HAVE_LIBGPGME')), + ' Use libasignify : @0@'.format(conf.has('HAVE_LIBASIGNIFY') and + conf.get('HAVE_LIBASIGNIFY') == 1), + ' Use GPGME : @0@'.format(conf.has('HAVE_LIBGPGME') and + conf.get('HAVE_LIBGPGME') == 1), ' Use OpenSSL : @0@'.format(conf.has('HAVE_LIBSSL') and conf.get('HAVE_LIBSSL') == 1), ' Use nettle : @0@'.format(conf.has('HAVE_LIBNETTLE') and diff --git a/meson_options.txt b/meson_options.txt index 4d8cc300..01d3d2c5 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -45,8 +45,8 @@ option('curl', type : 'feature', value : 'auto', option('crypto', type : 'combo', choices : ['openssl', 'nettle'], description : 'select crypto implementation') -option('gpgme', type : 'feature', value : 'auto', - description : 'use GPGME for PGP signature verification') +option('signature', type : 'combo', choices : ['asignify', 'gpgme'], + description : 'select signature verification implementation') option('i18n', type : 'boolean', value : true, description : 'enable localization of pacman, libalpm and scripts') diff --git a/test/pacman/meson.build b/test/pacman/meson.build index ecab75b2..af3d7774 100644 --- a/test/pacman/meson.build +++ b/test/pacman/meson.build @@ -362,7 +362,7 @@ foreach input : pacman_tests if not conf.get('HAVE_LIBCURL') args += '--without-curl' endif - if not conf.get('HAVE_LIBGPGME') + if not conf.has('HAVE_LIBGPGME') or conf.get('HAVE_LIBGPGME') == 0 args += '--without-gpg' endif