From 428dfcb0073c399e18a61bcc4077c87f1aa2a927 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Fri, 31 May 2024 16:38:52 +0800 Subject: [PATCH 1/3] melpaBuild: add doc and default value for commit --- pkgs/build-support/emacs/melpa.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix index 323c6e65d9d9..f5562212bbe4 100644 --- a/pkgs/build-support/emacs/melpa.nix +++ b/pkgs/build-support/emacs/melpa.nix @@ -38,6 +38,13 @@ in */ , ename ? null , version + /* + commit: Optional package history commit. + Default: src.rev or "unknown" + This will be written into the generated package but it is not needed during + the build process. + */ +, commit ? (args.src.rev or "unknown") , recipe , meta ? {} , ... @@ -53,7 +60,7 @@ genericBuild ({ elpa2nix = ./elpa2nix.el; melpa2nix = ./melpa2nix.el; - inherit packageBuild; + inherit packageBuild commit; preUnpack = '' mkdir -p "$NIX_BUILD_TOP/recipes" From 6c9f79c133f60a2d618b99032f8bc877b3be63e6 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Fri, 31 May 2024 17:40:29 +0800 Subject: [PATCH 2/3] melpaBuild: add doc and default value for recipe --- pkgs/build-support/emacs/melpa.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix index f5562212bbe4..03ead68fa925 100644 --- a/pkgs/build-support/emacs/melpa.nix +++ b/pkgs/build-support/emacs/melpa.nix @@ -35,8 +35,9 @@ in pname /* ename: Original Emacs package name, possibly containing special symbols. + Default: pname */ -, ename ? null +, ename ? pname , version /* commit: Optional package history commit. @@ -45,22 +46,22 @@ in the build process. */ , commit ? (args.src.rev or "unknown") -, recipe + /* + recipe: Optional MELPA recipe. + Default: a minimal but not accurate recipe + You need to provide your own recipe if you want to set :files. + */ +, recipe ? (writeText "${pname}-recipe" ''(${ename} :fetcher git :url "")'') , meta ? {} , ... }@args: genericBuild ({ - ename = - if ename == null - then pname - else ename; - elpa2nix = ./elpa2nix.el; melpa2nix = ./melpa2nix.el; - inherit packageBuild commit; + inherit packageBuild commit ename recipe; preUnpack = '' mkdir -p "$NIX_BUILD_TOP/recipes" From 7f5aedecb5e730321e1715130b904a84c4c60c34 Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Fri, 31 May 2024 21:05:49 +0800 Subject: [PATCH 3/3] melpaBuild: add files parameter to specify :files of recipe --- pkgs/build-support/emacs/melpa.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix index 03ead68fa925..c8f656704918 100644 --- a/pkgs/build-support/emacs/melpa.nix +++ b/pkgs/build-support/emacs/melpa.nix @@ -47,11 +47,19 @@ in */ , commit ? (args.src.rev or "unknown") /* - recipe: Optional MELPA recipe. - Default: a minimal but not accurate recipe - You need to provide your own recipe if you want to set :files. + files: Optional recipe property specifying the files used to build the package. + If null, do not set it in recipe, keeping the default upstream behaviour. + Default: null */ -, recipe ? (writeText "${pname}-recipe" ''(${ename} :fetcher git :url "")'') +, files ? null + /* + recipe: Optional MELPA recipe. + Default: a minimally functional recipe + */ +, recipe ? (writeText "${pname}-recipe" '' + (${ename} :fetcher git :url "" + ${lib.optionalString (files != null) ":files ${files}"}) + '') , meta ? {} , ... }@args: