2015-02-09 00:29:48 +00:00
|
|
|
(require 'package)
|
|
|
|
(package-initialize)
|
|
|
|
|
2018-07-16 01:52:41 +00:00
|
|
|
(require 'package-recipe)
|
2015-02-09 00:29:48 +00:00
|
|
|
(require 'package-build)
|
|
|
|
|
2018-07-16 01:52:41 +00:00
|
|
|
(setq package-build-working-dir (expand-file-name "working/"))
|
|
|
|
(setq package-build-archive-dir (expand-file-name "packages/"))
|
|
|
|
(setq package-build-recipes-dir (expand-file-name "recipes/"))
|
2015-02-09 00:29:48 +00:00
|
|
|
|
2021-12-19 16:07:18 +00:00
|
|
|
;; Allow installing package tarfiles larger than 10MB
|
|
|
|
(setq large-file-warning-threshold nil)
|
|
|
|
|
2015-02-09 00:29:48 +00:00
|
|
|
(defun melpa2nix-build-package ()
|
|
|
|
(if (not noninteractive)
|
|
|
|
(error "`melpa2nix-build-package' is to be used only with -batch"))
|
|
|
|
(pcase command-line-args-left
|
2021-07-06 15:52:13 +00:00
|
|
|
(`(,package ,version ,commit)
|
|
|
|
;; Monkey-patch package-build so it doesn't shell out to git/hg.
|
|
|
|
(defun package-build--get-commit (&rest _)
|
|
|
|
commit)
|
2018-07-16 01:52:41 +00:00
|
|
|
(package-build--package (package-recipe-lookup package) version))))
|