all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Add gerbv.
@ 2015-08-31  6:50 Ricardo Wurmus
  2015-09-01 21:14 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2015-08-31  6:50 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Attached is a patch for gerbv (and its input “po4a”), a Gerber file
viewer.  When designing a PCB, the layout is usually exported in the
common Gerber file format and sent to the PCB manufacturers.


[-- Attachment #2: 0001-gnu-Add-po4a.patch --]
[-- Type: text/x-patch, Size: 4658 bytes --]

From e992f3d52f99219f25f00d1917ca6f83f9e805f3 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Mon, 31 Aug 2015 08:46:12 +0200
Subject: [PATCH 1/2] gnu: Add po4a.

* gnu/packages/gettext.scm (po4a): New variable.
---
 gnu/packages/gettext.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 70 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gettext.scm b/gnu/packages/gettext.scm
index 6be3093..a4487ef 100644
--- a/gnu/packages/gettext.scm
+++ b/gnu/packages/gettext.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -18,11 +19,15 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages gettext)
-  #:use-module ((guix licenses) #:select (gpl3+))
+  #:use-module ((guix licenses) #:select (gpl2+ gpl3+))
   #:use-module (gnu packages)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system perl)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages perl)
+  #:use-module (gnu packages texlive)
   #:use-module (gnu packages xml))
 
 ;; Use that name to avoid clashes with Guile's 'gettext' procedure.
@@ -91,3 +96,67 @@ with the means to create message catalogs, as well as an Emacs mode to work
 with them, and a runtime library to load translated messages from the
 catalogs.  Nearly all GNU packages use Gettext.")
     (license gpl3+)))                             ;some files are under GPLv2+
