about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libwebsockets
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-09-20 19:56:04 +0000
committerAlyssa Ross <hi@alyssa.is>2019-09-28 14:40:49 +0000
commit36bedbe5c162bab9e7ef702f353ae399fdfd0518 (patch)
treefb2926eee09fe0714683074758276739e9e5cda9 /nixpkgs/pkgs/development/libraries/libwebsockets
parent47852a9ef0e62a2d565f9ec0fba2a3ae77c44221 (diff)
parent262b328b0bad0c4b97ed495679208e4a2eb87704 (diff)
downloadnixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar
nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.gz
nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.bz2
nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.lz
nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.xz
nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.tar.zst
nixlib-36bedbe5c162bab9e7ef702f353ae399fdfd0518.zip
Merge commit '262b328b0bad0c4b97ed495679208e4a2eb87704'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libwebsockets')
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebsockets/default.nix63
1 files changed, 41 insertions, 22 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
index a297bf61f786..732a529c21f4 100644
--- a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
+++ b/nixpkgs/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;
 }