发现Guix特别适合各种包的管理 vim,emacs,python,等等
然后需要的包都写了Guix打包
有Guix需要安装emacs-rime的可以看一下。
guix 处理这种需要动态模块的包还是挺不错的。
放好代码后直接
guix build emacs-rime && guix package -i emacs-rime
(define-public emacs-rime
(let ((version "0")
(revision "1")
(commit "daf956df30d4007f70a4495560d656e517ab69a9"))
(package
(name "emacs-rime")
(version (git-version version revision commit))
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/DogLooksGood/emacs-rime.git")
(commit commit)))
(file-name (git-file-name name version))
(sha256
(base32
"0wr1ski9j7m7mwizdgxnnj61z1nqpyjp6gc7dniaac0m6svxf1rf"))))
(build-system emacs-build-system)
(arguments
`(#:modules ((guix build emacs-build-system)
(guix build emacs-utils)
(guix build utils))
#:imported-modules (,@%emacs-build-system-modules)
#:phases
(modify-phases %standard-phases
(add-before 'add-source-to-load-path 'substitute-rime-module-path
(lambda* (#:key outputs #:allow-other-keys)
(chmod "rime.el" #o644)
(emacs-substitute-sexps "rime.el"
("(defvar rime--module-path"
(string-append (assoc-ref outputs "out")
"/lib/librime-emacs.so")))
#t))
(add-before 'add-source-to-load-path 'substitute-rime-data-path
(lambda* (#:key inputs #:allow-other-keys)
(chmod "rime.el" #o644)
(emacs-substitute-sexps "rime.el"
("(defcustom rime-share-data-dir"
(string-append (assoc-ref inputs "rime-data")
"/share/rime-data/")))
#t))
(add-after 'configure 'make
;; Run make.
(lambda* (#:key (make-flags '()) outputs #:allow-other-keys)
;; Compile the shared object file.
(apply invoke "make" "lib" make-flags)
;; Move the file into /lib.
(install-file
"librime-emacs.so"
(string-append (assoc-ref outputs "out") "/lib"))
#t)))
#:tests? #f))
(inputs
`(("librime" ,librime)
("rime-data" ,rime-data))
)
(propagated-inputs
`(("dash" ,emacs-dash))
)
(home-page "https://github.com/DogLooksGood/emacs-rime.git")
(synopsis "Emacs 下的 Rime 输入法")
(description "Emacs 下的 Rime 输入法")
(license license:gpl3+))))
https://github.com/nniixxoossccnn/my-guix/blob/github/packages/luhux/packages/emacs-xyz.scm