diff --git a/pkgs/by-name/rd/rdesktop/package.nix b/pkgs/by-name/rd/rdesktop/package.nix index 1711a259195d..dc9f40b9cf50 100644 --- a/pkgs/by-name/rd/rdesktop/package.nix +++ b/pkgs/by-name/rd/rdesktop/package.nix @@ -12,18 +12,19 @@ pkg-config, autoreconfHook, libiconv, + fetchpatch, enableCredssp ? (!stdenv.hostPlatform.isDarwin), }: -stdenv.mkDerivation (rec { +stdenv.mkDerivation (finalAttrs: { pname = "rdesktop"; version = "1.9.0"; src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "v${version}"; - sha256 = "1s6k1jwd28y38ymk3lfv76ch4arpfwrbdhpkbnwwy3fc4617gb78"; + owner = "rdesktop"; + repo = "rdesktop"; + tag = "v${finalAttrs.version}"; + hash = "sha256-6Kx3giHMDc+5XfPCtjJ3NysCmTnb0TGrR8Mj0bgM0+g="; }; nativeBuildInputs = [ @@ -48,6 +49,18 @@ stdenv.mkDerivation (rec { "--disable-smartcard" ] ++ lib.optional (!enableCredssp) "--disable-credssp"; + patches = [ + ./rdesktop-configure-c99.patch + (fetchpatch { + url = "https://github.com/rdesktop/rdesktop/commit/105c8cb69facf26238cd48f14ca9dbc0ff6be6bd.patch"; + hash = "sha256-3/y7JaKDyULhlzwP3bsA8kOq7g4AvWUi50gxkCZ8sbU="; + }) + (fetchpatch { + url = "https://github.com/rdesktop/rdesktop/commit/53ba87dc174175e98332e22355ad8662c02880d6.patch"; + hash = "sha256-ORGHdabSu9kVkNovweqFVS53dx6NbiryPlgi6Qp83BA="; + }) + ]; + meta = { description = "Open source client for Windows Terminal Services"; mainProgram = "rdesktop"; diff --git a/pkgs/by-name/rd/rdesktop/rdesktop-configure-c99.patch b/pkgs/by-name/rd/rdesktop/rdesktop-configure-c99.patch new file mode 100644 index 000000000000..4962569166a7 --- /dev/null +++ b/pkgs/by-name/rd/rdesktop/rdesktop-configure-c99.patch @@ -0,0 +1,24 @@ +Avoid spurious implicit int/implicit function declaration errors in the +statvfs64 check (which still fails on Fedora; statvfs is used instead). + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index 1ab12a83b01f8a47..b5092b0f8cab520f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -668,12 +668,13 @@ if test $space = no; then + # SVR4 + AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64, + [AC_TRY_RUN([ ++#include + #if defined(HAVE_UNISTD_H) + #include + #endif + #include + #include +- main () ++ int main (void) + { + struct statvfs64 fsd; + exit (statvfs64 (".", &fsd));