2014-01-21 00:57:04 +01:00
|
|
|
# builder for Emacs packages built for packages.el
|
|
|
|
# using MELPA package-build.el
|
2015-02-18 00:06:27 +01:00
|
|
|
|
2014-01-21 00:57:04 +01:00
|
|
|
{ lib, stdenv, fetchurl, emacs, texinfo }:
|
|
|
|
|
|
|
|
with lib;
|
2015-02-18 00:06:27 +01:00
|
|
|
|
|
|
|
{ pname
|
|
|
|
, version
|
|
|
|
|
|
|
|
, files ? null
|
|
|
|
, fileSpecs ? [ "*.el" "*.el.in" "dir"
|
|
|
|
"*.info" "*.texi" "*.texinfo"
|
|
|
|
"doc/dir" "doc/*.info" "doc/*.texi" "doc/*.texinfo"
|
|
|
|
]
|
|
|
|
|
|
|
|
, meta ? {}
|
|
|
|
|
2014-01-21 00:57:04 +01:00
|
|
|
, ...
|
|
|
|
}@args:
|
2015-02-18 00:06:27 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2014-01-21 00:57:04 +01:00
|
|
|
packageBuild = fetchurl {
|
2015-02-18 00:06:27 +01:00
|
|
|
url = https://raw.githubusercontent.com/milkypostman/melpa/12a862e5c5c62ce627dab83d7cf2cca6e8b56c47/package-build.el;
|
|
|
|
sha256 = "1nviyyprypz7nmam9rwli4yv3kxh170glfbznryrp4czxkrjjdhk";
|
|
|
|
};
|
|
|
|
|
|
|
|
fname = "${pname}-${version}";
|
|
|
|
|
|
|
|
targets = concatStringsSep " " (if files == null then fileSpecs else files);
|
|
|
|
|
|
|
|
defaultMeta = {
|
2015-05-24 16:06:12 +02:00
|
|
|
homepage = args.src.meta.homepage or "http://melpa.org/#/${pname}";
|
2015-02-18 00:06:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2014-01-21 00:57:04 +01:00
|
|
|
import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
|
|
|
|
inherit packageBuild;
|
2015-02-18 00:06:27 +01: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-21 00:57:04 +01:00
|
|
|
// removeAttrs args [ "files" "fileSpecs"
|
|
|
|
"meta"
|
|
|
|
])
|