guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/4] gnu: Add fontforge.


From: Eric Bavier
Subject: [PATCH 4/4] gnu: Add fontforge.
Date: Tue, 07 Oct 2014 11:39:06 -0500
User-agent: mu4e 0.9.9.5; emacs 23.3.1

>From 32cbf42d1e8615cab130d0f58f3c16cd18d6ba01 Mon Sep 17 00:00:00 2001
From: Eric Bavier <address@hidden>
Date: Tue, 7 Oct 2014 11:20:20 -0500
Subject: [PATCH 4/4] gnu: Add fontforge.

* gnu/packages/fontutils.scm (fontforge): New variable.
---
 gnu/packages/fontutils.scm |   81 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index d3c10aa..512dbb6 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -24,7 +24,12 @@
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages autotools)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages xorg)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages xml)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -278,3 +283,79 @@ useful for programs that need Unicode \"Names\", 
\"Annotations\", and block
 definitions.")
     (license license:gpl2)
     (home-page "https://github.com/fontforge/libuninameslist";)))
+
+(define-public fontforge
+  (package
+   (name "fontforge")
+   (version "20120731-b")               ;aka 1.0
+   (source (origin
+            (method url-fetch)
+            (uri (string-append 
"mirror://sourceforge/fontforge/fontforge_full-"
+                                version ".tar.bz2"))
+            (sha256 (base32
+                     "1dhg0i2pf76j40cb9g1wzpag21fgarpjaad0hdbk27i1zz588q8v"))))
+   (build-system gnu-build-system)
+   ;; TODO: Add python for scripting support.
+   (inputs `(("gettext"         ,gnu-gettext)
+             ("libtiff"         ,libtiff)
+             ("libjpeg"         ,libjpeg)
+             ("libpng"          ,libpng)
+             ("giflib"          ,giflib) ;needs giflib 4.*
+             ("libxml2"         ,libxml2)
+             ("libX11"          ,libx11)
+             ("libXi"           ,libxi)
+             ("libICE"          ,libice)
+             ("libSM"           ,libsm)
+             ("freetype"        ,freetype)
+             ("potrace"         ,potrace)
+             ("libspiro"        ,libspiro)
+             ("zlib"            ,zlib)
+             ("cairo"           ,cairo)
+             ("fontconfig"      ,fontconfig) ;dlopen'd
+             ("libuninameslist" ,libuninameslist)
+             ("pango"           ,pango)
+             ("glib"            ,glib))) ;needed for pango detection
+   (arguments
+    '(#:configure-flags `("--enable-double")
+      #:tests? #f
+      #:phases
+      (alist-cons-before
+       'configure 'patch-configure
+       (lambda* (#:key inputs #:allow-other-keys)
+         (let ((libxml2 (assoc-ref inputs "libxml2"))
+               (cairo   (assoc-ref inputs "cairo"))
+               (pango   (assoc-ref inputs "pango")))
+           (substitute* "configure"
+             ;; configure looks for a directory to be present to determine
+             ;; whether libxml2 is available, rather than checking for the
+             ;; library or headers.  Point it to the correct directory.
+             (("/usr/include/libxml2")
+              (string-append libxml2 "/include/libxml2"))
+             ;; Similary, the search directories for cairo and pango are
+             ;; hard-coded.
+             (("gww_prefix in.*") (string-append "gww_prefix in "
+                                                 cairo " " pango "\n")))))
+       (alist-cons-after
+        'install 'set-library-path
+        (lambda* (#:key inputs outputs #:allow-other-keys)
+          (let ((out (assoc-ref outputs "out"))
+                (potrace (string-append (assoc-ref inputs "potrace") "/bin")))
+            (wrap-program (string-append out "/bin/fontforge")
+                          ;; Fontforge dynamically opens libraries.
+                          `("LD_LIBRARY_PATH" ":" prefix
+                            ,(map (lambda (input)
+                                    (string-append (assoc-ref inputs input)
+                                                   "/lib"))
+                                  '("libtiff" "libjpeg" "libpng" "giflib"
+                                    "libxml2" "zlib" "libspiro" "freetype"
+                                    "pango" "cairo" "fontconfig")))
+                          ;; Checks for potrace program at runtime
+                          `("PATH" ":" prefix (,potrace)))))
+        %standard-phases))))
+   (synopsis "Outline font editor")
+   (description
+    "FontForge allows you to create and modify postscript, truetype and
+opentype fonts.  You can save fonts in many different outline formats, and
+generate bitmaps.")
+   (license license:bsd-3)
+   (home-page "http://fontforge.org/";)))
-- 
1.7.9.5

-- 
Eric Bavier

reply via email to

[Prev in Thread] Current Thread [Next in Thread]