From 33f6a6e239d813d65e627086d78bd9579823d708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 7 Jun 2026 10:30:58 -0700 Subject: [PATCH 1/3] libmemcached: 1.0.18 -> 1.1.4 We switch the upstream to https://github.com/awesomized/libmemcached as did e.g. Alpine Linux and Arch Linux. Diff: https://github.com/awesomized/libmemcached/compare/1.0.18...1.1.4 Changelog: https://github.com/awesomized/libmemcached/blob/1.1.4/ChangeLog-1.1.md --- pkgs/by-name/li/libmemcached/musl-fixes.patch | 58 ------------------- pkgs/by-name/li/libmemcached/package.nix | 42 +++++++------- 2 files changed, 21 insertions(+), 79 deletions(-) delete mode 100644 pkgs/by-name/li/libmemcached/musl-fixes.patch diff --git a/pkgs/by-name/li/libmemcached/musl-fixes.patch b/pkgs/by-name/li/libmemcached/musl-fixes.patch deleted file mode 100644 index eb2a6bc980eb..000000000000 --- a/pkgs/by-name/li/libmemcached/musl-fixes.patch +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/libhashkit/fnv_64.cc b/libhashkit/fnv_64.cc -index 68e4dd0..64656b7 100644 ---- a/libhashkit/fnv_64.cc -+++ b/libhashkit/fnv_64.cc -@@ -37,8 +37,9 @@ - - - #include -+#include - --#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH) -+#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH) - - /* FNV hash'es lifted from Dustin Sallings work */ - static uint64_t FNV_64_INIT= 0xcbf29ce484222325; -diff --git a/libhashkit/has.cc b/libhashkit/has.cc -index 843e32e..4153e5e 100644 ---- a/libhashkit/has.cc -+++ b/libhashkit/has.cc -@@ -37,6 +37,7 @@ - - - #include -+#include - - bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo) - { -@@ -44,7 +45,7 @@ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo) - { - case HASHKIT_HASH_FNV1_64: - case HASHKIT_HASH_FNV1A_64: --#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH) -+#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH) - return true; - #else - return false; -diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc -index 29a22de..161c646 100644 ---- a/libtest/cmdline.cc -+++ b/libtest/cmdline.cc -@@ -61,7 +61,7 @@ using namespace libtest; - #include - #include - --#ifndef __USE_GNU -+#ifndef _GNU_SOURCE - static char **environ= NULL; - #endif - -@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[]) - - fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0); - --#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__) -+#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__) - // Use USEVFORK on linux - flags |= POSIX_SPAWN_USEVFORK; - #endif diff --git a/pkgs/by-name/li/libmemcached/package.nix b/pkgs/by-name/li/libmemcached/package.nix index dfcd86d022de..e28220062207 100644 --- a/pkgs/by-name/li/libmemcached/package.nix +++ b/pkgs/by-name/li/libmemcached/package.nix @@ -1,41 +1,41 @@ { lib, stdenv, - fetchurl, - fetchpatch, + fetchFromGitHub, + bison, + cmake, + flex, cyrus_sasl, libevent, }: stdenv.mkDerivation (finalAttrs: { pname = "libmemcached"; - version = "1.0.18"; + version = "1.1.4"; - src = fetchurl { - url = "https://launchpad.net/libmemcached/${lib.versions.majorMinor finalAttrs.version}/${finalAttrs.version}/+download/libmemcached-${finalAttrs.version}.tar.gz"; - sha256 = "10jzi14j32lpq0if0p9vygcl2c1352hwbywzvr9qzq7x6aq0nb72"; + src = fetchFromGitHub { + owner = "awesomized"; + repo = "libmemcached"; + tag = finalAttrs.version; + hash = "sha256-jEw6L2/139oo4sGprl9Xp0DTarxAK1bEF2ak2kHWSAs="; }; - # Fix linking against libpthread (patch from Fedora) - # https://bugzilla.redhat.com/show_bug.cgi?id=1037707 - # https://bugs.launchpad.net/libmemcached/+bug/1281907 - # Fix building on macOS (patch from Homebrew) - # https://bugs.launchpad.net/libmemcached/+bug/1245562 - patches = - lib.optional stdenv.hostPlatform.isLinux ./libmemcached-fix-linking-with-libpthread.patch - ++ lib.optional stdenv.hostPlatform.isDarwin (fetchpatch { - url = "https://raw.githubusercontent.com/Homebrew/homebrew/bfd4a0a4626b61c2511fdf573bcbbc6bbe86340e/Library/Formula/libmemcached.rb"; - sha256 = "1gjf3vd7hiyzxjvlg2zfc3y2j0lyr6nhbws4xb5dmin3csyp8qb8"; - }) - ++ lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch; + nativeBuildInputs = [ + bison + cmake + flex + ]; + + cmakeFlags = [ + "-DENABLE_SASL=ON" + ]; buildInputs = [ libevent ]; propagatedBuildInputs = [ cyrus_sasl ]; - env.NIX_CFLAGS_COMPILE = "-fpermissive"; - meta = { - homepage = "https://libmemcached.org"; + homepage = "https://github.com/awesomized/libmemcached"; + changelog = "https://github.com/awesomized/libmemcached/blob/${finalAttrs.src.tag}/ChangeLog-${lib.versions.majorMinor finalAttrs.version}.md"; description = "Open source C/C++ client library and tools for the memcached server"; license = lib.licenses.bsd3; platforms = lib.platforms.linux ++ lib.platforms.darwin; From 0c743500cbc0bd3ec743c42b80370c7e5b3da857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 7 Jun 2026 10:59:24 -0700 Subject: [PATCH 2/3] phpExtensions.memcached: drop superfluous configure flag --- pkgs/development/php-packages/memcached/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/php-packages/memcached/default.nix b/pkgs/development/php-packages/memcached/default.nix index fdbda0292e59..f2c5125dd677 100644 --- a/pkgs/development/php-packages/memcached/default.nix +++ b/pkgs/development/php-packages/memcached/default.nix @@ -24,12 +24,12 @@ buildPecl rec { configureFlags = [ "--with-zlib-dir=${zlib.dev}" - "--with-libmemcached-dir=${libmemcached}" ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ cyrus_sasl + libmemcached zlib ]; From 4b9eb9aca1bd14880cfa93c02195eef04a901936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 7 Jun 2026 13:46:05 -0700 Subject: [PATCH 3/3] libmemcached: run tests --- pkgs/by-name/li/libmemcached/package.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/by-name/li/libmemcached/package.nix b/pkgs/by-name/li/libmemcached/package.nix index e28220062207..bb3b5a90e3d2 100644 --- a/pkgs/by-name/li/libmemcached/package.nix +++ b/pkgs/by-name/li/libmemcached/package.nix @@ -7,6 +7,8 @@ flex, cyrus_sasl, libevent, + ctestCheckHook, + memcached, }: stdenv.mkDerivation (finalAttrs: { @@ -27,12 +29,25 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ + (lib.cmakeBool "BUILD_TESTING" finalAttrs.doCheck) "-DENABLE_SASL=ON" ]; buildInputs = [ libevent ]; propagatedBuildInputs = [ cyrus_sasl ]; + doCheck = true; + + nativeCheckInputs = [ + ctestCheckHook + memcached + ]; + + disabledTests = [ + "bin/memcapable" + "memcached_regression_lp583031" + ]; + meta = { homepage = "https://github.com/awesomized/libmemcached"; changelog = "https://github.com/awesomized/libmemcached/blob/${finalAttrs.src.tag}/ChangeLog-${lib.versions.majorMinor finalAttrs.version}.md";