@@ -1,29 +1,51 @@
1−{ stdenv, fetchurl, bison, pkgconfig
2−, glib, gtk2, libxml2, gettext, zlib, binutils, gnutls }:
1+{ stdenv, fetchurl, fetchpatch, bison, pkgconfig, gettext, desktop-file-utils
2+, glib, gtk2, libxml2, libbfd, zlib, binutils, gnutls
3+}:
34
4−let
5− name = "gtk-gnutella";
6− version = "1.1.9";
7−in
8−stdenv.mkDerivation {
9− name = "${name}-${version}";
5+stdenv.mkDerivation rec {
6+ pname = "gtk-gnutella";
7+ version = "1.1.14";
108
119 src = fetchurl {
12− url = "mirror://sourceforge/${name}/${name}-${version}.tar.bz2";
13− sha256 = "1zvadgsskmpm82id9mbj24a2lyq38qv768ixv7nmfjl3d4wr2biv";
10+ url = "mirror://sourceforge/${pname}/${version}/${pname}-${version}.tar.xz";
11+ sha256 = "0sljjha4anfz1r1xq1c6qnnkjv62ld56p7xgj4bsi6lqmq1azvii";
1412 };
1513
16− nativeBuildInputs = [ bison gettext pkgconfig ];
17− buildInputs = [ binutils glib gnutls gtk2 libxml2 zlib ];
14+ patches = [
15+ (fetchpatch {
16+ # Avoid namespace conflict with glibc 2.28 'statx' struct / remove after v1.1.14
17+ url = "https://github.com/gtk-gnutella/gtk-gnutella/commit/e4205a082eb32161e28de81f5cba8095eea8ecc7.patch";
18+ sha256 = "0ffkw2cw2b2yhydii8jm40vd40p4xl224l8jvhimg02lgs3zfbca";
19+ })
20+ (fetchpatch {
21+ url = "https://src.fedoraproject.org/rpms/gtk-gnutella/raw/f30/f/gtk-gnutella-1.1.14-endian.patch";
22+ sha256 = "19q4lq8msknfz4mkbjdqmmgld16p30j2yx371p8spmr19q5i0sfn";
23+ })
24+ ];
25+
26+ postPatch = ''
27+ substituteInPlace Makefile.SH --replace "@exit 0" "@echo done"
28+ '';
29+
30+ nativeBuildInputs = [ bison desktop-file-utils gettext pkgconfig ];
31+ buildInputs = [ binutils glib gnutls gtk2 libbfd libxml2 zlib ];
32+
33+ configureScript = "./build.sh";
34+ configureFlags = [ "--configure-only" ];
1835
1936 hardeningDisable = [ "bindnow" "fortify" "pic" "relro" ];
2037
21− configureScript = "./build.sh --configure-only";
38+ enableParallelBuilding = true;
39+
40+ postInstall = ''
41+ install -Dm0444 src/${pname}.man $out/share/man/man1/${pname}.1
42+ '';
2243
2344 meta = with stdenv.lib; {
24− homepage = http://gtk-gnutella.sourceforge.net/;
25− description = "Server/client for Gnutella";
26− license = licenses.gpl2;
45+ description = "A GTK+ Gnutella client, optimized for speed and scalability";
46+ homepage = "http://gtk-gnutella.sourceforge.net/"; # Code: https://github.com/gtk-gnutella/gtk-gnutella
47+ changelog = "https://raw.githubusercontent.com/gtk-gnutella/gtk-gnutella/v${version}/ChangeLog";
48+ license = licenses.gpl2Plus;
2749 platforms = platforms.unix;
2850 };
2951}