about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libwebsockets
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/libraries/libwebsockets
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libwebsockets')
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebsockets/default.nix102
1 files changed, 39 insertions, 63 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
index faf6acd40b92..0b8d8d8e5817 100644
--- a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
@@ -5,78 +5,54 @@
 , openssl
 , zlib
 , libuv
-# External poll is required for e.g. mosquitto, but discouraged by the maintainer.
+  # External poll is required for e.g. mosquitto, but discouraged by the maintainer.
 , withExternalPoll ? false
 }:
 
-let
-  generic = { version, sha256 }: stdenv.mkDerivation rec {
-    pname = "libwebsockets";
-    inherit version;
+stdenv.mkDerivation rec {
+  pname = "libwebsockets";
+  version = "4.3.2";
 
-    src = fetchFromGitHub {
-      owner = "warmcat";
-      repo = "libwebsockets";
-      rev = "v${version}";
-      inherit sha256;
-    };
-
-    buildInputs = [ openssl zlib libuv ];
-
-    nativeBuildInputs = [ cmake ];
+  src = fetchFromGitHub {
+    owner = "warmcat";
+    repo = "libwebsockets";
+    rev = "v${version}";
+    hash = "sha256-why8LAcc4XN0JdTJ1JoNWijKENL5mOHBsi9K4wpYr2c=";
+  };
 
-    cmakeFlags = [
-      "-DLWS_WITH_PLUGINS=ON"
-      "-DLWS_WITH_IPV6=ON"
-      "-DLWS_WITH_SOCKS5=ON"
-      # Required since v4.2.0
-      "-DLWS_BUILD_HASH=no_hash"
-    ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON"
-      ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON";
+  buildInputs = [ openssl zlib libuv ];
 
-    NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=unused-but-set-variable";
+  nativeBuildInputs = [ cmake ];
 
-    postInstall = ''
-      rm -r ${placeholder "out"}/share/libwebsockets-test-server
-    '';
+  cmakeFlags = [
+    "-DLWS_WITH_PLUGINS=ON"
+    "-DLWS_WITH_IPV6=ON"
+    "-DLWS_WITH_SOCKS5=ON"
+    "-DDISABLE_WERROR=ON"
+    "-DLWS_BUILD_HASH=no_hash"
+  ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON"
+  ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON";
 
-    # $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o
-    disallowedReferences = [ stdenv.cc.cc ];
+  postInstall = ''
+    rm -r ${placeholder "out"}/share/libwebsockets-test-server
+  '';
 
-    meta = with lib; {
-      description = "Light, portable C library for websockets";
-      longDescription = ''
-        Libwebsockets is a lightweight pure C library built to
-        use minimal CPU and memory resources, and provide fast
-        throughput in both directions.
-      '';
-      homepage = "https://libwebsockets.org/";
-      # Relicensed from LGPLv2.1+ to MIT with 4.0. Licensing situation
-      # is tricky, see https://github.com/warmcat/libwebsockets/blob/main/LICENSE
-      license = with licenses; [ mit publicDomain bsd3 asl20 ];
-      maintainers = with maintainers; [ mindavi ];
-      platforms = platforms.all;
-    };
-  };
-
-in {
-  libwebsockets_3_1 = generic {
-    sha256 = "1w1wz6snf3cmcpa3f4dci2nz9za2f5rrylxl109id7bcb36xhbdl";
-    version = "3.1.0";
-  };
+  # $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o
+  disallowedReferences = [ stdenv.cc.cc ];
 
-  libwebsockets_3_2 = generic {
-    version = "3.2.2";
-    sha256 = "0m1kn4p167jv63zvwhsvmdn8azx3q7fkk8qc0fclwyps2scz6dna";
-  };
-
-  libwebsockets_4_2 = generic {
-    version = "4.2.1";
-    sha256 = "sha256-C+WGfNF4tAgbp/7aRraBgjNOe4I5ihm+8CGelXzfxbU=";
-  };
-
-  libwebsockets_4_3 = generic {
-    version = "4.3.0";
-    sha256 = "13lxb487mqlzbsbv6fbj50r1717mfwdy87ps592lgfy3307yqpr4";
+  meta = with lib; {
+    description = "Light, portable C library for websockets";
+    longDescription = ''
+      Libwebsockets is a lightweight pure C library built to
+      use minimal CPU and memory resources, and provide fast
+      throughput in both directions.
+    '';
+    homepage = "https://libwebsockets.org/";
+    # Relicensed from LGPLv2.1+ to MIT with 4.0. Licensing situation
+    # is tricky, see https://github.com/warmcat/libwebsockets/blob/main/LICENSE
+    license = with licenses; [ mit publicDomain bsd3 asl20 ];
+    maintainers = with maintainers; [ mindavi ];
+    platforms = platforms.all;
   };
 }
+