From patchwork Mon Aug 21 18:23:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 53087 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 07E1927BBEA; Mon, 21 Aug 2023 20:37:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D839A27BBE2 for ; Mon, 21 Aug 2023 20:37:08 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYAhy-0001dC-LQ; Mon, 21 Aug 2023 15:37:02 -0400 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 ) id 1qYAhx-0001cG-4L for guix-patches@gnu.org; Mon, 21 Aug 2023 15:37:01 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYAhw-0005KQ-SF for guix-patches@gnu.org; Mon, 21 Aug 2023 15:37:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYAhz-0003yr-74 for guix-patches@gnu.org; Mon, 21 Aug 2023 15:37:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65438] [PATCH 4/4] gnu: Add go-github-com-wraparound-wrap. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 21 Aug 2023 19:37:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65438 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65438@debbugs.gnu.org Received: via spool by 65438-submit@debbugs.gnu.org id=B65438.169264658715234 (code B ref 65438); Mon, 21 Aug 2023 19:37:03 +0000 Received: (at 65438) by debbugs.gnu.org; 21 Aug 2023 19:36:27 +0000 Received: from localhost ([127.0.0.1]:57906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYAhO-0003xY-Gh for submit@debbugs.gnu.org; Mon, 21 Aug 2023 15:36:27 -0400 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]:48268) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYAhL-0003wo-2U for 65438@debbugs.gnu.org; Mon, 21 Aug 2023 15:36:23 -0400 Received: by mail-ej1-x641.google.com with SMTP id a640c23a62f3a-99c47ef365cso506188066b.0 for <65438@debbugs.gnu.org>; Mon, 21 Aug 2023 12:36:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692646575; x=1693251375; h=mime-version:to:subject:date:from:references:in-reply-to:message-id :from:to:cc:subject:date:message-id:reply-to; bh=t5Sf1Fehzh4JHoIR9SEGrmeO8ncAaz9e/KttRb1ljBg=; b=TDTVJ/3oxpGg9CypE51ObvQHfmQWgBQHwuJSb4rZCYMp9QqpBFrxOYQswsDPDbq1uf 50Zh6Kpc/U+TL8zTXyo8octW5Fd9tdZX/ovQzl1tOk1EX8ili6Zf1hioS4Mxrgkw59FG yc2oKMoI6NAGupGY/gSL7i/39ab22IwJ5BVyMUS+WXXGxijpea1zI6W4GOzm2JszvNsV b+ko1anbNu/F7Pg2gLYkoU/81ZeD4ocuHB3eqVB93eDXW4z+wkchAKnLlZZcHk/99FOD XLEJpyp6M0n50rzTSFyS1A8F1abnTzGpLObT92PXCL3iqM7Y5vMzHaOhGNO+dha/i6J5 KTMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692646575; x=1693251375; h=mime-version:to:subject:date:from:references:in-reply-to:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=t5Sf1Fehzh4JHoIR9SEGrmeO8ncAaz9e/KttRb1ljBg=; b=YblSrk3Vdp8z9eOmbKCq+tGzW2vKZupAVBn/zpSem8nggEejjZ7LcVuzkczXi2oixU 085l6CrwPJmMfpAy6pLAIReIq5WehejxP3sFixpcVHacXsj3u6iAFUcAJXpQ8GM2/EZ0 EpxKMZU2tedrSoY5IGLAdTOGjFNVbjm9dhI/PVIy47mTIrNeb1MRqkYeV1Ss/7AuM/rs iqDcW0Sh7GbTlWrOa6w8yGwDuyxPhLpaNdvtvKSHrKYtclVLZzUNfds552oesOIiptwl NcHVJAyu4HgLVmvukhsaeiDIfHKwdB/p6h56frge5zGY2BqN6ypqoKgr94fBVzIUguXO RhpQ== X-Gm-Message-State: AOJu0Yy6rb6ziZu8zCqvkczHQGzTDzXA7u84MP03n7VMxQaWmvbgBiIE DBK2ylCsznSuD8dltLUxE96ZiMId0QNcWw== X-Google-Smtp-Source: AGHT+IEKAusF4zG8j5ng+raK0pqyVwjSZwbvLv/20TLc7FlKwTLTn8wBPIGd6hKVKpQHvds+kLAhzg== X-Received: by 2002:a17:907:2c6a:b0:99b:56f1:3002 with SMTP id ib10-20020a1709072c6a00b0099b56f13002mr6179224ejc.61.1692646574675; Mon, 21 Aug 2023 12:36:14 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id i12-20020a1709061ccc00b00991e2b5a27dsm7001079ejh.37.2023.08.21.12.36.13 for <65438@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 12:36:13 -0700 (PDT) Message-ID: <0bfd3ed2480566cfc7932898d480e8876b2fb1e4.1692642912.git.liliana.prikler@gmail.com> In-Reply-To: References: From: Liliana Marie Prikler Date: Mon, 21 Aug 2023 20:23:37 +0200 MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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