From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EJuMHW0RuWFu9wAAgWs5BA (envelope-from ) for ; Tue, 14 Dec 2021 22:49:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CPcKGW0RuWGKLAAAbx9fmQ (envelope-from ) for ; Tue, 14 Dec 2021 21:49:33 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EC79A28C65 for ; Tue, 14 Dec 2021 22:49:32 +0100 (CET) Received: from localhost ([::1]:45092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxFfw-0001rH-4c for larch@yhetil.org; Tue, 14 Dec 2021 16:49:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxFfU-0001Oq-Gf for guix-patches@gnu.org; Tue, 14 Dec 2021 16:49:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxFfU-0005jz-7x for guix-patches@gnu.org; Tue, 14 Dec 2021 16:49:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mxFfU-0000Qh-6v for guix-patches@gnu.org; Tue, 14 Dec 2021 16:49:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52492] [PATCH 6/7] gnu: xdg-desktop-portal-wlr: Add binary dependencies Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 14 Dec 2021 21:49:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52492 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Josselin Poiret Cc: 52492@debbugs.gnu.org Received: via spool by 52492-submit@debbugs.gnu.org id=B52492.16395184921548 (code B ref 52492); Tue, 14 Dec 2021 21:49:04 +0000 Received: (at 52492) by debbugs.gnu.org; 14 Dec 2021 21:48:12 +0000 Received: from localhost ([127.0.0.1]:59804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxFee-0000Op-3D for submit@debbugs.gnu.org; Tue, 14 Dec 2021 16:48:12 -0500 Received: from jpoiret.xyz ([206.189.101.64]:42690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mxFeb-0000OL-PP for 52492@debbugs.gnu.org; Tue, 14 Dec 2021 16:48:10 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 993AF184F6A; Tue, 14 Dec 2021 21:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1639518488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=atIsfDklZavhciZY5eJ4rmy1VaWohh2jqaoOD+lljYc=; b=WQgJ0KfEywelEj3qlxQ/7Kq/4OnXh1WDQIYrH6Gf96LC0QA1FlO2/7jqPv66g7aa5DNhhL bQ7VoXrdpHiXzoGGvRbjXr2EeuapXEetlIOqB5uXtmFqLz68yrau8i26pGnuvib+SoHHCq N+O9lrLXsiYWkdieMPqJ9IBmzGpXHLQu65XiJjE8vjOO5kdg6DOZ7GQwSRGlvr8jQK3yAS NSAA7w5U7yiJBBLmI+NZE0rM9LGGV7V5Grb5lxEl1nHE9fluzfsWV5XdpjiNh+xl87ZYen L6dx3BvKD8dbK7HeMmxRTTirhKS6sa0jvY9kNZcSMQWjeZ9MOqndVeB8izcSgA== Date: Tue, 14 Dec 2021 22:47:51 +0100 Message-Id: <20211214214752.25096-6-dev@jpoiret.xyz> In-Reply-To: <20211214214502.24913-1-dev@jpoiret.xyz> References: <20211214214502.24913-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches From: Josselin Poiret via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639518573; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=atIsfDklZavhciZY5eJ4rmy1VaWohh2jqaoOD+lljYc=; b=jbIHKXCgSff+0pQk60ZteGrA9dIEjaqylOxp5zfkp2/VRX7OQ2wgCp7hlhb1huAWw2vJ5R 0vJVlYmSadCzpHixKjVKKjpzX4jnz516IE7zKLBCUW4DZjup6ObGW4mqWTxOMYd0kO9mAS MuTqizm/fZdUM+cjJSFJDQxkxZhgDQDiPR3e+xz2VM88zKFCq4SoTTpFLfCmr33LPunSXx KgyYUoBKtT/EkZqu8k9W6VipcPKZdxOBgh1lLFv/G7CFhAt/htBoTJhEOYZRVWw31HZPPz 4JFXOKIw84HjXh3GAHixqxPEBXNFN5Al/4DIgexHhkPoW021PUKfTjRsK5CLAw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639518573; a=rsa-sha256; cv=none; b=O8RHtMlYzSlLsm+FgPTdIM+lrtbkHts5jf4vMsknaY8Jf1fRbgLbS8DjKECjv8TV8ch8y1 aKdMI+DJ2c2AJLh2Gc3igZ9GIr37k6E+ENt7lpiMRLqJB3lZSf1cn6wk0Q6jH217qsm7a+ +rRWnpHHDdtO7spFgOL8T5Olv2ez4e+0l6n7aIfK1BoNCLMOj6lur9LbIlsB/soQKWnbsz YPbdXn+EkvEGKDk+VQf2SI3AXJ+4hhnMG7W5Skvo5pmS/k8IiuE+YO1OccqD5NYsioJpXm IyMgvlEA8u35QjYKQyXdmVHqr4Uu9c+SEBQGhi2IGEI5oZSOnHiv290BR2Fj2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=WQgJ0KfE; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.47 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=WQgJ0KfE; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: EC79A28C65 X-Spam-Score: -2.47 X-Migadu-Scanner: scn0.migadu.com X-TUID: DBTJCYkEg+dJ * gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch: Add it. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/freedesktop.scm (xdg-desktop-portal-wlr): Add dependencies on bash-minimal, grim and slurp, and hardcode the paths in source. --- gnu/local.mk | 1 + gnu/packages/freedesktop.scm | 23 +++++++++++++-- ...g-desktop-portal-wlr-harcoded-length.patch | 28 +++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch diff --git a/gnu/local.mk b/gnu/local.mk index a138e574d0..9bbcd42733 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1914,6 +1914,7 @@ dist_patch_DATA = \ %D%/packages/patches/wpa-supplicant-CVE-2021-27803.patch \ %D%/packages/patches/wpa-supplicant-CVE-2021-30004.patch \ %D%/packages/patches/x265-arm-flags.patch \ + %D%/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch\ %D%/packages/patches/xf86-video-ark-remove-mibstore.patch \ %D%/packages/patches/xf86-video-mach64-bool-to-boolean.patch \ %D%/packages/patches/xf86-video-mach64-glibc-2.20.patch \ diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index e1827ffdad..1ed09dbf2c 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -2387,18 +2387,37 @@ (define-public xdg-desktop-portal-wlr (file-name (git-file-name name version)) (sha256 (base32 - "1ipg35gv8ja39ijwbyi96qlyq2y1fjdggl40s38rv68bsya8zry1")))) + "1ipg35gv8ja39ijwbyi96qlyq2y1fjdggl40s38rv68bsya8zry1")) + (patches (search-patches "xdg-desktop-portal-wlr-harcoded-length.patch")))) (build-system meson-build-system) (arguments `(#:configure-flags '("-Dsystemd=disabled" - "-Dsd-bus-provider=libelogind"))) + "-Dsd-bus-provider=libelogind") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'hardcode-binaries + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((sh (search-input-file inputs "/bin/sh")) + (grim (search-input-file inputs "/bin/grim")) + (slurp (search-input-file inputs "/bin/slurp"))) + (substitute* "src/screenshot/screenshot.c" + (("grim") grim) + (("slurp") slurp) + (("execl\\(\"/bin/sh\", \"/bin/sh\"") + (string-append "execl(\"" sh "\", \"" sh "\""))) + (substitute* "src/screencast/screencast.c" + (("execvp\\(\"sh") + (string-append "execvp(\"" sh))))))))) (native-inputs (list cmake pkg-config)) (inputs (list elogind + bash-minimal + grim iniparser libinih pipewire-0.3 + slurp wayland wayland-protocols)) (home-page "https://github.com/emersion/xdg-desktop-portal-wlr") diff --git a/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch b/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch new file mode 100644 index 0000000000..b499a039e8 --- /dev/null +++ b/gnu/packages/patches/xdg-desktop-portal-wlr-harcoded-length.patch @@ -0,0 +1,28 @@ +From 3121eeb5e68bedd6e2398f35b9bd60b69709a47e Mon Sep 17 00:00:00 2001 +From: Josselin Poiret +Date: Tue, 14 Dec 2021 18:49:54 +0100 +Subject: [PATCH] Replace hardcoded command length + +--- + src/screenshot/screenshot.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/screenshot/screenshot.c b/src/screenshot/screenshot.c +index 9df0ea7..5f27681 100644 +--- a/src/screenshot/screenshot.c ++++ b/src/screenshot/screenshot.c +@@ -42,8 +42,9 @@ static bool exec_screenshooter_interactive(const char *path) { + perror("fork"); + return false; + } else if (pid == 0) { +- char cmd[strlen(path) + 25]; +- snprintf(cmd, sizeof(cmd), "grim -g \"$(slurp)\" -- %s", path); ++ const char cmd_fmt[] = "grim -g \"$(slurp)\" -- %s"; ++ char cmd[strlen(path) + sizeof(cmd_fmt)]; ++ snprintf(cmd, sizeof(cmd), cmd_fmt, path); + execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); + perror("execl"); + exit(127); +-- +2.34.0 + -- 2.34.0