forked from FG42/FG42
depends-on now treats extensions and normal package differently
This commit is contained in:
parent
45ee27a35f
commit
8e622a838e
28
lib/fpkg.el
28
lib/fpkg.el
|
@ -75,25 +75,21 @@
|
||||||
(when (not fpkg-initilized-p)
|
(when (not fpkg-initilized-p)
|
||||||
(fpkg-initialize)))
|
(fpkg-initialize)))
|
||||||
|
|
||||||
|
(defun fg42-install-extension (args)
|
||||||
|
|
||||||
(defun depends-on (pkgname)
|
)
|
||||||
"Install the given PKGNAME if it isn't installed."
|
(defun extensionp (args)
|
||||||
(straight-use-package pkgname))
|
"Tell if given ARGS is a FG42 extension or a normal straight package."
|
||||||
|
(cond
|
||||||
|
((symbolp args) (string= (car (last (split-string (symbol-name args) "-"))) "extension"))
|
||||||
|
((listp args) (string= (car (last (split-string (symbol-name (car args)) "-"))) "extension"))))
|
||||||
|
|
||||||
(defun fg42-install-extension (name options)
|
(defmacro depends-on (args)
|
||||||
"Install given extension NAME with given OPTIONS.")
|
(if (extensionp args)
|
||||||
|
`(fg42-install-extension ,args)
|
||||||
|
`(straight-use-package ,args)
|
||||||
|
))
|
||||||
|
|
||||||
|
|
||||||
(defmacro depends-on2 (name &rest options)
|
|
||||||
"Install given NAME with provided OPTIONS."
|
|
||||||
|
|
||||||
(add-to-list 'options name)
|
|
||||||
(if (string= (car (last (split-string (symbol-name name) "-"))) "extension")
|
|
||||||
`(fg42-install-extension ,options)
|
|
||||||
`(straight-use-package ,options)))
|
|
||||||
|
|
||||||
;; (macroexpand '(depends-on2 go-extension :type git :host github :repo "your-name/el-patch"))
|
|
||||||
;; (macroexpand '(depends-on2 go :type git :host github :repo "your-name/el-patch"))
|
|
||||||
|
|
||||||
(provide 'fpkg)
|
(provide 'fpkg)
|
||||||
;;; fpkg.el ends here
|
;;; fpkg.el ends here
|
||||||
|
|
Loading…
Reference in New Issue