From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <guix-patches-bounces+larch=yhetil.org@gnu.org>
Received: from mp12.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id MEwNOpir0WNK7gAAbAwnHQ
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Wed, 25 Jan 2023 23:22:17 +0100
Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp12.migadu.com with LMTPS
	id qEi3OZir0WNQpgAAauVa8A
	(envelope-from <guix-patches-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Wed, 25 Jan 2023 23:22:16 +0100
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 C37CEF051
	for <larch@yhetil.org>; Wed, 25 Jan 2023 23:22:16 +0100 (CET)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <guix-patches-bounces@gnu.org>)
	id 1pKo9c-0000IL-0e; Wed, 25 Jan 2023 17:22:04 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pKo9a-0000Hy-L7
 for guix-patches@gnu.org; Wed, 25 Jan 2023 17:22:02 -0500
Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pKo9a-0005xX-DH
 for guix-patches@gnu.org; Wed, 25 Jan 2023 17:22:02 -0500
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pKo9Z-0007fK-PK
 for guix-patches@gnu.org; Wed, 25 Jan 2023 17:22:01 -0500
X-Loop: help-debbugs@gnu.org
Subject: [bug#57337] [v2 2/2] gnu: Add docxbox.
Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: guix-patches@gnu.org
Resent-Date: Wed, 25 Jan 2023 22:22:01 +0000
Resent-Message-ID: <handler.57337.B57337.167468527529407@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 57337
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: Wiktor =?UTF-8?Q?=C5=BBelazny?= <wz@freeshell.de>
Cc: 57337@debbugs.gnu.org
Received: via spool by 57337-submit@debbugs.gnu.org id=B57337.167468527529407
 (code B ref 57337); Wed, 25 Jan 2023 22:22:01 +0000
Received: (at 57337) by debbugs.gnu.org; 25 Jan 2023 22:21:15 +0000
Received: from localhost ([127.0.0.1]:60145 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pKo8o-0007eE-Mq
 for submit@debbugs.gnu.org; Wed, 25 Jan 2023 17:21:14 -0500
Received: from eggs.gnu.org ([209.51.188.92]:50740)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@gnu.org>) id 1pKo8n-0007e1-44
 for 57337@debbugs.gnu.org; Wed, 25 Jan 2023 17:21:13 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@gnu.org>)
 id 1pKo8h-0005kv-U6; Wed, 25 Jan 2023 17:21:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=RL1WBvFDu+YjK0qE8ugdfFoHGOUzlHbtSy8vs10Kh9U=; b=eBvBDaJBDF3avb0lYarG
 LQH39NfLb0FcnJzz7LSjUQxYwztEt6PufNVcQ/b6zBXzP15/ZnxVsy8IIBre3QuHGcKjjJcB9fBk8
 9lEPnfVR3Yq9eful5fyWzi42mnR9ZO2PJAXKKXVPnyOo+tae4GRxQKDBcOQ342whudNI0azCxTYdN
 aWeFq9X+AM0rWFuoUZiJ1WA3iMGmWCRB35xka6OsDSFhmKHMfN7zzb2AAJt+2f8DBRJ0cJXwy8ww9
 2fpjsTI89ToHkN034Mp5y0UIHCH+OHoi0+/6uQvOwSlbo+2VOS4s98MTj32nyKStumS/tssEhu23T
 ZJVL4q4+9Q058Q==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@gnu.org>)
 id 1pKo8h-0006A1-Hb; Wed, 25 Jan 2023 17:21:07 -0500
From: Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@gnu.org>
References: <20221226145732.1237-1-wz@freeshell.de>
 <20221226145732.1237-3-wz@freeshell.de>
X-URL: http://www.fdn.fr/~lcourtes/
X-Revolutionary-Date: Sextidi 6 =?UTF-8?Q?Pluvi=C3=B4se?= an 231 de la
 =?UTF-8?Q?R=C3=A9volution,?= jour du Laurier-thym
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Wed, 25 Jan 2023 23:21:05 +0100
In-Reply-To: <20221226145732.1237-3-wz@freeshell.de> ("Wiktor
 =?UTF-8?Q?=C5=BBelazny?="'s
 message of "Mon, 26 Dec 2022 15:57:32 +0100")
