From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MIkUCuW842SRHAEASxT56A (envelope-from ) for ; Mon, 21 Aug 2023 21:37:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CF4/CuW842QnBQAA9RJhRA (envelope-from ) for ; Mon, 21 Aug 2023 21:37:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CB354577DF for ; Mon, 21 Aug 2023 21:37:08 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b="TDTVJ/3o"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692646628; a=rsa-sha256; cv=none; b=QIaMzxIacN6qwa/oi+/XjRTPa+RfqVAOshfKmsYlkrB5RGVGZuwFmR+Ecasr9dRZhkix8d m8EpS3rVpwyFVnmOyj9yT1I7n7IWfignAsytLvBaY7ts5Ln0Tl982SOLfs7vR1RXY/nyHl OsX7CAwfUhLHQBoKIt4ddzdsKRqV8NUtOvbqCUXHFiem4INGjfUPEyoI/AWEGpXJMtQYqv rpXzNt6As9szaRdINOJHFffiwlFidwrVLs6ZSIxfGL496afTKlmissUUoNEYJeMVxD3Ebq h9jCqXsrWT7bh9QrBdGLOiN/jG7Sy3RpDxkDq9n/oSe9CCJ1nvoh2wPov5BCBg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b="TDTVJ/3o"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692646628; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=t5Sf1Fehzh4JHoIR9SEGrmeO8ncAaz9e/KttRb1ljBg=; b=RThc5ewDAiSavKi56BFRmnWLjaYdccRziugMmM6tOvmY4UqtzadQyHylHYEWjrG5hoLK6L uFxST5YV6zmGiIW5w/rf38bJpW+0cI40W+iKT8IX0hiqj8s+RWIB/r6ayC/obAvHdAybC3 FloDHfIKEXLB9TrlansBYhqwI+xUvE6AZj0Cx2nJiBi7WteEwRiz68si77N3lJIusLpt13 1QS1pCpvhZG8h50R9DY0tP7kYTR+bWaW/ub0Pru435c1P0jYDJrHhWokgfLmNzoX36ZNLo L6q0Sn+uS88vBP+LTNL5KgRRgpoUfFG9dtr/Ok20N7Yvke2yU0v7nmy60zZzAg== 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Spam-Score: -2.10 X-Migadu-Queue-Id: CB354577DF X-Migadu-Spam-Score: -2.10 X-TUID: w8i/ZV9hoomm * 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