2014-01-20 23:57:04 +00:00
|
|
|
# generic builder for Emacs packages
|
|
|
|
|
|
|
|
{ lib, stdenv, emacs, texinfo }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{ pname
|
|
|
|
, version ? null
|
|
|
|
|
|
|
|
, buildInputs ? []
|
|
|
|
, packageRequires ? []
|
|
|
|
|
|
|
|
, meta ? {}
|
|
|
|
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
let
|
2015-05-24 14:06:12 +00:00
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
defaultMeta = {
|
|
|
|
broken = false;
|
|
|
|
platforms = emacs.meta.platforms;
|
2015-05-24 14:06:12 +00:00
|
|
|
} // optionalAttrs ((args.src.meta.homepage or "") != "") {
|
|
|
|
homepage = args.src.meta.homepage;
|
2014-01-20 23:57:04 +00:00
|
|
|
};
|
2015-05-24 14:06:12 +00:00
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "emacs-${pname}${optionalString (version != null) "-${version}"}";
|
|
|
|
|
2015-04-16 15:09:28 +00:00
|
|
|
unpackCmd = ''
|
|
|
|
case "$curSrc" in
|
|
|
|
*.el)
|
|
|
|
cp $curSrc $pname.el
|
|
|
|
chmod +w $pname.el
|
|
|
|
sourceRoot="."
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_defaultUnpack "$curSrc"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
'';
|
|
|
|
|
2014-01-20 23:57:04 +00:00
|
|
|
buildInputs = [emacs texinfo] ++ packageRequires ++ buildInputs;
|
|
|
|
propagatedBuildInputs = packageRequires;
|
|
|
|
propagatedUserEnvPkgs = packageRequires;
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = defaultMeta // meta;
|
|
|
|
}
|
|
|
|
|
|
|
|
// removeAttrs args [ "buildInputs" "packageRequires"
|
|
|
|
"meta"
|
|
|
|
])
|