Message-ID: <87fsbys1bi.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: guix-patches@gnu.org
List-Id: <guix-patches.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/guix-patches>
List-Post: <mailto:guix-patches@gnu.org>
List-Help: <mailto:guix-patches-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>,
 <mailto:guix-patches-request@gnu.org?subject=subscribe>
Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org
Sender: guix-patches-bounces+larch=yhetil.org@gnu.org
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=1674685336;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:
	 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=RL1WBvFDu+YjK0qE8ugdfFoHGOUzlHbtSy8vs10Kh9U=;
	b=q8mPBb+G+I8SQJT+PlvfddU5kd9IlIHtFQY19Yc0uiKqb0YmFSFnn1SIr0095CkeWbSP0x
	o9MvjqdXcP59YU3JnM6sY1gwDQa16J8DKcqLw89oh25F0oJNSQaHCQLHUrN6nAmyRqLEps
	cQhz0wrAq1DSBOTPnr6xgwyMmj5hpmoiLppBVzi2oiwKaCTOs/2SdVAMApzfMQ/SJ4GQZI
	wOEK2wIbSA1+2I+WCrKGaA1delK71bPCcMyxdn6Wh1KzeHMLLcJY68nbpZCpl4EObqs0Np
	jFBVU02RWHnEIGxoPs6/LsA7IARe8whklbr5Lr0J9roqMMSt6z9p5RZMk6rElA==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=eBvBDaJB;
	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";
	dmarc=pass (policy=none) header.from=gnu.org
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674685336; a=rsa-sha256; cv=none;
	b=FiGHmwnuNAttN09EqW1P0zHtvV6VD1Ujz5/31YfTnSJldPicgWf8+sYLDEvdhaIC4htKKQ
	p2j/1ffp0pwGNSpLQKgQ9El/KKnvY07BTvB0y1mKWoiNqQ99Hage2IyRb2bP6TUQgjtck3
	loOBxkdivO9AlRJIQ1eQXkV2p/dUA0+W4dWEJzeSHlYlQopSyvcmN/cK72rpYoPT00yHcq
	zYxR6ZzcRrDyW+wK1I4H7GnDfi4b1qXWSyv7JXvHcYzoeVcPdB1d8LYVrh0Yoo7EvQJCrT
	TK1y5qmAv/YA9PYE39H7ha/CrQwyKSjHkBdX7s4MhUFaFkvTWpnHuVpSqTCjEg==
X-Migadu-Scanner: scn1.migadu.com
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=eBvBDaJB;
	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";
	dmarc=pass (policy=none) header.from=gnu.org
X-Migadu-Spam-Score: -3.98
X-Spam-Score: -3.98
X-Migadu-Queue-Id: C37CEF051
X-TUID: prMwnrdthC73

Wiktor =C5=BBelazny <wz@freeshell.de> skribis:

> * gnu/packages/textutils.scm (docxbox): New variable.

[...]

> +                (snippet '(begin
> +                            (for-each delete-file-recursively
> +                                      '("bin" "vendor/json" "vendor/mini=
z-cpp"
> +                                        "vendor/tinyxml2"))))))

No need for =E2=80=98begin=E2=80=99.

> +      (build-system cmake-build-system)
> +      ;; (native-inputs (list bats)) ; Enable after fixing tests, use ba=
sh module
> +      (inputs `(("json-modern-cxx" ,json-modern-cxx)
> +                ("miniz-cpp" ,miniz-cpp)
> +                ("tinyxml2-source" ,(package-source tinyxml2))))

You can write:

  (inputs (list json-modern-cxx miniz-cpp))

and=E2=80=A6

> +      (arguments
> +       `(#:phases (modify-phases %standard-phases
> +                    (add-after 'unpack 'unvendor
> +                      (lambda* (#:key inputs #:allow-other-keys)
> +                        (substitute* "CMakeLists.txt"
> +                          (("vendor/miniz-cpp/zip_file.hpp")
> +                           ""))
> +                        (with-directory-excursion "docxbox"
> +                          (substitute* (find-files "." "\\.(cc|h)$")
> +                            (("#include <vendor/json/single_include/")
> +                             "#include <"))
> +                          (substitute* (find-files "." "\\.hpp$")
> +                            (("#include <vendor/miniz-cpp/")
> +                             "#include <")))))
> +                    (add-after 'unpack 'unpack-tinyxml2
> +                      (lambda* (#:key inputs #:allow-other-keys)
> +                        (mkdir-p "vendor/tinyxml2")
> +                        (copy-recursively (assoc-ref inputs "tinyxml2-so=
urce")
> +                                          "vendor/tinyxml2")))

=E2=80=A6 this:

  (arguments
    (list #:phases
          #~(modify-phases =E2=80=A6
               (copy-recursively #$(package-source tinyxml2) =E2=80=A6)
               =E2=80=A6)))

It would be best if it could depend on TinyXML2 directly, rather than
rebuilding it as part of the build process, but I supposed that=E2=80=99s
trickier so we can leave that for later.

Could you send an updated patch, together with the miniz-cpp one?

Thanks in advance!

Ludo=E2=80=99.