2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, buildPackages }:
|
2017-09-25 12:00:48 +00:00
|
|
|
|
2013-07-30 13:53:00 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "mg";
|
2021-12-30 20:42:34 +00:00
|
|
|
version = "7.0";
|
2013-07-30 13:53:00 +00:00
|
|
|
|
2020-04-20 20:34:39 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-05-07 16:37:53 +00:00
|
|
|
owner = "ibara";
|
2020-04-20 20:34:39 +00:00
|
|
|
repo = "mg";
|
2021-06-13 00:54:33 +00:00
|
|
|
rev = "mg-${version}";
|
2021-12-30 20:42:34 +00:00
|
|
|
sha256 = "sha256-qnb0yB/NNJV257dsLmP84brajoRG03U+Ja1ACYbBvbE=";
|
2013-07-30 13:53:00 +00:00
|
|
|
};
|
|
|
|
|
2022-04-20 11:21:08 +00:00
|
|
|
postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
|
|
|
substituteInPlace configure --replace "./conftest" "echo"
|
|
|
|
'';
|
|
|
|
|
2017-09-25 12:00:48 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
makeFlags = [ "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" ];
|
2016-08-12 04:02:00 +00:00
|
|
|
|
2013-07-30 13:53:00 +00:00
|
|
|
installPhase = ''
|
2017-09-25 12:00:48 +00:00
|
|
|
install -m 555 -Dt $out/bin mg
|
|
|
|
install -m 444 -Dt $out/share/man/man1 mg.1
|
2013-07-30 13:53:00 +00:00
|
|
|
'';
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-25 12:00:48 +00:00
|
|
|
|
2020-05-07 16:37:53 +00:00
|
|
|
buildInputs = [ ncurses ];
|
2013-07-30 13:53:00 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Micro GNU/emacs, a portable version of the mg maintained by the OpenBSD team";
|
2020-05-07 16:37:53 +00:00
|
|
|
homepage = "https://man.openbsd.org/OpenBSD-current/man1/mg.1";
|
2017-03-19 21:07:12 +00:00
|
|
|
license = licenses.publicDomain;
|
|
|
|
platforms = platforms.all;
|
2013-07-30 13:53:00 +00:00
|
|
|
};
|
|
|
|
}
|