GNU bug report logs - #65438
[PATCH 0/4] Add Add go-github-com-wraparound-wrap

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Mon, 21 Aug 2023 18:44:01 UTC

Severity: normal

Tags: patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 65438 in the body.
You can then email your comments to 65438 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#65438; Package guix-patches. (Mon, 21 Aug 2023 18:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 21 Aug 2023 18:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/4] Add Add go-github-com-wraparound-wrap
Date: Mon, 21 Aug 2023 20:35:12 +0200
Hi Guix,

this package adds a Go-based command line utility to process Fountain
markup.  I packaged it as though it were a Go library, since that's
what the importer does, but at least got rid of all the input labels.

Cheers

Liliana Marie Prikler (4):
  gnu: Add go-github-com-flopp-go-findfont.
  gnu: Add go-github-com-phpdave11-gofpdi.
  gnu: Add go-github-com-signintech-gopdf.
  gnu: Add go-github-com-wraparound-wrap.

 gnu/local.mk                                  |   1 +
 gnu/packages/golang.scm                       | 127 ++++++++++++++++++
 ...ithub-com-wraparound-wrap-free-fonts.patch |  84 ++++++++++++
 3 files changed, 212 insertions(+)
 create mode 100644 gnu/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch


base-commit: 18b6e309cec3a0c9c7401b131e18612914f1fcf9
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65438; Package guix-patches. (Mon, 21 Aug 2023 19:37:01 GMT) Full text and rfc822 format available.

Message #8 received at 65438 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 65438 <at> debbugs.gnu.org
Subject: [PATCH 1/4] gnu: Add go-github-com-flopp-go-findfont.
Date: Mon, 21 Aug 2023 20:20:40 +0200
* gnu/packages/golang.scm (go-github-com-flopp-go-findfont): New variable.
---
 gnu/packages/golang.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 5a53838435..6de35767c3 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2437,6 +2437,29 @@ (define-public go-github-com-willscott-goturn
 parsing and encoding support for STUN and TURN protocols.")
       (license license:bsd-3))))
 