+
+(define-public po4a
+  (package
+    (name "po4a")
+    (version "0.47")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://alioth.debian.org/frs/download.php"
+                                  "/file/4142/po4a-" version ".tar.gz"))
+              (sha256
+               (base32
+                "01vm0750aq0h2lphrflv3wq9gz7y0py8frglfpacn58ivyvy242h"))))
+    (build-system perl-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         ;; FIXME: One test fails as we don't have SGMLS.pm
+         (add-before 'check 'disable-sgml-test
+          (lambda _
+            (delete-file "t/20-sgml.t")
+            #t))
+         (add-after 'unpack 'fix-builder
+          (lambda* (#:key inputs outputs #:allow-other-keys)
+            (substitute* "Po4aBuilder.pm"
+              ;; By default it tries to install into perl's manpath.
+              (("my \\$mandir = .*$")
+               (string-append "my $mandir = \"" (assoc-ref outputs "out")
+                              "/share/man\";\n"))
+              ;; Use local docbook XSL
+              (((string-append "--nonet http://docbook.sourceforge.net/"
+                                "release/xsl/current"
+                                "/manpages/docbook.xsl"))
+               (string-append "--nonet "
+                              (assoc-ref inputs "docbook-xsl")
+                              ;; TODO: replace version string
+                              "/xml/xsl/docbook-xsl-"  "1.78.1"
+                              "/manpages/docbook.xsl")))
+            #t))
+         (add-after 'install 'wrap-programs
+          (lambda* (#:key outputs #:allow-other-keys)
+            ;; Make sure all executables in "bin" find the Perl modules
+            ;; provided by this package at runtime.
+            (let* ((out  (assoc-ref outputs "out"))
+                   (bin  (string-append out "/bin/"))
+                   (path (string-append out "/lib/perl5/site_perl")))
+              (for-each (lambda (file)
+                          (wrap-program file
+                            `("PERL5LIB" ":" prefix (,path))))
+                        (find-files bin "\\.*$"))
+              #t))))))
+    (native-inputs
+     `(("gettext" ,gnu-gettext)
+       ("perl-module-build" ,perl-module-build)
+       ("docbook-xsl" ,docbook-xsl)
+       ("docbook-xml" ,docbook-xml) ;for tests
+       ("texlive-bin" ,texlive-bin) ;for tests
+       ("xsltproc" ,libxslt)))
+    (home-page "http://po4a.alioth.debian.org/")
+    (synopsis "Scripts to ease maintenance of translations")
+    (description
+     "The po4a (PO for anything) project goal is to ease translations (and
+more interestingly, the maintenance of translations) using gettext tools on
+areas where they were not expected like documentation.")
+    (license gpl2+)))
-- 
2.5.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-gerbv.patch --]
[-- Type: text/x-patch, Size: 3069 bytes --]

From 87f3d5df4cb7672e6dcdaa1e4e2b7fc59ff37e11 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Mon, 31 Aug 2015 08:47:09 +0200
Subject: [PATCH 2/2] gnu: Add gerbv.

* gnu/packages/engineering.scm (gerbv): New variable.
---
 gnu/packages/engineering.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 7faf61e..76da6e7 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -28,6 +28,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
+  #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
@@ -35,6 +36,7 @@
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -364,3 +366,48 @@ multipole-accelerated algorithm.")
      "Fasthenry is an inductance extraction program based on a
 multipole-accelerated algorithm.")
     (license (license:non-copyleft #f "See induct.c."))))
+
+(define-public gerbv
+  (package
+    (name "gerbv")
+    (version "2.6.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
+                                  version "/gerbv-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'autoconf
+          (lambda _
+            ;; Build rules contain references to Russian translation, but the
+            ;; needed files are missing; see
+            ;; http://sourceforge.net/p/gerbv/bugs/174/
+            (delete-file "po/LINGUAS")
+            (substitute* "man/Makefile.am"
+              (("PO_FILES= gerbv.ru.1.in.po") "")
+              (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
+            (zero? (system* "autoreconf" "-vfi")))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("gettext" ,gnu-gettext)
+       ("po4a" ,po4a)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("cairo" ,cairo)
+       ("gtk" ,gtk+-2)
+       ("desktop-file-utils" ,desktop-file-utils)))
+    (home-page "http://gerbv.geda-project.org/")
+    (synopsis "Gerber file viewer")
+    (description
+     "Gerbv is a Gerber file (RS-274X only) viewer.  Gerbv lets you load
+several files on top of each other, do measurements on the displayed image,
+etc.  Besides viewing Gerbers, you may also view Excellon drill files as well
+as pick-place file.")
+    (license license:gpl2+)))
-- 
2.5.0


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

* Re: [PATCH] Add gerbv.
  2015-08-31  6:50 [PATCH] Add gerbv Ricardo Wurmus
@ 2015-09-01 21:14 ` Ludovic Courtès
  2015-09-02  6:31   ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2015-09-01 21:14 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Ricardo Wurmus <rekado@elephly.net> skribis:

> From e992f3d52f99219f25f00d1917ca6f83f9e805f3 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Mon, 31 Aug 2015 08:46:12 +0200
> Subject: [PATCH 1/2] gnu: Add po4a.
>
> * gnu/packages/gettext.scm (po4a): New variable.

[...]

> +            (substitute* "Po4aBuilder.pm"
> +              ;; By default it tries to install into perl's manpath.
> +              (("my \\$mandir = .*$")
> +               (string-append "my $mandir = \"" (assoc-ref outputs "out")
> +                              "/share/man\";\n"))
> +              ;; Use local docbook XSL
> +              (((string-append "--nonet http://docbook.sourceforge.net/"
> +                                "release/xsl/current"
> +                                "/manpages/docbook.xsl"))

Rather make it a string literal, using backslashes for newlines, but...

> +               (string-append "--nonet "
> +                              (assoc-ref inputs "docbook-xsl")
> +                              ;; TODO: replace version string
> +                              "/xml/xsl/docbook-xsl-"  "1.78.1"
> +                              "/manpages/docbook.xsl")))

... can this be avoided altogether by adding libxml2 as an input (which
sets $XML_CATALOG_FILES as a side-effect)?

Otherwise LGTM.

> From 87f3d5df4cb7672e6dcdaa1e4e2b7fc59ff37e11 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Mon, 31 Aug 2015 08:47:09 +0200
> Subject: [PATCH 2/2] gnu: Add gerbv.
>
> * gnu/packages/engineering.scm (gerbv): New variable.

[...]

> +            ;; Build rules contain references to Russian translation, but the
> +            ;; needed files are missing; see
> +            ;; http://sourceforge.net/p/gerbv/bugs/174/
> +            (delete-file "po/LINGUAS")
> +            (substitute* "man/Makefile.am"
> +              (("PO_FILES= gerbv.ru.1.in.po") "")
> +              (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
> +            (zero? (system* "autoreconf" "-vfi")))))))

Could you modify Makefile.in instead?  That would hopefully allow us to
remove the dependency on the autotools.

> +     "Gerbv is a Gerber file (RS-274X only) viewer.  Gerbv lets you load

What about giving a bit more context, along the lines of:

  Gerbv is a viewer for files in the Gerber format (RS-274X only), which
  is commonly used to represent printed circuit board (PCB) layouts.

?

Otherwise, LGTM.

Thanks,
Ludo’.

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

* Re: [PATCH] Add gerbv.
  2015-09-01 21:14 ` Ludovic Courtès
@ 2015-09-02  6:31   ` Ricardo Wurmus
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2015-09-02  6:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel


Ludovic Courtès <ludo@gnu.org> writes:

>> * gnu/packages/gettext.scm (po4a): New variable.
>
> [...]
>
>> +               (string-append "--nonet "
>> +                              (assoc-ref inputs "docbook-xsl")
>> +                              ;; TODO: replace version string
>> +                              "/xml/xsl/docbook-xsl-"  "1.78.1"
>> +                              "/manpages/docbook.xsl")))
>
> ... can this be avoided altogether by adding libxml2 as an input (which
> sets $XML_CATALOG_FILES as a side-effect)?

Oh, I did not know this.  Yes, with libxml2 as an input this hackery is
not needed.  Thanks!

>> * gnu/packages/engineering.scm (gerbv): New variable.
>
> [...]
>
>> +            ;; Build rules contain references to Russian translation, but the
>> +            ;; needed files are missing; see
>> +            ;; http://sourceforge.net/p/gerbv/bugs/174/
>> +            (delete-file "po/LINGUAS")
>> +            (substitute* "man/Makefile.am"
>> +              (("PO_FILES= gerbv.ru.1.in.po") "")
>> +              (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
>> +            (zero? (system* "autoreconf" "-vfi")))))))
>
> Could you modify Makefile.in instead?  That would hopefully allow us to
> remove the dependency on the autotools.

Unfortunately, the tarball comes without the ‘configure’ script, so we
need to use autotools to generate it.

>> +     "Gerbv is a Gerber file (RS-274X only) viewer.  Gerbv lets you load
>
> What about giving a bit more context, along the lines of:
>
>   Gerbv is a viewer for files in the Gerber format (RS-274X only), which
>   is commonly used to represent printed circuit board (PCB) layouts.

Okay.  I’ll push with these changes.  Thanks for the review!

~~ Ricardo

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

end of thread, other threads:[~2015-09-02  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-31  6:50 [PATCH] Add gerbv Ricardo Wurmus
2015-09-01 21:14 ` Ludovic Courtès
2015-09-02  6:31   ` Ricardo Wurmus

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.