2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchurl
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, glib
|
|
|
|
, gpm
|
|
|
|
, file
|
|
|
|
, e2fsprogs
|
|
|
|
, libX11
|
|
|
|
, libICE
|
|
|
|
, perl
|
|
|
|
, zip
|
|
|
|
, unzip
|
|
|
|
, gettext
|
|
|
|
, slang
|
|
|
|
, libssh2
|
|
|
|
, openssl
|
|
|
|
, coreutils
|
|
|
|
, autoreconfHook
|
2021-05-28 09:39:13 +00:00
|
|
|
, autoSignDarwinBinariesHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mc";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "4.8.26";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.midnight-commander.org/downloads/${pname}-${version}.tar.xz";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "sha256-xt6txQWV8tmiLcbCmanyizk+NYNG6/bKREqEadwWbCc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook unzip ]
|
|
|
|
# The preFixup hook rewrites the binary, which invaliates the code
|
|
|
|
# signature. Add the fixup hook to sign the output.
|
|
|
|
++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
|
|
|
|
autoSignDarwinBinariesHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
file
|
|
|
|
gettext
|
|
|
|
glib
|
|
|
|
libICE
|
|
|
|
libX11
|
|
|
|
libssh2
|
|
|
|
openssl
|
|
|
|
perl
|
|
|
|
slang
|
|
|
|
zip
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [ e2fsprogs gpm ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
configureFlags = [ "--enable-vfs-smb" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/filemanager/ext.c \
|
|
|
|
--replace /bin/rm ${coreutils}/bin/rm
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preFixup = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
# remove unwanted build-dependency references
|
|
|
|
sed -i -e "s!PKG_CONFIG_PATH=''${PKG_CONFIG_PATH}!PKG_CONFIG_PATH=$(echo "$PKG_CONFIG_PATH" | sed -e 's/./0/g')!" $out/bin/mc
|
|
|
|
'';
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
postFixup = lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
# libX11.so is loaded dynamically so autopatch doesn't detect it
|
|
|
|
patchelf \
|
|
|
|
--add-needed ${libX11}/lib/libX11.so \
|
|
|
|
$out/bin/mc
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "File Manager and User Shell for the GNU Project";
|
|
|
|
downloadPage = "https://www.midnight-commander.org/downloads/";
|
|
|
|
homepage = "https://www.midnight-commander.org";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ sander ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
repositories.git = "https://github.com/MidnightCommander/mc.git";
|
|
|
|
updateWalker = true;
|
|
|
|
};
|
|
|
|
}
|