diff --git a/pkgs/applications/editors/emacs-modes/magit/default.nix b/pkgs/applications/editors/emacs-modes/magit/default.nix index 3793f5d1e6af..093a5420a5ee 100644 --- a/pkgs/applications/editors/emacs-modes/magit/default.nix +++ b/pkgs/applications/editors/emacs-modes/magit/default.nix @@ -1,24 +1,34 @@ -{ stdenv, fetchurl, emacs, texinfo }: +{ stdenv, fetchFromGitHub, emacs, texinfo, gitModes, git }: let - version = "1.2.1"; + version = "90141016"; in stdenv.mkDerivation rec { name = "magit-${version}"; - src = fetchurl { - url = "https://github.com/magit/magit/releases/download/${version}/${name}.tar.gz"; - sha256 = "1in48g5l5xdc9cf2apnpgx73mqlz2njrpi1w52dgql4qxv3kg6gr"; + src = fetchFromGitHub { + owner = "magit"; + repo = "magit"; + rev = version; + sha256 = "11d3gzj0hlb7wqsjzjb0vf9i0ik4xzwdyayjy4hfgx0gjmymkfx3"; }; - buildInputs = [ emacs texinfo ]; - configurePhase = "makeFlagsArray=( PREFIX=$out SYSCONFDIR=$out/etc )"; + buildInputs = [ emacs texinfo git ]; + propagatedUserEnvPkgs = [ gitModes ]; + + configurePhase = '' + makeFlagsArray=( + PREFIX="$out" + EFLAGS="-L ${gitModes}/share/emacs/site-lisp" + ) + ''; + + doCheck = true; + checkTarget = "test"; - # Add (require 'magit-site-init) to your ~/.emacs file to set-up magit mode. postInstall = '' - mv $out/etc/emacs/site-start.d/50magit.el $out/share/emacs/site-lisp/magit-site-init.el - sed -i -e 's|50magit|magit-site-init|' $out/share/emacs/site-lisp/magit-site-init.el - rmdir $out/etc/emacs/site-start.d $out/etc/emacs $out/etc + mkdir -p $out/bin + mv "bin/"* $out/bin/ ''; meta = { @@ -38,7 +48,6 @@ stdenv.mkDerivation rec { save you from learning Git itself. ''; - platforms = stdenv.lib.platforms.all; maintainers = with stdenv.lib.maintainers; [ simons ]; }; }