unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 4/4] gnu: Add transfig.
@ 2014-10-10 18:19 Eric Bavier
  2014-10-11 22:03 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Bavier @ 2014-10-10 18:19 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0004-gnu-Add-transfig.patch --]
[-- Type: text/x-diff, Size: 3892 bytes --]

From ece0a8dec5d95ccf84156e9e6c0c582639163b1e Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Fri, 10 Oct 2014 13:11:22 -0500
Subject: [PATCH 4/4] gnu: Add transfig.

* gnu/packages/xfig.scm (transfig): New variable.
---
 gnu/packages/xfig.scm |   74 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm
index 7cb2258..c382788 100644
--- a/gnu/packages/xfig.scm
+++ b/gnu/packages/xfig.scm
@@ -129,3 +129,77 @@ such as GIF, JPEG, EPSF (PostScript), etc.  Those objects can be created,
 deleted, moved or modified.  Attributes such as colors or line styles can be
 selected in various ways.  For text, 35 fonts are available.")
     (license bsd-2)))
+
+(define-public transfig
+  (package
+    (name "transfig")
+    (version "3.2.5e")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "mirror://sourceforge/mcj/mcj-source/transfig."
+                          version ".tar.gz"))
+      (sha256
+       (base32
+        "0i3p7qmg2w8qrad3pn42b0miwarql7yy0gpd49b1bpal6bqsiicf"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("imake" ,imake)
+       ("makedepend" ,makedepend)))
+    (inputs
+     `(("xfig"    ,xfig)
+       ("libjpeg" ,libjpeg)
+       ("libpng"  ,libpng)
+       ("libxpm"  ,libxpm)
+       ("libx11"  ,libx11)
+       ("zlib"    ,zlib)))
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (alist-replace
+        'configure
+        (lambda* (#:key inputs outputs #:allow-other-keys)
+          (let ((imake (assoc-ref inputs "imake"))
+                (out   (assoc-ref outputs "out")))
+            (substitute* '("fig2dev/Imakefile"
+                           "transfig/Imakefile")
+              (("XCOMM (BINDIR = )[[:graph:]]*" _ front)
+               (string-append front out "/bin"))
+              (("XCOMM USEINLINE") "USEINLINE")
+              ;; The variable name is deceptive.  The directory is used as an
+              ;; installation path for bitmaps.
+              (("(XFIGLIBDIR =[[:blank:]]*)[[:graph:]]*" _ front)
+               (string-append front out "/lib"))
+              (("(XPMLIBDIR = )[[:graph:]]*" _ front)
+               (string-append front (assoc-ref inputs "libxpm") "/lib"))
+              (("(XPMINC = -I)[[:graph:]]*" _ front)
+               (string-append front (assoc-ref inputs "libxpm") "/include/X11"))
+              (("/usr/local/lib/fig2dev") (string-append out "/lib")))
+           ;; The -a argument is required in order to pick up the correct paths
+           ;; to several X header files.
+           (zero? (system* "xmkmf" "-a"))
+           (substitute* '("Makefile"
+                          "fig2dev/Makefile"
+                          "transfig/Makefile")
+             ;; This imake variable somehow remains undefined
+             (("DefaultGcc2AMD64Opt") "-O2")
+             ;; Reset a few variable defaults that are set in imake templates
+             ((imake) out)
+             (("(MANPATH = )[[:graph:]]*" _ front)
+              (string-append front out "/share/man"))
+             (("(CONFDIR = )([[:graph:]]*)" _ front default)
+              (string-append front out default)))))
+        (alist-cons-after
+         'install 'install/doc
+         (lambda _
+           (zero? (system* "make" "install.man")))
+         %standard-phases))))
+    (home-page "http://www.xfig.org/")
+    (synopsis "Create portable LaTeX figures")
+    (description
+     "Transfig creates a makefile to translate figures described in Fig code
+or PIC into a specified LaTeX graphics language.  PIC files are identified by
+the suffix \".pic\"; Fig files can be specified either with or without the
+suffix \".fig\".  Transfig also creates a TeX macro file appropriate to the
+target language.")
+    (license bsd-2)))
-- 
1.7.9.5


[-- Attachment #2: Type: text/plain, Size: 17 bytes --]


-- 
Eric Bavier

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

* Re: [PATCH 4/4] gnu: Add transfig.
  2014-10-10 18:19 [PATCH 4/4] gnu: Add transfig Eric Bavier
@ 2014-10-11 22:03 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2014-10-11 22:03 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel

Eric Bavier <ericbavier@gmail.com> skribis:

> From ece0a8dec5d95ccf84156e9e6c0c582639163b1e Mon Sep 17 00:00:00 2001
> From: Eric Bavier <bavier@member.fsf.org>
> Date: Fri, 10 Oct 2014 13:11:22 -0500
> Subject: [PATCH 4/4] gnu: Add transfig.
>
> * gnu/packages/xfig.scm (transfig): New variable.

OK!

> +        (lambda* (#:key inputs outputs #:allow-other-keys)
> +          (let ((imake (assoc-ref inputs "imake"))
> +                (out   (assoc-ref outputs "out")))
> +            (substitute* '("fig2dev/Imakefile"
> +                           "transfig/Imakefile")
> +              (("XCOMM (BINDIR = )[[:graph:]]*" _ front)
> +               (string-append front out "/bin"))
> +              (("XCOMM USEINLINE") "USEINLINE")
> +              ;; The variable name is deceptive.  The directory is used as an
> +              ;; installation path for bitmaps.
> +              (("(XFIGLIBDIR =[[:blank:]]*)[[:graph:]]*" _ front)
> +               (string-append front out "/lib"))
> +              (("(XPMLIBDIR = )[[:graph:]]*" _ front)
> +               (string-append front (assoc-ref inputs "libxpm") "/lib"))
> +              (("(XPMINC = -I)[[:graph:]]*" _ front)
> +               (string-append front (assoc-ref inputs "libxpm") "/include/X11"))
> +              (("/usr/local/lib/fig2dev") (string-append out "/lib")))

I feel you’ll end up writing an ‘imake-build-system’.  :-)

Thanks,
Ludo’.

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

end of thread, other threads:[~2014-10-11 22:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10 18:19 [PATCH 4/4] gnu: Add transfig Eric Bavier
2014-10-11 22:03 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).