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
This commit is contained in:
宋文武 2023-12-31 17:15:57 +08:00
parent e661c1f31d
commit 2538a773c5
No known key found for this signature in database
GPG key ID: D415BF253B515976

View file

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