libwebsockets: remove generic function, format

Formatted with nixpkgs-fmt.

+40 -52
+39 -49
pkgs/development/libraries/libwebsockets/default.nix
··· 5 5 , openssl 6 6 , zlib 7 7 , libuv 8 - # External poll is required for e.g. mosquitto, but discouraged by the maintainer. 8 + # External poll is required for e.g. mosquitto, but discouraged by the maintainer. 9 9 , withExternalPoll ? false 10 10 }: 11 11 12 - let 13 - generic = { version, hash, patches ? [] }: stdenv.mkDerivation rec { 14 - pname = "libwebsockets"; 15 - inherit version; 16 - 17 - src = fetchFromGitHub { 18 - owner = "warmcat"; 19 - repo = "libwebsockets"; 20 - rev = "v${version}"; 21 - inherit hash; 22 - }; 12 + stdenv.mkDerivation rec { 13 + pname = "libwebsockets"; 14 + version = "4.3.2"; 23 15 24 - inherit patches; 25 - 26 - buildInputs = [ openssl zlib libuv ]; 16 + src = fetchFromGitHub { 17 + owner = "warmcat"; 18 + repo = "libwebsockets"; 19 + rev = "v${version}"; 20 + hash = "sha256-why8LAcc4XN0JdTJ1JoNWijKENL5mOHBsi9K4wpYr2c="; 21 + }; 27 22 28 - nativeBuildInputs = [ cmake ]; 23 + buildInputs = [ openssl zlib libuv ]; 29 24 30 - cmakeFlags = [ 31 - "-DLWS_WITH_PLUGINS=ON" 32 - "-DLWS_WITH_IPV6=ON" 33 - "-DLWS_WITH_SOCKS5=ON" 34 - "-DDISABLE_WERROR=ON" 35 - # Required since v4.2.0 36 - "-DLWS_BUILD_HASH=no_hash" 37 - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" 38 - ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON"; 25 + nativeBuildInputs = [ cmake ]; 39 26 40 - postInstall = '' 41 - rm -r ${placeholder "out"}/share/libwebsockets-test-server 42 - ''; 27 + cmakeFlags = [ 28 + "-DLWS_WITH_PLUGINS=ON" 29 + "-DLWS_WITH_IPV6=ON" 30 + "-DLWS_WITH_SOCKS5=ON" 31 + "-DDISABLE_WERROR=ON" 32 + "-DLWS_BUILD_HASH=no_hash" 33 + ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" 34 + ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON"; 43 35 44 - # $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o 45 - disallowedReferences = [ stdenv.cc.cc ]; 36 + postInstall = '' 37 + rm -r ${placeholder "out"}/share/libwebsockets-test-server 38 + ''; 46 39 47 - meta = with lib; { 48 - description = "Light, portable C library for websockets"; 49 - longDescription = '' 50 - Libwebsockets is a lightweight pure C library built to 51 - use minimal CPU and memory resources, and provide fast 52 - throughput in both directions. 53 - ''; 54 - homepage = "https://libwebsockets.org/"; 55 - # Relicensed from LGPLv2.1+ to MIT with 4.0. Licensing situation 56 - # is tricky, see https://github.com/warmcat/libwebsockets/blob/main/LICENSE 57 - license = with licenses; [ mit publicDomain bsd3 asl20 ]; 58 - maintainers = with maintainers; [ mindavi ]; 59 - platforms = platforms.all; 60 - }; 61 - }; 40 + # $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o 41 + disallowedReferences = [ stdenv.cc.cc ]; 62 42 63 - in { 64 - libwebsockets_4_3 = generic { 65 - version = "4.3.2"; 66 - hash = "sha256-why8LAcc4XN0JdTJ1JoNWijKENL5mOHBsi9K4wpYr2c="; 43 + meta = with lib; { 44 + description = "Light, portable C library for websockets"; 45 + longDescription = '' 46 + Libwebsockets is a lightweight pure C library built to 47 + use minimal CPU and memory resources, and provide fast 48 + throughput in both directions. 49 + ''; 50 + homepage = "https://libwebsockets.org/"; 51 + # Relicensed from LGPLv2.1+ to MIT with 4.0. Licensing situation 52 + # is tricky, see https://github.com/warmcat/libwebsockets/blob/main/LICENSE 53 + license = with licenses; [ mit publicDomain bsd3 asl20 ]; 54 + maintainers = with maintainers; [ mindavi ]; 55 + platforms = platforms.all; 67 56 }; 68 57 } 58 +
+1 -3
pkgs/top-level/all-packages.nix
··· 8094 8094 8095 8095 librest_1_0 = callPackage ../development/libraries/librest/1.0.nix { }; 8096 8096 8097 - inherit (callPackages ../development/libraries/libwebsockets { }) 8098 - libwebsockets_4_3; 8099 - libwebsockets = libwebsockets_4_3; 8097 + libwebsockets = callPackage ../development/libraries/libwebsockets { }; 8100 8098 8101 8099 licensee = callPackage ../tools/package-management/licensee { }; 8102 8100