guix-commits
[Top][All Lists]
Advanced

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

04/05: plan9port: Install into "$output/plan9" instead of "$output".


From: guix-commits
Subject: 04/05: plan9port: Install into "$output/plan9" instead of "$output".
Date: Sat, 6 Jan 2024 21:40:42 -0500 (EST)

iyzsong pushed a commit to branch master
in repository guix.

commit 2538a773c53e0f7fce4de0c49b6ec1d41acc25c0
Author: 宋文武 <iyzsong@member.fsf.org>
AuthorDate: Sun Dec 31 17:15:57 2023 +0800

    plan9port: Install into "$output/plan9" instead of "$output".
    
    This fixes <https://issues.guix.gnu.org/67329>.
    
    * gnu/packages/plan9.scm (plan9port)[arguments]: Add 'strip-directories'.
    <phases>: Use "$output/plan9" as PLAN9_TARGET.  Remove 'wrap-executables
    phase, instead invoke "./INSTALL -c" to change hard-coded /usr/local/plan9
    paths.
    
    Change-Id: I7e24f64445c9b6cdcc0d803239e10b226931a845
---
 gnu/packages/plan9.scm | 130 ++++++++++++++++++++++++-------------------------
 1 file changed, 63 insertions(+), 67 deletions(-)

diff --git a/gnu/packages/plan9.scm b/gnu/packages/plan9.scm
index f78c26e215..5af0f2f74f 100644
--- a/gnu/packages/plan9.scm
+++ b/gnu/packages/plan9.scm
@@ -94,73 +94,69 @@ reconstruct a Plan 9 terminal-like experience from a 
non-Plan 9 system.")
       (build-system gnu-build-system)
       (arguments
        (list #:tests? #f ;no tests
-             #:phases #~(modify-phases %standard-phases
-                          (add-after 'unpack 'setup
-                            (lambda _
-                              (delete-file "src/cmd/mk/mk.pdf")
-                              (substitute* "src/cmd/acme/acme.c"
-                                (("/lib/font/bit/lucsans/euro.8.font")
-                                 (string-append #$output
-                                  "/font/fixed/unicode.5x8.font"))
-                                (("/lib/font/bit/lucm/unicode.9.font")
-                                 (string-append #$output
-                                  "/font/fixed/unicode.6x9.font")))
-                              (substitute* (find-files "src")
-                                (("/lib/font/bit")
-                                 (string-append #$output "/font")))
-                              (substitute* "bin/9c"
-                                (("which")
-                                 (which "which")))
-                              (substitute* "src/cmd/fontsrv/freetyperules.sh"
-                                (("'\\$i'/freetype2")
-                                 (string-append "-I"
-                                                #$freetype
-                                                "/include/freetype2")))
-                              (with-output-to-file "LOCAL.config"
-                                (lambda _
-                                  (format #t "CC9=~a~%" #$(cc-for-target))
-                                  (format #t "FONTSRV=fontsrv~%")))
-                              (setenv "X11"
-                                      #$libx11)
-                              (setenv "PLAN9"
-                                      (getcwd))
-                              (setenv "PLAN9_TARGET"
-                                      #$output)))
-                          (delete 'configure) ;no configure
-                          (replace 'build
-                            (lambda _
-                              (invoke "./INSTALL" "-b")))
-                          (replace 'install
-                            (lambda _
-                              (for-each (lambda (x)
-                                          (let ((out (string-append #$output
-                                                                    "/" x)))
-                                            (mkdir-p out)
-                                            (copy-recursively x out)))
-                                        ;; TODO: use external sky and dict 
packages
-                                        '("bin" "face"
-                                          "font"
-                                          "include"
-                                          "lib"
-                                          "lp"
-                                          "mail"
-                                          "man"
-                                          "ndb"
-                                          "plumb"
-                                          "tmac"
-                                          "troff"
-                                          "postscript"))
-                              (install-file "rcmain" #$output)))
-                          (add-after 'install 'wrap-executables
-                            (lambda _
-                              (for-each (lambda (exe)
-                                          (wrap-program exe
-                                            `("PLAN9" ":" prefix
-                                              (,#$output))))
-                                        (find-files
-                                         (string-append #$output "/bin")))))
-                          ;; Plan9 doesn't compress man pages
-                          (delete 'compress-documentation))))
+             #:strip-directories #~'("plan9/bin")
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'setup
+                   (lambda _
+                     (let ((dest (string-append #$output "/plan9")))
+                       (delete-file "src/cmd/mk/mk.pdf")
+                       (substitute* "src/cmd/acme/acme.c"
+                         (("/lib/font/bit/lucsans/euro.8.font")
+                          (string-append dest
+                                         "/font/fixed/unicode.5x8.font"))
+                         (("/lib/font/bit/lucm/unicode.9.font")
+                          (string-append dest
+                                         "/font/fixed/unicode.6x9.font")))
+                       (substitute* (find-files "src")
+                         (("/lib/font/bit")
+                          (string-append dest "/font")))
+                       (substitute* "bin/9c"
+                         (("which")
+                          (which "which")))
+                       (substitute* "src/cmd/fontsrv/freetyperules.sh"
+                         (("'\\$i'/freetype2")
+                          (string-append "-I"
+                                         #$freetype
+                                         "/include/freetype2")))
+                       (with-output-to-file "LOCAL.config"
+                         (lambda _
+                           (format #t "CC9=~a~%" #$(cc-for-target))
+                           (format #t "FONTSRV=fontsrv~%")))
+                       (setenv "X11" #$libx11)
+                       (setenv "PLAN9" (getcwd))
+                       (setenv "PLAN9_TARGET" dest))))
+                 (delete 'configure)    ;no configure
+                 (replace 'build
+                   (lambda _
+                     (invoke "./INSTALL" "-b")))
+                 (replace 'install
+                   (lambda _
+                     (invoke "./INSTALL" "-c")
+                     (let ((dest (getenv "PLAN9_TARGET")))
+                       (for-each (lambda (x)
+                                   (let ((out (string-append dest "/" x)))
+                                     (mkdir-p out)
+                                     (copy-recursively x out)))
+                                 ;; TODO: use external sky and dict packages
+                                 '("bin" "face"
+                                   "font"
+                                   "include"
+                                   "lib"
+                                   "lp"
+                                   "mail"
+                                   "man"
+                                   "ndb"
+                                   "plumb"
+                                   "tmac"
+                                   "troff"
+                                   "postscript"))
+                       (install-file "rcmain" dest)
+                       (mkdir-p (string-append #$output "/bin"))
+                       (symlink (string-append dest "/bin/9")
+                                (string-append #$output "/bin/9")))))
+                 ;; Plan9 doesn't compress man pages
+                 (delete 'compress-documentation))))
       (native-inputs (list perl which))
       (inputs (list bash-minimal                  ;for 'wrap-program'
                     fontconfig libx11 libxext libxt))



reply via email to

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