From 9ca99d20ab4e4a9b10f2e1095f27fd55a2e9433c Mon Sep 17 00:00:00 2001 From: Rick van Schijndel Date: Sun, 2 Nov 2025 19:09:07 +0100 Subject: [PATCH] libwebsockets: 4.3.5 -> 4.4.1 Diff: https://github.com/warmcat/libwebsockets/compare/v4.3.5...v4.4.1 Changelog (only 4.4.0 is listed): https://github.com/warmcat/libwebsockets/blob/v4.4.1/changelog Somehow linking for test apps has broken, but dependents seem to build fine. Not sure what happened but there are quite some changes around CMake, so it's likely something happened there. For reference the build error when test apps are linked: libwebsockets> [ 3%] Building C object minimal-examples-lowlevel/api-tests/api-test-jpeg/CMakeFiles/lws-api-test-jpeg.dir/main.c.o libwebsockets> [ 3%] Linking C executable ../../../bin/lws-api-test-gunzip libwebsockets> [ 4%] Linking C executable ../../../bin/lws-minimal-ss-ws-echo libwebsockets> /nix/store/416ykpc2bksb90sd1ia8cybxb3p83mrd-binutils-2.44/bin/ld: cannot find -lwebsockets: No such file or directory libwebsockets> collect2: error: ld returned 1 exit status libwebsockets> make[2]: *** [minimal-examples-lowlevel/api-tests/api-test-gunzip/CMakeFiles/lws-api-test-gunzip.dir/build.make:101: bin/lws-api-test-gunzip] Error 1 libwebsockets> make[1]: *** [CMakeFiles/Makefile2:4307: minimal-examples-lowlevel/api-tests/api-test-gunzip/CMakeFiles/lws-api-test-gunzip.dir/all] Error 2 For some reason it tries to link libwebsockets before it's built... --- pkgs/by-name/li/libwebsockets/package.nix | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/li/libwebsockets/package.nix b/pkgs/by-name/li/libwebsockets/package.nix index 3c6a144f0b40..6a7d4e8bcfd1 100644 --- a/pkgs/by-name/li/libwebsockets/package.nix +++ b/pkgs/by-name/li/libwebsockets/package.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation rec { pname = "libwebsockets"; - version = "4.3.5"; + version = "4.4.1"; src = fetchFromGitHub { owner = "warmcat"; repo = "libwebsockets"; rev = "v${version}"; - hash = "sha256-KOAhIVn4G5u0A1TE75Xv7iYO3/i8foqWYecH0kJHdBM="; + hash = "sha256-Xvcnfvm9UCNXm3G3tVe7jExE3fwpzYuz8wllvINymeI="; }; patches = [ @@ -35,14 +35,6 @@ stdenv.mkDerivation rec { }) ]; - # Updating to 4.4.1 would bring some errors, and the patch doesn't apply cleanly - # https://github.com/warmcat/libwebsockets/commit/47efb8c1c2371fa309f85a32984e99b2cc1d614a - postPatch = '' - for f in $(find . -name CMakeLists.txt); do - sed '/^cmake_minimum_required/Is/VERSION [0-9]\.[0-9]/VERSION 3.5/' -i "$f" - done - ''; - outputs = [ "out" "dev" @@ -62,6 +54,8 @@ stdenv.mkDerivation rec { "-DLWS_WITH_SOCKS5=ON" "-DDISABLE_WERROR=ON" "-DLWS_BUILD_HASH=no_hash" + # TODO(Mindavi): figure out why linking has broken for test apps between 4.3.5 and 4.4.1. + "-DLWS_WITHOUT_TESTAPPS=ON" ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON"