libwebsockets: remove generic function, format
Formatted with nixpkgs-fmt.
This commit is contained in:
parent
d819f15503
commit
bcd5ad6d83
2 changed files with 45 additions and 57 deletions
|
@ -5,64 +5,54 @@
|
||||||
, openssl
|
, openssl
|
||||||
, zlib
|
, zlib
|
||||||
, libuv
|
, 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
|
, withExternalPoll ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
generic = { version, hash, patches ? [] }: stdenv.mkDerivation rec {
|
pname = "libwebsockets";
|
||||||
pname = "libwebsockets";
|
version = "4.3.2";
|
||||||
inherit version;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "warmcat";
|
owner = "warmcat";
|
||||||
repo = "libwebsockets";
|
repo = "libwebsockets";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
inherit hash;
|
|
||||||
};
|
|
||||||
|
|
||||||
inherit patches;
|
|
||||||
|
|
||||||
buildInputs = [ openssl zlib libuv ];
|
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
"-DLWS_WITH_PLUGINS=ON"
|
|
||||||
"-DLWS_WITH_IPV6=ON"
|
|
||||||
"-DLWS_WITH_SOCKS5=ON"
|
|
||||||
"-DDISABLE_WERROR=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";
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
rm -r ${placeholder "out"}/share/libwebsockets-test-server
|
|
||||||
'';
|
|
||||||
|
|
||||||
# $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o
|
|
||||||
disallowedReferences = [ stdenv.cc.cc ];
|
|
||||||
|
|
||||||
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_4_3 = generic {
|
|
||||||
version = "4.3.2";
|
|
||||||
hash = "sha256-why8LAcc4XN0JdTJ1JoNWijKENL5mOHBsi9K4wpYr2c=";
|
hash = "sha256-why8LAcc4XN0JdTJ1JoNWijKENL5mOHBsi9K4wpYr2c=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buildInputs = [ openssl zlib libuv ];
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
|
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";
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
rm -r ${placeholder "out"}/share/libwebsockets-test-server
|
||||||
|
'';
|
||||||
|
|
||||||
|
# $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o
|
||||||
|
disallowedReferences = [ stdenv.cc.cc ];
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8094,9 +8094,7 @@ with pkgs;
|
||||||
|
|
||||||
librest_1_0 = callPackage ../development/libraries/librest/1.0.nix { };
|
librest_1_0 = callPackage ../development/libraries/librest/1.0.nix { };
|
||||||
|
|
||||||
inherit (callPackages ../development/libraries/libwebsockets { })
|
libwebsockets = callPackage ../development/libraries/libwebsockets { };
|
||||||
libwebsockets_4_3;
|
|
||||||
libwebsockets = libwebsockets_4_3;
|
|
||||||
|
|
||||||
licensee = callPackage ../tools/package-management/licensee { };
|
licensee = callPackage ../tools/package-management/licensee { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue