Skip to content

Commit 83b7d44

Browse files
committed
squash! feat: Add a function for building ELPA-compatible archives
1 parent 792de8b commit 83b7d44

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkgs/build-support/elisp/convertToElpaArchive.nix

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}:
66
{
77
ename,
8-
version,
8+
version ? null,
99
meta,
1010
sourceInfo ? null,
1111
packageRequires,
@@ -29,14 +29,16 @@ let
2929
commitInfo = lib.optionalString (sourceInfo != null && sourceInfo ? rev) ''
3030
:commit "${sourceInfo.rev}"
3131
'';
32+
33+
versionString = if version != null then version else "0";
3234
in
33-
runCommand "${ename}-${version}"
35+
runCommand "${ename}-${versionString}"
3436
{
3537
buildInputs = lib.optional hasInfo texinfo;
3638

3739
pkgDescription = ''
38-
(define-package "${ename}" "${version}" "${meta.description}"
39-
'${attrsToLispAlist packageRequires}
40+
(define-package "${ename}" "${versionString}" "${meta.description}"
41+
'${attrsToLispAlist (builtins.mapAttrs (_: v: if v != null then v else "0") packageRequires)}
4042
${commitInfo})
4143
;; Local Variables:
4244
;; no-byte-compile: t

0 commit comments

Comments
 (0)