From patchwork Mon Jul 19 11:45:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Le Vaillant X-Patchwork-Id: 31497 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id F0E6627BC78; Mon, 19 Jul 2021 12:46:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4CCDA27BC6B for ; Mon, 19 Jul 2021 12:46:30 +0100 (BST) Received: from localhost ([::1]:49558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5RjB-0001XI-8f for patchwork@mira.cbaines.net; Mon, 19 Jul 2021 07:46:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Rio-0001U0-Ap for guix-patches@gnu.org; Mon, 19 Jul 2021 07:46:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5Rik-0001Jm-O0 for guix-patches@gnu.org; Mon, 19 Jul 2021 07:46:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5Rik-0000iq-LY for guix-patches@gnu.org; Mon, 19 Jul 2021 07:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49640] [PATCH core-updates] gnu: ghostscript: Improve reproducibility of PDF document generation Resent-From: Guillaume Le Vaillant Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 11:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49640 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49640@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16266951292733 (code B ref -1); Mon, 19 Jul 2021 11:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jul 2021 11:45:29 +0000 Received: from localhost ([127.0.0.1]:58182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5RiD-0000i0-Bn for submit@debbugs.gnu.org; Mon, 19 Jul 2021 07:45:29 -0400 Received: from lists.gnu.org ([209.51.188.17]:35668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5RiB-0000ht-Ux for submit@debbugs.gnu.org; Mon, 19 Jul 2021 07:45:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Ri5-0000Tg-HP for guix-patches@gnu.org; Mon, 19 Jul 2021 07:45:27 -0400 Received: from mout01.posteo.de ([185.67.36.65]:34509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Rhz-0000fp-7u for guix-patches@gnu.org; Mon, 19 Jul 2021 07:45:19 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id B3154240028 for ; Mon, 19 Jul 2021 13:45:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1626695109; bh=LPMwDBlY38L8zh/5Mjxd3//KyxwxoqR+17ot6h2p+Ck=; h=From:To:Subject:Date:From; b=GyJPakffV1hmghkCfJ7Ff/YZGVswp9bidTtMlCn6P1egHh++lmjbgWjaOJ+8MCgRM utGpfzv2woxiAdAP4BJOrWIsc7x6pFQOHBJICDroGFRLsY7r7VdD9fKpSiW8usewRr LyhFQvAiX0tzktHHHi2oS0ZlmPzKcXZd6Lcj/Fzrki+sunGpD/8DfU9yUeUY6B9spq iHIuQJnX2EsoZAAKE30f9eaaIOlg5Ot6kTQOTTt9m0ncgb3eXGi1yNNyUolmE3pLUq pb4VXeb23yEeqLTNKKLm8EHkkzKp+N/8uM4/93NFwjzZz57/uJVN6dVfQZGcLJGrmL a27jrQH0WiiZw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GT0QD6VwQz9rxF for ; Mon, 19 Jul 2021 13:45:08 +0200 (CEST) From: Guillaume Le Vaillant Date: Mon, 19 Jul 2021 11:45:07 +0000 Message-ID: <87eebucyt8.fsf@kitej> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=glv@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, When trying to solve a reproducibility issue when generating the PDF documentation of the txr software (see [1]), Paul Patience noticed that ghostscript writes a creation date in the PDF even when the GS_GENERATE_UUIDS environment variable is set to "0". The attached patch updates 'ghostscript-no-header-creationdate.patch' to fix this issue. Given the amount of rebuilds caused by modifying ghostscript, this should go to core-updates, but is core-updates in freeze state already, or can I push this patch right now? Note: Even with this patch, there are still some cases where PDF generation by ghostscript is not reproducible (for reasons not related to creation date), like groff-doc. [1]: https://bugs.gnu.org/49517 From db5962c68099f835350c24c8a3f889b9fa1f8a8e Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Mon, 19 Jul 2021 11:48:12 +0200 Subject: [PATCH] gnu: ghostscript: Improve reproducibility of PDF document generation * gnu/packages/patches/ghostscript-no-header-creationdate.patch: Disable writing "xmp:ModifyDate" and "xmp:CreateDate" if GS_GENERATE_UUIDS is set to "0" or "no". --- .../ghostscript-no-header-creationdate.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gnu/packages/patches/ghostscript-no-header-creationdate.patch b/gnu/packages/patches/ghostscript-no-header-creationdate.patch index 92ddbdade0..b19f3ab5d9 100644 --- a/gnu/packages/patches/ghostscript-no-header-creationdate.patch +++ b/gnu/packages/patches/ghostscript-no-header-creationdate.patch @@ -20,3 +20,25 @@ index 0fb067e..b342e2c 100644 { struct tm tms; time_t t; +--- orig/gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c ++++ gnu-ghostscript-9.14.0/devices/vector/gdevpdfe.c +@@ -692,6 +692,9 @@ + pdf_xml_attribute_name(s, "xmlns:xmp"); + pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/"); + pdf_xml_tag_end(s); ++ if (!getenv("GS_GENERATE_UUIDS") || ++ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && ++ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0)) + { + pdf_xml_tag_open_beg(s, "xmp:ModifyDate"); + pdf_xml_tag_end(s); +@@ -700,6 +701,9 @@ + pdf_xml_tag_close(s, "xmp:ModifyDate"); + pdf_xml_newline(s); + } ++ if (!getenv("GS_GENERATE_UUIDS") || ++ (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && ++ strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0)) + { + pdf_xml_tag_open_beg(s, "xmp:CreateDate"); + pdf_xml_tag_end(s); -- 2.32.0