summary refs log tree commit diff
path: root/pkgs/applications/editors/nedit/default.nix
blob: b49fbc14fad9ceb02837775bbadc3787ba94c984 (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
{ lib, stdenv, fetchurl, motif, libXpm, libXt }:

stdenv.mkDerivation rec {
  pname = "nedit";
  version = "5.7";

  src = fetchurl {
    url = "mirror://sourceforge/nedit/nedit-source/${pname}-${version}-src.tar.gz";
    sha256 = "0ym1zhjx9976rf2z5nr7dj4mjkxcicimhs686snjhdcpzxwsrndd";
  };

  hardeningDisable = [ "format" ];

  buildInputs = [ motif libXpm libXt ];

  # the linux config works fine on darwin too!
  buildFlags = lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux";

  NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib";

  installPhase = ''
    mkdir -p $out/bin
    cp -p source/nedit source/nc $out/bin
  '';

  meta = with lib; {
    homepage = "https://sourceforge.net/projects/nedit";
    description = "A fast, compact Motif/X11 plain text editor";
    platforms = with platforms; linux ++ darwin;
    license = licenses.gpl2;
  };
}