+(define-public go-github-com-flopp-go-findfont
+  (package
+    (name "go-github-com-flopp-go-findfont")
+    (version "0.1.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/flopp/go-findfont")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "05jvs5sw6yid0qr2ld7aw0n1mjp47jxhvbg9lsdig86668i2fj2q"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/flopp/go-findfont"))
+    (home-page "https://github.com/flopp/go-findfont")
+    (synopsis "go-findfont")
+    (description
+     "This package provides a platform-agnostic Go library to locate
+TrueType font files in your system's user and system font directories.")
+    (license license:expat)))
+
 (define-public go-torproject-org-pluggable-transports-goptlib
   (package
     (name "go-torproject-org-pluggable-transports-goptlib")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65438; Package guix-patches. (Mon, 21 Aug 2023 19:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 65438 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 65438 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gnu: Add go-github-com-phpdave11-gofpdi.
Date: Mon, 21 Aug 2023 20:23:01 +0200
* gnu/packages/golang.scm (go-github-com-phpdave11-gofpdi): New variable.
---
 gnu/packages/golang.scm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 6de35767c3..d8dd82e06f 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2460,6 +2460,35 @@ (define-public go-github-com-flopp-go-findfont
 TrueType font files in your system's user and system font directories.")
     (license license:expat)))
 
+(define-public go-github-com-phpdave11-gofpdi
+  (package
+    (name "go-github-com-phpdave11-gofpdi")
+    (version "1.0.13")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/phpdave11/gofpdi")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "01r8a3k2d48fxmhyvix0ry2dc1z5xankd14yxlm496a26vfnc9nq"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/phpdave11/gofpdi"
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'fix-source
+                     (lambda _
+                       (substitute* (find-files "." "writer\\.go$")
+                         (("%s-%s") "%d-%s")))))))
+    (propagated-inputs (list go-github-com-pkg-errors))
+    (home-page "https://github.com/phpdave11/gofpdi")
+    (synopsis "PDF document importer")
+    (description
+     "gofpdi allows you to import an existing PDF into a new PDF.")
+    (license license:expat)))
+
 (define-public go-torproject-org-pluggable-transports-goptlib
   (package
     (name "go-torproject-org-pluggable-transports-goptlib")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65438; Package guix-patches. (Mon, 21 Aug 2023 19:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 65438 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 65438 <at> debbugs.gnu.org
Subject: [PATCH 3/4] gnu: Add go-github-com-signintech-gopdf.
Date: Mon, 21 Aug 2023 20:23:19 +0200
* gnu/packages/golang.scm (go-github-com-signintech-gopdf): New variable.
---
 gnu/packages/golang.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index d8dd82e06f..1617182243 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2489,6 +2489,29 @@ (define-public go-github-com-phpdave11-gofpdi
      "gofpdi allows you to import an existing PDF into a new PDF.")
     (license license:expat)))
 
+(define-public go-github-com-signintech-gopdf
+  (package
+    (name "go-github-com-signintech-gopdf")
+    (version "0.18.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/signintech/gopdf")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1jf8a896qh871mdr1i7f0fdpqki5pkk1sp6p5dq404zqxpd7lq5l"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/signintech/gopdf"))
+    (propagated-inputs (list go-github-com-pkg-errors
+                             go-github-com-phpdave11-gofpdi))
+    (home-page "https://github.com/signintech/gopdf")
+    (synopsis "Generating PDF documents")
+    (description "gopdf is a Go library for generating PDF documents.")
+    (license license:expat)))
+
 (define-public go-torproject-org-pluggable-transports-goptlib
   (package
     (name "go-torproject-org-pluggable-transports-goptlib")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#65438; Package guix-patches. (Mon, 21 Aug 2023 19:37:03 GMT) Full text and rfc822 format available.

Message #17 received at 65438 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 65438 <at> debbugs.gnu.org
Subject: [PATCH 4/4] gnu: Add go-github-com-wraparound-wrap.
Date: Mon, 21 Aug 2023 20:23:37 +0200
* gnu/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it here.
* gnu/packages/golang.scm (go-github-com-wraparound-wrap): New variable.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/golang.scm                       | 52 ++++++++++++
 ...ithub-com-wraparound-wrap-free-fonts.patch | 84 +++++++++++++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 gnu/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index e4f5b2078a..1f10dd7f20 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1314,6 +1314,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/go-github-com-golang-snappy-32bit-test.patch \
   %D%/packages/patches/go-github-com-urfave-cli-fix-tests.patch \
   %D%/packages/patches/go-github-com-urfave-cli-v2-fix-tests.patch \
+  %D%/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch \
   %D%/packages/patches/go-skip-gc-test.patch			\
   %D%/packages/patches/gourmet-sqlalchemy-compat.patch		\
   %D%/packages/patches/gpaste-fix-paths.patch			\
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 1617182243..b6e25b5183 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -74,6 +74,7 @@ (define-module (gnu packages golang)
   #:use-module (gnu packages base)
   #:use-module ((gnu packages bootstrap) #:select (glibc-dynamic-linker))
   #:use-module (gnu packages check)
+  #:use-module (gnu packages fonts)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnupg)
@@ -2512,6 +2513,57 @@ (define-public go-github-com-signintech-gopdf
     (description "gopdf is a Go library for generating PDF documents.")
     (license license:expat)))
 
+(define-public go-github-com-wraparound-wrap
+  (package
+    (name "go-github-com-wraparound-wrap")
+    (version "0.3.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/Wraparound/wrap")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0scf7v83p40r9k7k5v41rwiy9yyanfv3jm6jxs9bspxpywgjrk77"))
+              (patches (search-patches
+                        "go-github-com-wraparound-wrap-free-fonts.patch"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/Wraparound/wrap/"
+      #:tests? #f                       ; no tests
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'build
+            (lambda* (#:key import-path #:allow-other-keys)
+              (invoke "go" "install" "-v" "-x"
+                      "-ldflags=-s -w"
+                      (string-append import-path "cmd/wrap"))))
+          (add-after 'wrap 'wrap-fonts
+            (lambda* (#:key inputs outputs #:allow-other-keys)
+              (for-each
+               (lambda (program)
+                 (wrap-program program
+                   `("XDG_DATA_DIRS" suffix
+                     ,(map dirname
+                           (search-path-as-list '("share/fonts")
+                                                (map cdr inputs))))))
+               (find-files (string-append (assoc-ref outputs "out")
+                                          "/bin"))))))))
+    (propagated-inputs (list go-github-com-spf13-cobra
+                             go-github-com-signintech-gopdf
+                             go-github-com-flopp-go-findfont))
+    (inputs (list font-liberation font-gnu-freefont))
+    (home-page "https://github.com/Wraparound/wrap")
+    (synopsis "Format Fountain screenplays")
+    (description
+     "Wrap is a command line tool that is able to convert Fountain files into a
+correctly formatted screen- or stageplay as an HTML or a PDF.  It supports
+standard Fountain, but also has some custom syntax extensions such as
+translated keywords and acts.")
+    (license license:gpl3)))
+
 (define-public go-torproject-org-pluggable-transports-goptlib
   (package
     (name "go-torproject-org-pluggable-transports-goptlib")
diff --git a/gnu/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch b/gnu/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch
new file mode 100644
index 0000000000..91b187a2d3
--- /dev/null
+++ b/gnu/packages/patches/go-github-com-wraparound-wrap-free-fonts.patch
@@ -0,0 +1,84 @@
+Index: wrap-source/pkg/pdf/fonts.go
+===================================================================
+--- wrap-source.orig/pkg/pdf/fonts.go
++++ wrap-source/pkg/pdf/fonts.go
+@@ -36,15 +36,15 @@ var (
+ 		BoldItalic:     []string{"Courier Prime Bold Italic.ttf"},
+ 	}
+ 
+-	CourierNew = Font{
+-		RomanName:      "Courier New",
+-		Roman:          []string{"Courier New.ttf", "cour.ttf"},
+-		BoldName:       "Courier New Bold",
+-		Bold:           []string{"Courier New Bold.ttf", "courbd.ttf"},
+-		ItalicName:     "Courier New Italic",
+-		Italic:         []string{"Courier New Italic.ttf", "couri.ttf"},
+-		BoldItalicName: "Courier New Bold Italic",
+-		BoldItalic:     []string{"Courier New Bold Italic.ttf", "courbi.ttf"},
++	LiberationMono = Font{
++		RomanName:      "Liberation Mono Regular",
++		Roman:          []string{"LiberationMono-Regular.ttf"},
++		BoldName:       "Liberation Mono Bold",
++		Bold:           []string{"LiberationMono-Bold.ttf"},
++		ItalicName:     "Liberation Mono Italic",
++		Italic:         []string{"LiberationMono-Italic.ttf"},
++		BoldItalicName: "Liberation Mono Bold Italic",
++		BoldItalic:     []string{"LiberationMono-BoldItalic.ttf"},
+ 	}
+ 
+ 	FreeMono = Font{
+@@ -151,9 +151,8 @@ func loadFonts() {
+ 		err := loadFont(CourierPrime)
+ 
+ 		if err != nil {
+-			// Courier New should be available on macOS and Windows
+ 			fmt.Fprintln(os.Stderr, "Warning: "+err.Error())
+-			err = loadFont(CourierNew)
++			err = loadFont(LiberationMono)
+ 
+ 			if err != nil {
+ 				// FreeMono as a final attempt
+Index: wrap-source/pkg/cli/pdf.go
+===================================================================
+--- wrap-source.orig/pkg/cli/pdf.go
++++ wrap-source/pkg/cli/pdf.go
+@@ -22,7 +22,7 @@ var pdfCmd = &cobra.Command{
+ var (
+ 	pdfProductionFlag bool
+ 	useCourierPrime   bool
+-	useCourierNew     bool
++	useLiberationMono     bool
+ 	useFreeMono       bool
+ 	pageSize          string
+ 	font              string
+@@ -31,7 +31,7 @@ var (
+ func init() {
+ 	pdfCmd.Flags().BoolVarP(&pdfProductionFlag, "production", "p", false, "add scene numbers and other production text")
+ 	pdfCmd.Flags().BoolVar(&useCourierPrime, "use-courier-prime", false, "force the usage of Courier Prime")
+-	pdfCmd.Flags().BoolVar(&useCourierNew, "use-courier-new", false, "force the usage of Courier New")
++	pdfCmd.Flags().BoolVar(&useLiberationMono, "use-courier-new", false, "force the usage of Liberation Mono")
+ 	pdfCmd.Flags().BoolVar(&useFreeMono, "use-freemono", false, "force the usage of GNU FreeMono")
+ 	pdfCmd.Flags().StringVar(&pageSize, "page-size", "", "choose page size (letter or a4)")
+ 	pdfCmd.RegisterFlagCompletionFunc("page-size", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+@@ -46,8 +46,8 @@ func pdfRun(cmd *cobra.Command, args []s
+ 	// Evaluate font selection
+ 	pdf.AutoFontSelection = false
+ 
+-	if (font != "" && atLeastOne(useCourierPrime, useCourierNew, useFreeMono)) ||
+-		moreThanOne(useCourierPrime, useCourierNew, useFreeMono) {
++	if (font != "" && atLeastOne(useCourierPrime, useLiberationMono, useFreeMono)) ||
++		moreThanOne(useCourierPrime, useLiberationMono, useFreeMono) {
+ 		// The fonts are mutualy exclusive so throw an error
+ 		handle(errors.New("tried to force multiple fonts at the same time"))
+ 	}
+@@ -77,8 +77,8 @@ func pdfRun(cmd *cobra.Command, args []s
+ 	} else if useCourierPrime {
+ 		pdf.SelectedFont = pdf.CourierPrime
+ 
+-	} else if useCourierNew {
+-		pdf.SelectedFont = pdf.CourierNew
++	} else if useLiberationMono {
++		pdf.SelectedFont = pdf.LiberationMono
+ 
+ 	} else if useFreeMono {
+ 		pdf.SelectedFont = pdf.FreeMono
-- 
2.41.0





Reply sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
You have taken responsibility. (Sat, 02 Sep 2023 05:16:02 GMT) Full text and rfc822 format available.

Notification sent to Liliana Marie Prikler <liliana.prikler <at> gmail.com>:
bug acknowledged by developer. (Sat, 02 Sep 2023 05:16:02 GMT) Full text and rfc822 format available.

Message #22 received at 65438-done <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: 65438-done <at> debbugs.gnu.org
Subject: Re: [PATCH 4/4] gnu: Add go-github-com-wraparound-wrap.
Date: Sat, 02 Sep 2023 07:15:39 +0200
Am Montag, dem 21.08.2023 um 20:23 +0200 schrieb Liliana Marie Prikler:
> * gnu/packages/patches/go-github-com-wraparound-wrap-free-
> fonts.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it here.
> * gnu/packages/golang.scm (go-github-com-wraparound-wrap): New
> variable.
> ---
Pushed.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 Sep 2023 11:24:14 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.