gftp: modernize

This commit is contained in:
Haylin Moore 2025-04-07 14:59:55 -04:00 committed by Sigmanificient
parent e1a5871e76
commit 0b2d1c35b1

View File

@ -12,23 +12,21 @@
openssl, openssl,
pkg-config, pkg-config,
readline, readline,
nix-update-script,
versionCheckHook,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
pname = "gftp"; pname = "gftp";
version = "2.9.1b"; version = "2.9.1b";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "masneyb"; owner = "masneyb";
repo = "gftp"; repo = "gftp";
rev = version; tag = finalAttrs.version;
hash = "sha256-0zdv2oYl24BXh61IGCWby/2CCkzNjLpDrAFc0J89Pw4="; hash = "sha256-0zdv2oYl24BXh61IGCWby/2CCkzNjLpDrAFc0J89Pw4=";
}; };
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-incompatible-pointer-types" # https://github.com/masneyb/gftp/issues/178
];
nativeBuildInputs = [ nativeBuildInputs = [
autoconf autoconf
automake automake
@ -45,18 +43,28 @@ stdenv.mkDerivation rec {
readline readline
]; ];
# https://github.com/masneyb/gftp/issues/178
postPatch = ''
substituteInPlace lib/gftp.h \
--replace-fail "size_t remote_addr_len" "socklen_t remote_addr_len"
'';
preConfigure = '' preConfigure = ''
./autogen.sh ./autogen.sh
''; '';
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
meta = with lib; { doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.updateScript = nix-update-script { };
meta = {
homepage = "https://github.com/masneyb/gftp"; homepage = "https://github.com/masneyb/gftp";
description = "GTK-based multithreaded FTP client for *nix-based machines"; description = "GTK-based multithreaded FTP client for *nix-based machines";
license = licenses.gpl2Plus; license = lib.licenses.gpl2Plus;
maintainers = with maintainers; [ ]; maintainers = [ lib.maintainers.haylin ];
platforms = platforms.unix; platforms = lib.platforms.unix;
}; };
} })
# TODO: report the hardeningDisable to upstream