2014-01-20 23:57:04 +00:00
|
|
|
# builder for Emacs packages built for packages.el
|
|
|
|
# using MELPA package-build.el
|
2015-02-17 23:06:27 +00:00
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
{ lib, stdenv, fetchurl, emacs, texinfo }:
|
|
|
|
|
|
|
|
with lib;
|
2015-02-17 23:06:27 +00:00
|
|
|
|
|
|
|
{ pname
|
|
|
|
, version
|
|
|
|
|
|
|
|
, files ? null
|
|
|
|
, fileSpecs ? [ "*.el" "*.el.in" "dir"
|
|
|
|
"*.info" "*.texi" "*.texinfo"
|
|
|
|
"doc/dir" "doc/*.info" "doc/*.texi" "doc/*.texinfo"
|
|
|
|
]
|
|
|
|
|
|
|
|
, meta ? {}
|
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
, ...
|
|
|
|
}@args:
|
2015-02-17 23:06:27 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
packageBuild = fetchurl {
|
2015-12-27 16:37:02 +00:00
|
|
|
url = https://raw.githubusercontent.com/milkypostman/melpa/2b3eb31c077fcaff94b74b757c1ce17650333943/package-build.el;
|
|
|
|
sha256 = "1biwg2pqmmdz5iwqbjdszljazqymvgyyjcnc255nr6qz8mhnx67j";
|
2015-02-17 23:06:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fname = "${pname}-${version}";
|
|
|
|
|
|
|
|
targets = concatStringsSep " " (if files == null then fileSpecs else files);
|
|
|
|
|
|
|
|
defaultMeta = {
|
2015-05-24 14:06:12 +00:00
|
|
|
homepage = args.src.meta.homepage or "http://melpa.org/#/${pname}";
|
2015-02-17 23:06:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
|
|
|
|
inherit packageBuild;
|
2015-02-17 23:06:27 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
|
|
|
-f melpa2nix-build-package \
|
|
|
|
${pname} ${version} ${targets}
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
|
|
|
-f melpa2nix-install-package \
|
|
|
|
${fname}.* $out/share/emacs/site-lisp/elpa
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = defaultMeta // meta;
|
|
|
|
}
|
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
// removeAttrs args [ "files" "fileSpecs"
|
|
|
|
"meta"
|
|
|
|
])
|