about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ue/uemacs/package.nix
blob: 4ed609868666a56d13c19019b7620b3ff513591b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ lib
, stdenv
, fetchgit
, ncurses
}:

stdenv.mkDerivation {
  pname = "uemacs";
  version = "4.0-unstable-2018-07-19";

  src = fetchgit {
    url = "https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git";
    rev = "1cdcf9df88144049750116e36fe20c8c39fa2517";
    hash = "sha256-QSouqZiBmKBU6FqRRfWtTGRIl5sqJ8tVPYwdytt/43w=";
  };

  nativeBuildInputs = [
    ncurses
  ];

  postPatch = ''
    substituteInPlace Makefile --replace "lcurses" "lncurses"
    substituteInPlace Makefile --replace "/usr/bin" "$out/bin"
    substituteInPlace Makefile --replace "/usr/lib" "$out/share/uemacs"

    substituteInPlace epath.h --replace "/usr/global/lib/" "$out/share/uemacs/"
  '';

  installPhase = ''
    mkdir -p $out/{bin,share/uemacs}
    make install
  '';

  meta = with lib; {
    description = "Linus Torvalds's random version of microemacs with his personal modifications";
    homepage = "https://git.kernel.org/pub/scm/editors/uemacs/uemacs.git/about/";
    platforms = platforms.linux;
    maintainers = with maintainers; [ networkexception ];
    mainProgram = "em";
    # MicroEMACS 3.9 can be copied and distributed freely for any
    # non-commercial purposes. MicroEMACS 3.9 can only be incorporated
    # into commercial software with the permission of the current author
    # [Daniel M. Lawrence].
    license = licenses.unfree;
  };
}