diff mbox series

[bug#71787,04/12] gnu: ijs: Remove unneeded files and build shared library.

Message ID 20240626192717.12818-4-david.elsing@posteo.net
State New
Headers show
Series Update and unbundle ghostscript and mupdf | expand

Commit Message

David Elsing June 26, 2024, 7:26 p.m. UTC
* gnu/packages/ghostscript.scm (ijs)[source]: Add snippet. Remove patches.
[phases] Rename 'autogen' phase to 'prepare' and adjust.
---
 gnu/packages/ghostscript.scm | 106 +++++++++++++++++++++--------------
 1 file changed, 64 insertions(+), 42 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 2e24904fd4..40891676b3 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -368,50 +368,72 @@  (define-public ghostscript/cups
 
 (define-public ijs
   (package
-   (name "ijs")
-   (version (package-version ghostscript))
-   (source (package-source ghostscript))
-   (build-system gnu-build-system)
-   (native-inputs
-    (append (if (target-riscv64?)
-              (list config)
-              '())
-            (list libtool automake autoconf)))
-   (arguments
-    `(#:phases
-      (modify-phases %standard-phases
-        (add-after 'unpack 'autogen
-          (lambda _
-            ;; need to regenerate macros
-            (system* "autoreconf" "-if")
-            ;; do not run configure
-            (substitute* "autogen.sh"
-              (("^.*\\$srcdir/configure.*") ""))
-            (system* "bash" "autogen.sh")
-            ;; create configure script in ./ijs/
-            (chdir "ijs")
-            ;; do not run configure
-            (substitute* "autogen.sh"
-              (("^.*\\$srcdir/configure.*") "")
-              (("^ + && echo Now type.*$")  ""))
-            (invoke "bash" "autogen.sh")))
-        ,@(if (target-riscv64?)
-            `((add-after 'unpack 'update-config-scripts
-                (lambda* (#:key native-inputs inputs #:allow-other-keys)
-                  (for-each (lambda (file)
-                              (install-file
-                               (search-input-file
-                                (or native-inputs inputs)
-                                (string-append "/bin/" file)) "ijs"))
-                            '("config.guess" "config.sub")))))
-            '()))))
-   (synopsis "IJS driver framework for inkjet and other raster devices")
-   (description
-    "IJS is a protocol for transmission of raster page images.  This package
+    (name "ijs")
+    (version (package-version ghostscript))
+    (source
+     (origin
+       (inherit
+        (package-source ghostscript))
+       (modules '((guix build utils)
+                  (srfi srfi-1)
+                  (ice-9 ftw)))
+       (snippet
+        '(begin
+           (for-each delete-file-recursively
+                     (lset-difference equal? (scandir ".")
+                                      '("." ".." "ijs")))
+           (chdir "ijs")
+           (for-each
+            delete-file
+            '("compile"
+              "config.guess"
+              "config.sub"
+              "configure"
+              "ijs_spec.pdf"
+              "ijs_spec.ps"
+              "install-sh"
+              "libtool"
+              "ltmain.sh"
+              "Makefile.in"
+              "missing"
+              "state.eps"
+              "state.fig"))))
+       (patches '())))
+    (build-system gnu-build-system)
+    (native-inputs
+     (append (if (target-riscv64?)
+                 (list config)
+                 '())
+             (list libtool automake autoconf)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'prepare
+           (lambda _
+             (chdir "ijs")
+             ;; do not run configure
+             (substitute* "autogen.sh"
+               (("^.*\\$srcdir/configure.*") "")
+               (("^ + && echo Now type.*$")  ""))
+             (substitute* "configure.ac"
+               (("AC_DISABLE_SHARED") ""))))
+         ,@(if (target-riscv64?)
+               `((add-after 'unpack 'update-config-scripts
+                   (lambda* (#:key native-inputs inputs #:allow-other-keys)
+                     (for-each (lambda (file)
+                                 (install-file
+                                  (search-input-file
+                                   (or native-inputs inputs)
+                                   (string-append "/bin/" file)) "ijs"))
+                               '("config.guess" "config.sub")))))
+               '()))))
+    (synopsis "IJS driver framework for inkjet and other raster devices")
+    (description
+     "IJS is a protocol for transmission of raster page images.  This package
 provides the reference implementation of the raster printer driver
 architecture.")
-   (license license:expat)
-   (home-page (package-home-page ghostscript))))
+    (license license:expat)
+    (home-page (package-home-page ghostscript))))
 
 (define-public font-ghostscript
   (package