[PATCH 0/4] Add Add go-github-com-wraparound-wrap

  • Done
  • quality assurance status badge
Details
One participant
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
Liliana Marie Prikler
Severity
normal
L
L
Liliana Marie Prikler wrote on 21 Aug 2023 20:35
(address . guix-patches@gnu.org)
cover.1692642912.git.liliana.prikler@gmail.com
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
L
L
Liliana Marie Prikler wrote on 21 Aug 2023 20:20
[PATCH 1/4] gnu: Add go-github-com-flopp-go-findfont.
(address . 65438@debbugs.gnu.org)
0ec2db7671d0b9706821c7d1e5a1014b886b5dd6.1692642912.git.liliana.prikler@gmail.com
* gnu/packages/golang.scm (go-github-com-flopp-go-findfont): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
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
L
L
Liliana Marie Prikler wrote on 21 Aug 2023 20:23
[PATCH 2/4] gnu: Add go-github-com-phpdave11-gofpdi.
(address . 65438@debbugs.gnu.org)
5f5bfbf2da09ac65c9f891bb1af2151691042024.1692642912.git.liliana.prikler@gmail.com
* gnu/packages/golang.scm (go-github-com-phpdave11-gofpdi): New variable.
---
gnu/packages/golang.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (42 lines)
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
L
L
Liliana Marie Prikler wrote on 21 Aug 2023 20:23
[PATCH 3/4] gnu: Add go-github-com-signintech-gopdf.
(address . 65438@debbugs.gnu.org)
0b17287be043c005ddab88fbdb994f61be54eb42.1692642912.git.liliana.prikler@gmail.com
* gnu/packages/golang.scm (go-github-com-signintech-gopdf): New variable.
---
gnu/packages/golang.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (36 lines)
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
L
L
Liliana Marie Prikler wrote on 21 Aug 2023 20:23
[PATCH 4/4] gnu: Add go-github-com-wraparound-wrap.
(address . 65438@debbugs.gnu.org)
0bfd3ed2480566cfc7932898d480e8876b2fb1e4.1692642912.git.liliana.prikler@gmail.com
* 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

Toggle diff (174 lines)
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
L
L
Liliana Marie Prikler wrote on 2 Sep 2023 07:15
(address . 65438-done@debbugs.gnu.org)
acf88bf93bd2e71e1392822f1bfa5e25680c76d3.camel@gmail.com
Am Montag, dem 21.08.2023 um 20:23 +0200 schrieb Liliana Marie Prikler:
Toggle quote (6 lines)
> * 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.
Closed
?