diff --git a/pkgs/by-name/op/opendht/package.nix b/pkgs/by-name/op/opendht/package.nix index cecc8ee47b0b..eb6b2b8c5168 100644 --- a/pkgs/by-name/op/opendht/package.nix +++ b/pkgs/by-name/op/opendht/package.nix @@ -15,21 +15,32 @@ llhttp, openssl, fmt, + fetchpatch2, + nix-update-script, enableProxyServerAndClient ? false, enablePushNotifications ? false, }: -stdenv.mkDerivation { +stdenv.mkDerivation rec { pname = "opendht"; - version = "3.2.0-unstable-2025-01-05"; + version = "3.4.0"; src = fetchFromGitHub { owner = "savoirfairelinux"; repo = "opendht"; - rev = "5237f0a3b3eb8965f294de706ad73596569ae1dd"; - hash = "sha256-qErVKyZQR/asJ8qr0sRDaXZ8jUV7RaSLnJka5baWa7Q="; + tag = "v${version}"; + hash = "sha256-WNN4aCZiJuz9CgEKIzFmy50HBj0ZL/d1uU7L518lPhk="; }; + patches = lib.optionals enableProxyServerAndClient [ + # Remove this patch when switching to using shared llhttp + (fetchpatch2 { + url = "https://github.com/savoirfairelinux/opendht/commit/2bc46e9657c94adcce2479807a0a04c2f783bd4e.patch?full_index=1"; + hash = "sha256-znft836nPx8uvfHm0fQE9h+l5G006Im6IJOrsmElx6w="; + revert = true; + }) + ]; + nativeBuildInputs = [ cmake pkg-config @@ -61,13 +72,6 @@ stdenv.mkDerivation { "-DOPENDHT_PUSH_NOTIFICATIONS=ON" ]; - # https://github.com/savoirfairelinux/opendht/issues/612 - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ - --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} - ''; - outputs = [ "out" "lib" @@ -75,6 +79,10 @@ stdenv.mkDerivation { "man" ]; + passthru.updateScript = nix-update-script { + extraArgs = [ "--version-regex=v(.+)" ]; + }; + meta = with lib; { description = "C++11 Kademlia distributed hash table implementation"; homepage = "https://github.com/savoirfairelinux/opendht";