From 0eefac0f2f2c7b57471d352abfad7fa306a69df2 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 11 Jan 2017 21:45:20 +0100 Subject: gnu: xfig: Use modify-phases. * gnu/packages/xfig.scm (xfig): Use modify-phases. --- gnu/packages/xfig.scm | 159 +++++++++++++++++++++++++------------------------- 1 file changed, 79 insertions(+), 80 deletions(-) (limited to 'gnu/packages/xfig.scm') diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm index 6436e52ad6..27d9cf9ab3 100644 --- a/gnu/packages/xfig.scm +++ b/gnu/packages/xfig.scm @@ -34,12 +34,12 @@ (define-public xfig (version "3.2.5c") (source (origin - (method url-fetch) - (uri (string-append "mirror://sourceforge/mcj/mcj-source/xfig." - version ".full.tar.gz")) - (sha256 - (base32 - "1yd1jclvw5w3ja4jjzr1ysbn8iklh88wq84jn9d1gavrbfbqyqpa")))) + (method url-fetch) + (uri (string-append "mirror://sourceforge/mcj/mcj-source/xfig." + version ".full.tar.gz")) + (sha256 + (base32 + "1yd1jclvw5w3ja4jjzr1ysbn8iklh88wq84jn9d1gavrbfbqyqpa")))) (build-system gnu-build-system) (native-inputs `(("imake" ,imake) @@ -59,51 +59,51 @@ (define-public xfig (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* "Imakefile" - (("XCOMM (BINDIR = )[[:graph:]]*" _ front) - (string-append front out "/bin")) - (("(PNGLIBDIR = )[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libpng") "/lib")) - (("(PNGINC = -I)[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libpng") "/include")) - (("(JPEGLIBDIR = )[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libjpeg") "/lib")) - (("(JPEGINC = -I)[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libjpeg") "/include")) - (("(ZLIBDIR = )[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "zlib") "/lib")) - (("(XPMLIBDIR = )[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libxpm") "/lib")) - (("(XPMINC = -I)[[:graph:]]*" _ front) - (string-append front (assoc-ref inputs "libxpm") "/include")) - (("(XFIGLIBDIR = )[[:graph:]]*" _ front) - (string-append front out "/lib")) - (("(XFIGDOCDIR = )[[:graph:]]*" _ front) - (string-append front out "/share/doc")) - (("XCOMM USEINLINE") "USEINLINE")) - ;; The -a argument is required in order to pick up the correct paths - ;; to several X header files. - (zero? (system* "xmkmf" "-a")) - ;; Reset some variables that are inherited from imake templates - (substitute* "Makefile" - ;; These imake variables somehow remain undefined - (("DefaultGcc2[[:graph:]]*Opt") "-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/libs - (lambda _ - (zero? (system* "make" "install.libs"))) - (alist-cons-after + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((imake (assoc-ref inputs "imake")) + (out (assoc-ref outputs "out"))) + (substitute* "Imakefile" + (("XCOMM (BINDIR = )[[:graph:]]*" _ front) + (string-append front out "/bin")) + (("(PNGLIBDIR = )[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "libpng") "/lib")) + (("(PNGINC = -I)[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "libpng") "/include")) + (("(JPEGLIBDIR = )[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "libjpeg") "/lib")) + (("(JPEGINC = -I)[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "libjpeg") "/include")) + (("(ZLIBDIR = )[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "zlib") "/lib")) + (("(XPMLIBDIR = )[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "libxpm") "/lib")) + (("(XPMINC = -I)[[:graph:]]*" _ front) + (string-append front (assoc-ref inputs "libxpm") "/include")) + (("(XFIGLIBDIR = )[[:graph:]]*" _ front) + (string-append front out "/lib")) + (("(XFIGDOCDIR = )[[:graph:]]*" _ front) + (string-append front out "/share/doc")) + (("XCOMM USEINLINE") "USEINLINE")) + ;; The -a argument is required in order to pick up the correct paths + ;; to several X header files. + (zero? (system* "xmkmf" "-a")) + ;; Reset some variables that are inherited from imake templates + (substitute* "Makefile" + ;; These imake variables somehow remain undefined + (("DefaultGcc2[[:graph:]]*Opt") "-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)))))) + (add-after + 'install 'install/libs + (lambda _ + (zero? (system* "make" "install.libs")))) + (add-after 'install 'install/doc (lambda _ (begin @@ -118,15 +118,14 @@ (define-public xfig (dump-port in out) (close-pipe in) (close-port out))) - (zero? (system* "make" "install.doc")))) - (alist-cons-after - 'install 'wrap-xfig - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (wrap-program (string-append out "/bin/xfig") - `("XAPPLRESDIR" suffix - (,(string-append out "/etc/X11/app-defaults")))))) - %standard-phases)))))) + (zero? (system* "make" "install.doc"))))) + (add-after + 'install 'wrap-xfig + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/bin/xfig") + `("XAPPLRESDIR" suffix + (,(string-append out "/etc/X11/app-defaults")))))))))) (home-page "http://xfig.org/") (synopsis "Interactive drawing tool") (description @@ -144,12 +143,12 @@ (define-public 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")))) + (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) @@ -183,20 +182,20 @@ (define-public transfig (("(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") - ;; These imake variables somehow remain undefined - (("DefaultGcc2[[:graph:]]*Opt") "-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))))) + ;; 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") + ;; These imake variables somehow remain undefined + (("DefaultGcc2[[:graph:]]*Opt") "-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 _ -- cgit v1.2.3 From 97fedab17d4acfa05969ddd9faf98a11d27a4743 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 12 Jan 2017 10:19:12 +0100 Subject: gnu: xfig: Remove wrapper and clean up implementation. * gnu/packages/xorg.scm (%app-defaults-dir): Make public. * gnu/packages/xfig.scm (xfig)[attributes]: Remove wrapper and set the XAPPLOADDIR in the Imakefile instead. --- gnu/packages/xfig.scm | 14 +++++--------- gnu/packages/xorg.scm | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'gnu/packages/xfig.scm') diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm index 27d9cf9ab3..ad1b432abd 100644 --- a/gnu/packages/xfig.scm +++ b/gnu/packages/xfig.scm @@ -65,6 +65,8 @@ (define-public xfig (let ((imake (assoc-ref inputs "imake")) (out (assoc-ref outputs "out"))) (substitute* "Imakefile" + (("XCOMM XAPPLOADDIR = /home/user/xfig *") + (string-append "XAPPLOADDIR = " out %app-defaults-dir)) (("XCOMM (BINDIR = )[[:graph:]]*" _ front) (string-append front out "/bin")) (("(PNGLIBDIR = )[[:graph:]]*" _ front) @@ -98,7 +100,8 @@ (define-public xfig (("(MANPATH = )[[:graph:]]*" _ front) (string-append front out "/share/man")) (("(CONFDIR = )([[:graph:]]*)" _ front default) - (string-append front out default)))))) + (string-append front out default)))) + #t)) (add-after 'install 'install/libs (lambda _ @@ -118,14 +121,7 @@ (define-public xfig (dump-port in out) (close-pipe in) (close-port out))) - (zero? (system* "make" "install.doc"))))) - (add-after - 'install 'wrap-xfig - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (wrap-program (string-append out "/bin/xfig") - `("XAPPLRESDIR" suffix - (,(string-append out "/etc/X11/app-defaults")))))))))) + (zero? (system* "make" "install.doc")))))))) (home-page "http://xfig.org/") (synopsis "Interactive drawing tool") (description diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 45ff4c97ea..fe607e2632 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -335,7 +335,7 @@ (define-public dri3proto (license (license:x11-style "file://dri3proto.h" "See 'dri3proto.h' in the distribution.")))) -(define %app-defaults-dir "/lib/X11/app-defaults") +(define-public %app-defaults-dir "/lib/X11/app-defaults") (define-public editres (package -- cgit v1.2.3 From 79728b621bb3032984252c244b710993ae1aa984 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 13 Jan 2017 07:26:37 +0100 Subject: gnu: xfig: Correct typographic error. * gnu/packages/xfig.scm (xfig) [arguments]: Fix typo. --- gnu/packages/xfig.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/xfig.scm') diff --git a/gnu/packages/xfig.scm b/gnu/packages/xfig.scm index ad1b432abd..2e65000eb7 100644 --- a/gnu/packages/xfig.scm +++ b/gnu/packages/xfig.scm @@ -66,7 +66,7 @@ (define-public xfig (out (assoc-ref outputs "out"))) (substitute* "Imakefile" (("XCOMM XAPPLOADDIR = /home/user/xfig *") - (string-append "XAPPLOADDIR = " out %app-defaults-dir)) + (string-append "XAPPLOADDIR = " out ,%app-defaults-dir)) (("XCOMM (BINDIR = )[[:graph:]]*" _ front) (string-append front out "/bin")) (("(PNGLIBDIR = )[[:graph:]]*" _ front) -- cgit v1.2.3