Merge branch 'emacs-packages'
This commit is contained in:
commit
c919bb82af
@ -36,10 +36,14 @@ let
|
|||||||
or unknownFetcher;
|
or unknownFetcher;
|
||||||
args = builtins.removeAttrs recipe.fetch [ "tag" ];
|
args = builtins.removeAttrs recipe.fetch [ "tag" ];
|
||||||
src = fetch args;
|
src = fetch args;
|
||||||
|
recipeFile = fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/milkypostman/melpa/${recipe.recipe.commit}/recipes/${name}";
|
||||||
|
inherit (recipe.recipe) sha256;
|
||||||
|
};
|
||||||
in melpaBuild {
|
in melpaBuild {
|
||||||
pname = name;
|
pname = name;
|
||||||
inherit (recipe) version;
|
inherit (recipe) version;
|
||||||
inherit src;
|
inherit recipeFile src;
|
||||||
packageRequires =
|
packageRequires =
|
||||||
let lookupDep = d: self."${d}" or null;
|
let lookupDep = d: self."${d}" or null;
|
||||||
in map lookupDep recipe.deps;
|
in map lookupDep recipe.deps;
|
||||||
|
@ -38,10 +38,14 @@ let
|
|||||||
or unknownFetcher;
|
or unknownFetcher;
|
||||||
args = builtins.removeAttrs recipe.fetch [ "tag" ];
|
args = builtins.removeAttrs recipe.fetch [ "tag" ];
|
||||||
src = fetch args;
|
src = fetch args;
|
||||||
|
recipeFile = fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/milkypostman/melpa/${recipe.recipe.commit}/recipes/${name}";
|
||||||
|
inherit (recipe.recipe) sha256;
|
||||||
|
};
|
||||||
in melpaBuild {
|
in melpaBuild {
|
||||||
pname = name;
|
pname = name;
|
||||||
inherit (recipe) version;
|
inherit (recipe) version;
|
||||||
inherit src;
|
inherit recipeFile src;
|
||||||
packageRequires =
|
packageRequires =
|
||||||
let lookupDep = d: self."${d}" or null;
|
let lookupDep = d: self."${d}" or null;
|
||||||
in map lookupDep recipe.deps;
|
in map lookupDep recipe.deps;
|
||||||
|
@ -8,6 +8,8 @@ with lib;
|
|||||||
{ pname
|
{ pname
|
||||||
, version
|
, version
|
||||||
|
|
||||||
|
, recipeFile ? null
|
||||||
|
|
||||||
, files ? null
|
, files ? null
|
||||||
, fileSpecs ? [ "*.el" "*.el.in" "dir"
|
, fileSpecs ? [ "*.el" "*.el.in" "dir"
|
||||||
"*.info" "*.texi" "*.texinfo"
|
"*.info" "*.texi" "*.texinfo"
|
||||||
@ -43,8 +45,17 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
|
|||||||
runHook preBuild
|
runHook preBuild
|
||||||
|
|
||||||
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
||||||
|
${if recipeFile == null
|
||||||
|
then
|
||||||
|
''
|
||||||
-f melpa2nix-build-package \
|
-f melpa2nix-build-package \
|
||||||
${pname} ${version} ${targets}
|
${pname} ${version} ${targets}
|
||||||
|
''
|
||||||
|
else
|
||||||
|
''
|
||||||
|
-f melpa2nix-build-package-from-recipe \
|
||||||
|
${pname} ${version} ${recipeFile}
|
||||||
|
''}
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
@ -21,6 +21,15 @@
|
|||||||
(`(,package ,version . ,files)
|
(`(,package ,version . ,files)
|
||||||
(melpa2nix-package-build-archive package version files))))
|
(melpa2nix-package-build-archive package version files))))
|
||||||
|
|
||||||
|
(defun melpa2nix-build-package-from-recipe ()
|
||||||
|
(if (not noninteractive)
|
||||||
|
(error "`melpa2nix-build-package' is to be used only with -batch"))
|
||||||
|
(pcase command-line-args-left
|
||||||
|
(`(,package ,version ,recipe-file)
|
||||||
|
(let* ((rcp (cdr (package-build--read-from-file recipe-file)))
|
||||||
|
(files (package-build--config-file-list rcp)))
|
||||||
|
(melpa2nix-package-build-archive package version files)))))
|
||||||
|
|
||||||
(defun melpa2nix-package-build-archive (name version files)
|
(defun melpa2nix-package-build-archive (name version files)
|
||||||
"Build a package archive for package NAME."
|
"Build a package archive for package NAME."
|
||||||
(package-build--message "\n;;; %s\n" name)
|
(package-build--message "\n;;; %s\n" name)
|
||||||
|
Loading…
Reference in New Issue
Block a user