unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation.
@ 2023-09-02 21:38 Bruno Victal
  2023-09-05 13:14 ` Maxim Cournoyer
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Bruno Victal @ 2023-09-02 21:38 UTC (permalink / raw)
  To: 65706; +Cc: Bruno Victal

Notes:
* transfig is not needed according to the NEWS since 4.2.
* help2man is not optional.

* gnu/packages/photo.scm (enblend-enfuse)[native-inputs]: Remove libxml2,
tidy-html and transfig. Replace imagemagick with imagemagick/stable. Add
graphviz-minimal, font-ghostscript, librsvg, m4, perl-readonly,
texlive-texloganalyser, texlive-bold-extra, texlive-cm-mf-extra-bold,
texlive-comment, texlive-float, texlive-enumitem, texlive-mdwtools,
texlive-hyphenat, texlive-index, texlive-listings, texlive-microtype,
texlive-etoolbox, texlive-nag, texlive-ragged2e, texlive-shorttoc,
texlive-bigfoot, texlive-xstring and hevea.
[arguments]<#:phases>: Restyle. Add 'fontconfig-cache, exclude-doc-from-check
and 'install-doc. Replace 'build and 'install.
---

Notes regarding the phases:
* Saves approx ⅓ of the total build time by not rebuilding the docs
over and over again.

 gnu/packages/photo.scm | 100 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 84 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index b290e2b29a..323be6f28a 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2020. 2021, 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -60,6 +61,7 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages graphics)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
@@ -70,8 +72,10 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -376,14 +380,34 @@ (define-public enblend-enfuse
      (list pkg-config
            perl
            perl-timedate
+           help2man
            ;; For building the documentation.
            gnuplot
-           help2man
-           imagemagick
-           libxml2
-           (texlive-updmap.cfg)
-           tidy-html
-           transfig))
+           graphviz-minimal  ; for 'dot'
+           font-ghostscript
+           imagemagick/stable
+           librsvg
+           m4
+           perl-readonly
+           texlive-texloganalyser
+           (texlive-updmap.cfg
+            (list texlive-bold-extra
+                  texlive-cm-mf-extra-bold
+                  texlive-comment
+                  texlive-float
+                  texlive-enumitem
+                  texlive-mdwtools
+                  texlive-hyphenat
+                  texlive-index
+                  texlive-listings
+                  texlive-microtype
+                  texlive-etoolbox  ;used but not propagated by microtype
+                  texlive-nag
+                  texlive-ragged2e
+                  texlive-shorttoc
+                  texlive-bigfoot
+                  texlive-xstring))
+           hevea))
     (inputs
      (list boost
            gsl
@@ -395,16 +419,60 @@ (define-public enblend-enfuse
            vigra
            zlib))
     (arguments
-     (list #:configure-flags
-           #~(list "--enable-openmp")
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'unpack 'add-missing-include
-                 (lambda _
-                   (substitute* "src/minimizer.h"
-                     ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
-                     (("#include <vector>" line)
-                      (string-append line "\n#include <limits>"))))))))
+     (list
+      #:configure-flags
+      #~(list "--enable-openmp")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'add-missing-include
+            (lambda _
+              (substitute* "src/minimizer.h"
+                ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
+                (("#include <vector>" line)
+                 (string-append line "\n#include <limits>")))))
+          (add-before 'build 'fontconfig-cache
+            (lambda _
+              (setenv "XDG_CACHE_HOME" (mkdtemp "/tmp/cache-XXXXXX"))))
+          ;; XXX: There's some extreme sillyness when building the
+          ;; documentation. It gets rebuilt thrice, during build, check and
+          ;; install, possibly due to the effects of the invocation of
+          ;; UPDATED_ON in doc/Makefile.
+          ;; I suspect the package might also have reproducibility issues
+          ;; with the manual and src/DefaultSig.pm. (not an exhaustive list)
+          ;; It's worth asking upstream for help with adding support
+          ;; for SOURCE_DATE_EPOCH.
+          (add-after 'configure 'exclude-doc-from-check
+            (lambda _
+              (substitute* "doc/Makefile"
+                (("^(check:).+$" _ rule)
+                 (string-append rule "\n")))))
+          ;; XXX: Skip building the docs since they're rebuilt again
+          ;; during install.
+          (replace 'build
+            (lambda args
+              (with-directory-excursion "src"
+                (apply (assoc-ref %standard-phases 'build) args))))
+          ;; XXX: Save another doc rebuild when installing.
+          (replace 'install
+            ;; Intercept and insert a make-flag for this phase only.
+            (lambda* (#:key make-flags #:allow-other-keys)
+              (apply invoke "make" "install"
+                     (cons "MAYBE_DOC=" make-flags))))
+          ;; XXX: 'make install' doesn't install the docs.
+          (add-after 'install 'install-doc
+            (lambda* (#:key make-flags #:allow-other-keys)
+              ;; Install examples first, for which the 'install' rule works.
+              (with-directory-excursion "doc/examples"
+                (apply invoke "make" "install" make-flags))
+              ;; The docs have to be installed with specific rules.
+              (with-directory-excursion "doc"
+                (apply invoke "make"
+                       "install-ps-local"
+                       "install-html-local"
+                       "install-dvi-local"
+                       ;; Do not overwhelm the console by printing the source
+                       ;; to stdout.
+                       (cons "V=0" make-flags))))))))
     (home-page "https://enblend.sourceforge.net/")
     (synopsis "Tools for combining and blending images")
     (description

base-commit: 5ff0c8997a2ddf71af477883584a5f9ccd9b757f
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation.
  2023-09-02 21:38 [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation Bruno Victal
@ 2023-09-05 13:14 ` Maxim Cournoyer
  2023-09-05 14:59 ` [bug#65706] [PATCH v2] " Bruno Victal
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2023-09-05 13:14 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 65706

Hi Bruno,

Bruno Victal <mirai@makinata.eu> writes:

> Notes:
> * transfig is not needed according to the NEWS since 4.2.
> * help2man is not optional.
>
> * gnu/packages/photo.scm (enblend-enfuse)[native-inputs]: Remove libxml2,
> tidy-html and transfig. Replace imagemagick with imagemagick/stable. Add
> graphviz-minimal, font-ghostscript, librsvg, m4, perl-readonly,
> texlive-texloganalyser, texlive-bold-extra, texlive-cm-mf-extra-bold,
> texlive-comment, texlive-float, texlive-enumitem, texlive-mdwtools,
> texlive-hyphenat, texlive-index, texlive-listings, texlive-microtype,
> texlive-etoolbox, texlive-nag, texlive-ragged2e, texlive-shorttoc,
> texlive-bigfoot, texlive-xstring and hevea.
> [arguments]<#:phases>: Restyle. Add 'fontconfig-cache, exclude-doc-from-check
> and 'install-doc. Replace 'build and 'install.
> ---

Should the doc be installed under a 'doc' output (at least if there's
more than man pages or info manuals) ?

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#65706] [PATCH v2] gnu: enblend-enfuse: Build documentation.
  2023-09-02 21:38 [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation Bruno Victal
  2023-09-05 13:14 ` Maxim Cournoyer
