1 { lib, stdenv, fetchFromGitHub, pkg-config, ncurses, buildPackages }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
10 rev = "mg-${version}";
11 sha256 = "sha256-88FrXN7h5uRLY8YMKSzUjBF4n18DEiiiDyoYr+7qXdQ=";
14 postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
15 substituteInPlace configure --replace "./conftest" "echo"
18 enableParallelBuilding = true;
20 makeFlags = [ "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" ];
23 install -m 555 -Dt $out/bin mg
24 install -m 444 -Dt $out/share/man/man1 mg.1
26 nativeBuildInputs = [ pkg-config ];
28 buildInputs = [ ncurses ];
31 description = "Micro GNU/emacs, a portable version of the mg maintained by the OpenBSD team";
32 homepage = "https://man.openbsd.org/OpenBSD-current/man1/mg.1";
33 license = licenses.publicDomain;
35 platforms = platforms.all;