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...
This commit is contained in:
Rick van Schijndel
2025-11-02 19:09:07 +01:00
parent 95f18db627
commit 9ca99d20ab
+4 -10
View File
@@ -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"