@ 2023-09-05 14:59 ` Bruno Victal
  2023-09-06 21:01   ` Maxim Cournoyer
  2023-09-16 16:49 ` [bug#65706] [PATCH v3 1/2] gnu: enblend-enfuse: Backport upstream fixes Bruno Victal
  2023-09-16 16:49 ` [bug#65706] [PATCH v3 2/2] gnu: enblend-enfuse: Build documentation Bruno Victal
  3 siblings, 1 reply; 7+ messages in thread
From: Bruno Victal @ 2023-09-05 14:59 UTC (permalink / raw)
  To: 65706; +Cc: Bruno Victal, maxim.cournoyer

Notes:
* transfig is not needed according to the NEWS since 4.2.
* help2man is not optional.

* gnu/packages/photo.scm (enblend-enfuse)[native-inputs]: Remove libxml2,
tidy-html and transfig. Replace imagemagick with imagemagick/stable. Add
graphviz-minimal, font-ghostscript, librsvg, m4, perl-readonly,
texlive-texloganalyser, texlive-bold-extra, texlive-cm-mf-extra-bold,
texlive-comment, texlive-float, texlive-enumitem, texlive-mdwtools,
texlive-hyphenat, texlive-index, texlive-listings, texlive-microtype,
texlive-etoolbox, texlive-nag, texlive-ragged2e, texlive-shorttoc,
texlive-bigfoot, texlive-xstring and hevea.
[arguments]<#:phases>: Restyle. Add 'fontconfig-cache, 'exclude-doc-from-check
and 'install-doc. Replace 'build and 'install.
[outputs]: Add 'doc.
---
 gnu/packages/photo.scm | 101 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 85 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index b290e2b29a..5157a24fb9 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2020. 2021, 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -60,6 +61,7 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages graphics)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
@@ -70,8 +72,10 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -376,14 +380,34 @@ (define-public enblend-enfuse
      (list pkg-config
            perl
            perl-timedate
+           help2man
            ;; For building the documentation.
            gnuplot
-           help2man
-           imagemagick
-           libxml2
-           (texlive-updmap.cfg)
-           tidy-html
-           transfig))
+           graphviz-minimal  ; for 'dot'
+           font-ghostscript
+           imagemagick/stable
+           librsvg
+           m4
+           perl-readonly
+           texlive-texloganalyser
+           (texlive-updmap.cfg
+            (list texlive-bold-extra
+                  texlive-cm-mf-extra-bold
+                  texlive-comment
+                  texlive-float
+                  texlive-enumitem
+                  texlive-mdwtools
+                  texlive-hyphenat
+                  texlive-index
+                  texlive-listings
+                  texlive-microtype
+                  texlive-etoolbox  ;used but not propagated by microtype
+                  texlive-nag
+                  texlive-ragged2e
+                  texlive-shorttoc
+                  texlive-bigfoot
+                  texlive-xstring))
+           hevea))
     (inputs
      (list boost
            gsl
@@ -395,16 +419,61 @@ (define-public enblend-enfuse
            vigra
            zlib))
     (arguments
-     (list #:configure-flags
-           #~(list "--enable-openmp")
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'unpack 'add-missing-include
-                 (lambda _
-                   (substitute* "src/minimizer.h"
-                     ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
-                     (("#include <vector>" line)
-                      (string-append line "\n#include <limits>"))))))))
+     (list
+      #:configure-flags
+      #~(list "--enable-openmp")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'add-missing-include
+            (lambda _
+              (substitute* "src/minimizer.h"
+                ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
+                (("#include <vector>" line)
+                 (string-append line "\n#include <limits>")))))
+          (add-before 'build 'fontconfig-cache
+            (lambda _
+              (setenv "XDG_CACHE_HOME" (mkdtemp "/tmp/cache-XXXXXX"))))
+          ;; XXX: There's some extreme sillyness when building the
+          ;; documentation. It gets rebuilt thrice, during build, check and
+          ;; install, possibly due to the effects of the invocation of
+          ;; UPDATED_ON in doc/Makefile.
+          ;; I suspect the package might also have reproducibility issues
+          ;; with the manual and src/DefaultSig.pm. (not an exhaustive list)
+          ;; It's worth asking upstream for help with adding support
+          ;; for SOURCE_DATE_EPOCH.
+          (add-after 'configure 'exclude-doc-from-check
+            (lambda _
+              (substitute* "doc/Makefile"
+                (("^(check:).+$" _ rule)
+                 (string-append rule "\n")))))
+          ;; XXX: Skip building the docs since they're rebuilt again
+          ;; during install.
+          (replace 'build
+            (lambda args
+              (with-directory-excursion "src"
+                (apply (assoc-ref %standard-phases 'build) args))))
+          ;; XXX: Save another doc rebuild when installing.
+          (replace 'install
+            ;; Intercept and insert a make-flag for this phase only.
+            (lambda* (#:key make-flags #:allow-other-keys)
+              (apply invoke "make" "install"
+                     (cons "MAYBE_DOC=" make-flags))))
+          ;; XXX: 'make install' doesn't install the docs.
+          (add-after 'install 'install-doc
+            (lambda* (#:key make-flags #:allow-other-keys)
+              ;; Install examples first, for which the 'install' rule works.
+              (with-directory-excursion "doc/examples"
+                (apply invoke "make" "install" make-flags))
+              ;; The docs have to be installed with specific rules.
+              (with-directory-excursion "doc"
+                (apply invoke "make"
+                       "install-ps-local"
+                       "install-html-local"
+                       "install-dvi-local"
+                       ;; Do not overwhelm the console by printing the source
+                       ;; to stdout.
+                       (cons "V=0" make-flags))))))))
+    (outputs '("out" "doc"))
     (home-page "https://enblend.sourceforge.net/")
     (synopsis "Tools for combining and blending images")
     (description

base-commit: 5ff0c8997a2ddf71af477883584a5f9ccd9b757f
-- 
2.40.1





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#65706] [PATCH v2] gnu: enblend-enfuse: Build documentation.
  2023-09-05 14:59 ` [bug#65706] [PATCH v2] " Bruno Victal
@ 2023-09-06 21:01   ` Maxim Cournoyer
  0 siblings, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2023-09-06 21:01 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 65706

Hi,

Bruno Victal <mirai@makinata.eu> writes:

> Notes:
> * transfig is not needed according to the NEWS since 4.2.
> * help2man is not optional.
>
> * gnu/packages/photo.scm (enblend-enfuse)[native-inputs]: Remove libxml2,
> tidy-html and transfig. Replace imagemagick with imagemagick/stable. Add
> graphviz-minimal, font-ghostscript, librsvg, m4, perl-readonly,
> texlive-texloganalyser, texlive-bold-extra, texlive-cm-mf-extra-bold,
> texlive-comment, texlive-float, texlive-enumitem, texlive-mdwtools,
> texlive-hyphenat, texlive-index, texlive-listings, texlive-microtype,
> texlive-etoolbox, texlive-nag, texlive-ragged2e, texlive-shorttoc,
> texlive-bigfoot, texlive-xstring and hevea.
> [arguments]<#:phases>: Restyle. Add 'fontconfig-cache, 'exclude-doc-from-check
> and 'install-doc. Replace 'build and 'install.
> [outputs]: Add 'doc.

[...]

>      (inputs
>       (list boost
>             gsl
> @@ -395,16 +419,61 @@ (define-public enblend-enfuse
>             vigra
>             zlib))
>      (arguments
> -     (list #:configure-flags
> -           #~(list "--enable-openmp")
> -           #:phases
> -           #~(modify-phases %standard-phases
> -               (add-after 'unpack 'add-missing-include
> -                 (lambda _
> -                   (substitute* "src/minimizer.h"
> -                     ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
> -                     (("#include <vector>" line)
> -                      (string-append line "\n#include <limits>"))))))))
> +     (list
> +      #:configure-flags
> +      #~(list "--enable-openmp")
> +      #:phases
> +      #~(modify-phases %standard-phases
> +          (add-after 'unpack 'add-missing-include
> +            (lambda _
> +              (substitute* "src/minimizer.h"
> +                ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
> +                (("#include <vector>" line)
> +                 (string-append line "\n#include <limits>")))))
> +          (add-before 'build 'fontconfig-cache
> +            (lambda _
> +              (setenv "XDG_CACHE_HOME" (mkdtemp "/tmp/cache-XXXXXX"))))
> +          ;; XXX: There's some extreme sillyness when building the
> +          ;; documentation. It gets rebuilt thrice, during build, check and
> +          ;; install, possibly due to the effects of the invocation of
> +          ;; UPDATED_ON in doc/Makefile.
> +          ;; I suspect the package might also have reproducibility issues
> +          ;; with the manual and src/DefaultSig.pm. (not an exhaustive list)
> +          ;; It's worth asking upstream for help with adding support
> +          ;; for SOURCE_DATE_EPOCH.

Stylistic nitpick: we don't voice the comments using the first person
(e.g. 'I') in the code typically; we try to stick to being descriptive
and factual.

If it's worth asking upstream, we should ask them now, and link to the
upstream issue in the comment to track its resolution :-).

> +          (add-after 'configure 'exclude-doc-from-check
> +            (lambda _
> +              (substitute* "doc/Makefile"
> +                (("^(check:).+$" _ rule)
> +                 (string-append rule "\n")))))
> +          ;; XXX: Skip building the docs since they're rebuilt again
> +          ;; during install.
> +          (replace 'build
> +            (lambda args
> +              (with-directory-excursion "src"
> +                (apply (assoc-ref %standard-phases 'build) args))))
> +          ;; XXX: Save another doc rebuild when installing.
> +          (replace 'install
> +            ;; Intercept and insert a make-flag for this phase only.
> +            (lambda* (#:key make-flags #:allow-other-keys)
> +              (apply invoke "make" "install"
> +                     (cons "MAYBE_DOC=" make-flags))))
> +          ;; XXX: 'make install' doesn't install the docs.
> +          (add-after 'install 'install-doc
> +            (lambda* (#:key make-flags #:allow-other-keys)
> +              ;; Install examples first, for which the 'install' rule works.
> +              (with-directory-excursion "doc/examples"
> +                (apply invoke "make" "install" make-flags))
> +              ;; The docs have to be installed with specific rules.
> +              (with-directory-excursion "doc"
> +                (apply invoke "make"
> +                       "install-ps-local"
> +                       "install-html-local"
> +                       "install-dvi-local"
> +                       ;; Do not overwhelm the console by printing the source
> +                       ;; to stdout.
> +                       (cons "V=0" make-flags))))))))
> +    (outputs '("out" "doc"))

nitpick: it's more conventional to have the 'outputs' field before the
'build-system' one.

Otherwise, I built it locally and it LGTM.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [bug#65706] [PATCH v3 1/2] gnu: enblend-enfuse: Backport upstream fixes.
  2023-09-02 21:38 [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation Bruno Victal
  2023-09-05 13:14 ` Maxim Cournoyer
  2023-09-05 14:59 ` [bug#65706] [PATCH v2] " Bruno Victal
@ 2023-09-16 16:49 ` Bruno Victal
  2023-09-16 16:49 ` [bug#65706] [PATCH v3 2/2] gnu: enblend-enfuse: Build documentation Bruno Victal
  3 siblings, 0 replies; 7+ messages in thread
From: Bruno Victal @ 2023-09-16 16:49 UTC (permalink / raw)
  To: 65706; +Cc: Bruno Victal, maxim.cournoyer

Backport changes for reproducible builds & missing include.

* gnu/packages/patches/enblend-enfuse-reproducible.patch: New file.
* gnu/local.mk: Register it.
* gnu/packages/photo.scm (enblend-enfuse)[source]: Use newly added patch. Add
snippet to fix missing header.
[arguments]<#:phases>: Remove 'add-missing-include.
---
 gnu/local.mk                                  |  1 +
 .../patches/enblend-enfuse-reproducible.patch | 44 +++++++++++++++++++
 gnu/packages/photo.scm                        | 25 ++++++-----
 3 files changed, 59 insertions(+), 11 deletions(-)
 create mode 100644 gnu/packages/patches/enblend-enfuse-reproducible.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 672050723f..54217fbd5a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1113,6 +1113,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/emacs-kv-fix-tests.patch	\
   %D%/packages/patches/emacs-pgtk-super-key-fix.patch	\
   %D%/packages/patches/emacs-xelb-ignore-length-element.patch	\
+  %D%/packages/patches/enblend-enfuse-reproducible.patch	\
   %D%/packages/patches/enjarify-setup-py.patch			\
   %D%/packages/patches/enlightenment-fix-setuid-path.patch	\
   %D%/packages/patches/erlang-man-path.patch			\
diff --git a/gnu/packages/patches/enblend-enfuse-reproducible.patch b/gnu/packages/patches/enblend-enfuse-reproducible.patch
new file mode 100644
index 0000000000..8bd6a3aeda
--- /dev/null
+++ b/gnu/packages/patches/enblend-enfuse-reproducible.patch
@@ -0,0 +1,44 @@
+# HG changeset patch
+# User Bernhard M. Wiedemann <bwiedemann@suse.de>
+# Date 1502609999 -7200
+#      Sun Aug 13 09:39:59 2017 +0200
+# Node ID a98e00eed893f62dd8349fc2894abca3aff4b33a
+# Parent  41ce01b7d413b3654211da0147857e7d6a1495de
+Facilitate reproducible builds
+by allowing to externally hold constant the build date and time.
+See
+        https://reproducible-builds.org/specs/source-date-epoch/
+
+Backport asap.
+
+diff -r 41ce01b7d413 -r a98e00eed893 NEWS
+--- a/NEWS	Sun Aug 13 09:39:56 2017 +0200
++++ b/NEWS	Sun Aug 13 09:39:59 2017 +0200
+@@ -48,6 +48,12 @@
+           https://github.com/akrzemi1/Optional
+   where only "optional.hpp" is needed.
+ 
++- The environment variable SOURCE_DATE_EPOCH overrides the build
++  timestamp as recorded by the signatures.  See
++          https://reproducible-builds.org/specs/source-date-epoch/
++  for details.
++
++
+ 
+ * Version 4.2  "Compressor Road"
+ 
+diff -r 41ce01b7d413 -r a98e00eed893 src/DefaultSig.pm
+--- a/src/DefaultSig.pm	Sun Aug 13 09:39:56 2017 +0200
++++ b/src/DefaultSig.pm	Sun Aug 13 09:39:59 2017 +0200
+@@ -109,9 +109,10 @@
+ sub update_date_and_time {
+     my $self = shift;
+ 
++    my $now = $ENV{SOURCE_DATE_EPOCH} || time;
+     my ($second, $minute, $hour,
+         $day_of_month, $month, $year,
+-        $day_of_week) = $self->is_using_gmt() ? gmtime : localtime;
++        $day_of_week) = $self->is_using_gmt() ? gmtime($now) : localtime($now);
+ 
+     $self->{DATE} = $self->format_date($day_of_month, $month, $year + 1900, $day_of_week,
+                                        $self->weekdays->[$day_of_week],
diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index b290e2b29a..39f4ce10d6 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -370,7 +370,18 @@ (define-public enblend-enfuse
                                   name "-" version ".tar.gz"))
               (sha256
                (base32
-                "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))))
+                "0j5x011ilalb47ssah50ag0a4phgh1b0wdgxdbbp1gcyjcjf60w7"))
+              (patches
+               ;; TODO: Remove when updating.
+               ;; Fixed upstream with a98e00eed893f62dd8349fc2894abca3aff4b33a.
+               (search-patches "enblend-enfuse-reproducible.patch"))
+              (modules '((guix build utils)))
+              (snippet
+               ;; TODO: Remove when updating.
+               ;; Fixed upstream with 81e25afe71146aaaf5058c604034f35d57e3be9d.
+               #~(substitute* "src/minimizer.cc"
+                   (("^#include <gsl/gsl_errno\\.h>" all)
+                    (string-append all "\n#include <limits>"))))))
     (build-system gnu-build-system)
     (native-inputs
      (list pkg-config
@@ -395,16 +406,8 @@ (define-public enblend-enfuse
            vigra
            zlib))
     (arguments
-     (list #:configure-flags
-           #~(list "--enable-openmp")
-           #:phases
-           #~(modify-phases %standard-phases
-               (add-after 'unpack 'add-missing-include
-                 (lambda _
-                   (substitute* "src/minimizer.h"
-                     ;; Fix error: ‘numeric_limits’ is not a member of ‘std’.
-                     (("#include <vector>" line)
-                      (string-append line "\n#include <limits>"))))))))
+     (list
+      #:configure-flags #~(list "--enable-openmp")))
     (home-page "https://enblend.sourceforge.net/")
     (synopsis "Tools for combining and blending images")
     (description

base-commit: 0dc83ce53b8bad8473c80689ba212d9f9bb712b3
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [bug#65706] [PATCH v3 2/2] gnu: enblend-enfuse: Build documentation.
  2023-09-02 21:38 [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation Bruno Victal
                   ` (2 preceding siblings ...)
  2023-09-16 16:49 ` [bug#65706] [PATCH v3 1/2] gnu: enblend-enfuse: Backport upstream fixes Bruno Victal
@ 2023-09-16 16:49 ` Bruno Victal
  2023-09-17 20:27   ` bug#65706: " Maxim Cournoyer
  3 siblings, 1 reply; 7+ messages in thread
From: Bruno Victal @ 2023-09-16 16:49 UTC (permalink / raw)
  To: 65706; +Cc: Bruno Victal, maxim.cournoyer

Notes:
* transfig is not needed according to the NEWS since 4.2.
* help2man is not optional.

* gnu/packages/photo.scm (enblend-enfuse)[native-inputs]: Remove libxml2,
tidy-html and transfig. Replace imagemagick with imagemagick/stable. Add
graphviz-minimal, font-ghostscript, librsvg, m4, perl-readonly,
texlive-texloganalyser, texlive-bold-extra, texlive-cm-mf-extra-bold,
texlive-comment, texlive-float, texlive-enumitem, texlive-mdwtools,
texlive-hyphenat, texlive-index, texlive-listings, texlive-microtype,
texlive-etoolbox, texlive-nag, texlive-ragged2e, texlive-shorttoc,
texlive-bigfoot, texlive-xstring and hevea.
[arguments]<#:phases>: Add 'fontconfig-cache, 'exclude-doc-from-check
and 'install-doc. Replace 'build and 'install.
[outputs]: Add 'doc.
---
 gnu/packages/photo.scm | 82 +++++++++++++++++++++++++++++++++++++-----
 1 file changed, 74 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/photo.scm b/gnu/packages/photo.scm
index 39f4ce10d6..78ae61c799 100644
--- a/gnu/packages/photo.scm
+++ b/gnu/packages/photo.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2020. 2021, 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -60,6 +61,7 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages graphics)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages gstreamer)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages image)
@@ -70,8 +72,10 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages man)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages opencl)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -89,7 +93,6 @@ (define-module (gnu packages photo)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
   #:use-module (gnu packages wxwidgets)
-  #:use-module (gnu packages xfig)
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages xml)
   #:use-module ((srfi srfi-1) #:hide (zip))
@@ -387,14 +390,34 @@ (define-public enblend-enfuse
      (list pkg-config
            perl
            perl-timedate
+           help2man
            ;; For building the documentation.
            gnuplot
-           help2man
-           imagemagick
-           libxml2
-           (texlive-updmap.cfg)
-           tidy-html
-           transfig))
+           graphviz-minimal  ; for 'dot'
+           font-ghostscript
+           imagemagick/stable
+           librsvg
+           m4
+           perl-readonly
+           texlive-texloganalyser
+           (texlive-updmap.cfg
+            (list texlive-bold-extra
+                  texlive-cm-mf-extra-bold
+                  texlive-comment
+                  texlive-float
+                  texlive-enumitem
+                  texlive-mdwtools
+                  texlive-hyphenat
+                  texlive-index
+                  texlive-listings
+                  texlive-microtype
+                  texlive-etoolbox  ;used but not propagated by microtype
+                  texlive-nag
+                  texlive-ragged2e
+                  texlive-shorttoc
+                  texlive-bigfoot
+                  texlive-xstring))
+           hevea))
     (inputs
      (list boost
            gsl
@@ -407,7 +430,50 @@ (define-public enblend-enfuse
            zlib))
     (arguments
      (list
-      #:configure-flags #~(list "--enable-openmp")))
+      #:configure-flags #~(list "--enable-openmp")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'build 'fontconfig-cache
+            (lambda _
+              (setenv "XDG_CACHE_HOME" (mkdtemp "/tmp/cache-XXXXXX"))))
+          ;; XXX: There's some extreme sillyness when building the
+          ;; documentation. It gets rebuilt thrice, during build, check and
+          ;; install, possibly due to the effects of the invocation of
+          ;; UPDATED_ON in doc/Makefile.
+          ;; Reported: <URL:https://bugs.launchpad.net/enblend/+bug/2036319>
+          (add-after 'configure 'exclude-doc-from-check
+            (lambda _
+              (substitute* "doc/Makefile"
+                (("^(check:).+$" _ rule)
+                 (string-append rule "\n")))))
+          ;; XXX: Skip building the docs since they're rebuilt again
+          ;; during install.
+          (replace 'build
+            (lambda args
+              (with-directory-excursion "src"
+                (apply (assoc-ref %standard-phases 'build) args))))
+          ;; XXX: Save another doc rebuild when installing.
+          (replace 'install
+            ;; Intercept and insert a make-flag for this phase only.
+            (lambda* (#:key make-flags #:allow-other-keys)
+              (apply invoke "make" "install"
+                     (cons "MAYBE_DOC=" make-flags))))
+          ;; XXX: 'make install' doesn't install the docs.
+          (add-after 'install 'install-doc
+            (lambda* (#:key make-flags #:allow-other-keys)
+              ;; Install examples first, for which the 'install' rule works.
+              (with-directory-excursion "doc/examples"
+                (apply invoke "make" "install" make-flags))
+              ;; The docs have to be installed with specific rules.
+              (with-directory-excursion "doc"
+                (apply invoke "make"
+                       "install-ps-local"
+                       "install-html-local"
+                       "install-dvi-local"
+                       ;; Do not overwhelm the console by printing the source
+                       ;; to stdout.
+                       (cons "V=0" make-flags))))))))
+    (outputs '("out" "doc"))
     (home-page "https://enblend.sourceforge.net/")
     (synopsis "Tools for combining and blending images")
     (description
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#65706: [PATCH v3 2/2] gnu: enblend-enfuse: Build documentation.
  2023-09-16 16:49 ` [bug#65706] [PATCH v3 2/2] gnu: enblend-enfuse: Build documentation Bruno Victal
@ 2023-09-17 20:27   ` Maxim Cournoyer
  0 siblings, 0 replies; 7+ messages in thread
From: Maxim Cournoyer @ 2023-09-17 20:27 UTC (permalink / raw)
  To: Bruno Victal; +Cc: 65706-done

Hi,

Bruno Victal <mirai@makinata.eu> writes:

> Notes:
> * transfig is not needed according to the NEWS since 4.2.
> * help2man is not optional.
>
> * gnu/packages/photo.scm (enblend-enfuse)[native-inputs]: Remove libxml2,
> tidy-html and transfig. Replace imagemagick with imagemagick/stable. Add
> graphviz-minimal, font-ghostscript, librsvg, m4, perl-readonly,
> texlive-texloganalyser, texlive-bold-extra, texlive-cm-mf-extra-bold,
> texlive-comment, texlive-float, texlive-enumitem, texlive-mdwtools,
> texlive-hyphenat, texlive-index, texlive-listings, texlive-microtype,
> texlive-etoolbox, texlive-nag, texlive-ragged2e, texlive-shorttoc,
> texlive-bigfoot, texlive-xstring and hevea.
> [arguments]<#:phases>: Add 'fontconfig-cache, 'exclude-doc-from-check
> and 'install-doc. Replace 'build and 'install.
> [outputs]: Add 'doc.

Installed, thanks.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-17 20:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-02 21:38 [bug#65706] [PATCH] gnu: enblend-enfuse: Build documentation Bruno Victal
2023-09-05 13:14 ` Maxim Cournoyer
2023-09-05 14:59 ` [bug#65706] [PATCH v2] " Bruno Victal
2023-09-06 21:01   ` Maxim Cournoyer
2023-09-16 16:49 ` [bug#65706] [PATCH v3 1/2] gnu: enblend-enfuse: Backport upstream fixes Bruno Victal
2023-09-16 16:49 ` [bug#65706] [PATCH v3 2/2] gnu: enblend-enfuse: Build documentation Bruno Victal
2023-09-17 20:27   ` bug#65706: " Maxim Cournoyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).