summary refs log tree commit diff
path: root/pkgs/development/libraries/libwebsockets/default.nix
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-09-16 12:28:30 +0800
committerPeter Hoeg <peter@hoeg.com>2019-09-16 12:36:33 +0800
commitb02b889255f7c4ee94d9eb89c720e91c4213817c (patch)
tree0af9439d2ebe09bab1de076e486a7277f38d51a9 /pkgs/development/libraries/libwebsockets/default.nix
parente19054ab3cd5b7cc9a01d0efc71c8fe310541065 (diff)
downloadnixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.tar
nixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.tar.gz
nixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.tar.bz2
nixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.tar.lz
nixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.tar.xz
nixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.tar.zst
nixpkgs-b02b889255f7c4ee94d9eb89c720e91c4213817c.zip
libwebsockets: re-init 3.1
Diffstat (limited to 'pkgs/development/libraries/libwebsockets/default.nix')
-rw-r--r--pkgs/development/libraries/libwebsockets/default.nix63
1 files changed, 41 insertions, 22 deletions
diff --git a/pkgs/development/libraries/libwebsockets/default.nix b/pkgs/development/libraries/libwebsockets/default.nix
index a297bf61f78..732a529c21f 100644
--- a/pkgs/development/libraries/libwebsockets/default.nix
+++ b/pkgs/development/libraries/libwebsockets/default.nix
@@ -1,28 +1,47 @@
 { fetchFromGitHub, stdenv, cmake, openssl, zlib, libuv }:
 
-stdenv.mkDerivation rec {
-  pname = "libwebsockets";
-  version = "3.2.0";
-
-  src = fetchFromGitHub {
-    owner = "warmcat";
-    repo = "libwebsockets";
-    rev = "v${version}";
-    sha256 = "0ac5755h3w1pl6cznqbvg63dwkqy544fqlhvqyp7s11hgs7jx6l8";
+let
+  generic = { version, sha256 }: stdenv.mkDerivation rec {
+    pname = "libwebsockets";
+    inherit version;
+
+    src = fetchFromGitHub {
+      owner = "warmcat";
+      repo = "libwebsockets";
+      rev = "v${version}";
+      inherit sha256;
+    };
+
+    buildInputs = [ openssl zlib libuv ];
+
+    nativeBuildInputs = [ cmake ];
+
+    cmakeFlags = [ "-DLWS_WITH_PLUGINS=ON" ];
+
+    meta = with stdenv.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/";
+      license = licenses.lgpl21;
+      platforms = platforms.all;
+    };
   };
 
-  buildInputs = [ cmake openssl zlib libuv ];
-  cmakeFlags = [ "-DLWS_WITH_PLUGINS=ON" ];
-
-  meta = {
-    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://github.com/warmcat/libwebsockets;
-    license = stdenv.lib.licenses.lgpl21;
-    platforms = stdenv.lib.platforms.all;
+in
+rec {
+  libwebsockets_3_1 = generic {
+    sha256 = "1w1wz6snf3cmcpa3f4dci2nz9za2f5rrylxl109id7bcb36xhbdl";
+    version = "3.1.0";
   };
+
+  libwebsockets_3_2 = generic {
+    version = "3.2.0";
+    sha256 = "0ac5755h3w1pl6cznqbvg63dwkqy544fqlhvqyp7s11hgs7jx6l8";
+  };
+
+  libwebsockets = libwebsockets_3_2;
 }