diff options
Diffstat (limited to 'pkgs/development')
8 files changed, 301 insertions, 11 deletions
diff --git a/pkgs/development/libraries/libpulsar/default.nix b/pkgs/development/libraries/libpulsar/default.nix new file mode 100644 index 0000000000000..9abe322412072 --- /dev/null +++ b/pkgs/development/libraries/libpulsar/default.nix @@ -0,0 +1,102 @@ +{ lib +, clang-tools +, llvmPackages +, boost17x +, protobuf +, python3Support ? false +, python3 +, log4cxxSupport ? false +, log4cxx +, snappySupport ? false +, snappy +, zlibSupport ? true +, zlib +, zstdSupport ? true +, zstd +, gtest +, gtestSupport ? false +, cmake +, curl +, fetchurl +, jsoncpp +, openssl +, pkg-config +, stdenv +}: + +let + /* + Check if null or false + Example: + let result = enableFeature null + => "OFF" + let result = enableFeature false + => "OFF" + let result = enableFeature «derivation» + => "ON" + */ + enableCmakeFeature = p: if (p == null || p == false) then "OFF" else "ON"; + + # Not really sure why I need to do this.. If I call clang-tools without the override it defaults to a different version and fails + clangTools = clang-tools.override { inherit stdenv llvmPackages; }; + # If boost has python enabled, then boost-python package will be installed which is used by libpulsars python wrapper + boost = if python3Support then boost17x.override { inherit stdenv; enablePython = python3Support; python = python3; } else boost17x; + defaultOptionals = [ boost protobuf ] + ++ lib.optional python3Support python3 + ++ lib.optional snappySupport snappy.dev + ++ lib.optional zlibSupport zlib + ++ lib.optional zstdSupport zstd + ++ lib.optional log4cxxSupport log4cxx; + +in +stdenv.mkDerivation rec { + pname = "libpulsar"; + version = "2.9.1"; + + src = fetchurl { + hash = "sha512-NKHiL7D/Lmnn6ICpQyUmmQYQETz4nZPJU9/4LMRDUQ3Pck6qDh+t6CRk+b9UQ2Vb0jvPIGTjEsSp2nC7TJk3ug=="; + url = "mirror://apache/pulsar/pulsar-${version}/apache-pulsar-${version}-src.tar.gz"; + }; + + sourceRoot = "apache-pulsar-${version}-src/pulsar-client-cpp"; + + # clang-tools needed for clang-format + nativeBuildInputs = [ cmake pkg-config clangTools ] + ++ defaultOptionals + ++ lib.optional gtestSupport gtest.dev; + + buildInputs = [ jsoncpp openssl curl ] + ++ defaultOptionals; + + # Needed for GCC on Linux + NIX_CFLAGS_COMPILE = [ "-Wno-error=return-type" ]; + + cmakeFlags = [ + "-DBUILD_TESTS=${enableCmakeFeature gtestSupport}" + "-DBUILD_PYTHON_WRAPPER=${enableCmakeFeature python3Support}" + "-DUSE_LOG4CXX=${enableCmakeFeature log4cxxSupport}" + "-DClangTools_PATH=${clangTools}/bin" + ]; + + enableParallelBuilding = true; + doInstallCheck = true; + installCheckPhase = '' + echo ${lib.escapeShellArg '' + #include <pulsar/Client.h> + int main (int argc, char **argv) { + pulsar::Client client("pulsar://localhost:6650"); + return 0; + } + ''} > test.cc + $CXX test.cc -L $out/lib -I $out/include -lpulsar -o test + ''; + + meta = with lib; { + homepage = "https://pulsar.apache.org/docs/en/client-libraries-cpp"; + description = "Apache Pulsar C++ library"; + + platforms = platforms.all; + license = licenses.asl20; + maintainers = [ maintainers.corbanr ]; + }; +} diff --git a/pkgs/development/libraries/mimalloc/default.nix b/pkgs/development/libraries/mimalloc/default.nix index 1e9e44e09973a..22d4567c562dd 100644 --- a/pkgs/development/libraries/mimalloc/default.nix +++ b/pkgs/development/libraries/mimalloc/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchFromGitHub, cmake, ninja +, fetchpatch , secureBuild ? false }: @@ -7,14 +8,28 @@ let in stdenv.mkDerivation rec { pname = "mimalloc"; - version = "2.0.2"; + version = "2.0.5"; src = fetchFromGitHub { owner = "microsoft"; repo = pname; rev = "v${version}"; - sha256 = "sha256-n4FGld3bq6ZOSLTzXcVlucCGbQ5/eSFbijU0dfBD/T0="; + sha256 = "sha256-q3W/w1Ofqt6EbKF/Jf9wcC+7jAxh59B3cOGxudWQXlA="; }; + patches = [ + (fetchpatch { + name = "older-macos-fixes.patch"; + url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch"; + sha256 = "15qx2a3axhhwbfzxdis98b8j14y9cfgca0i484aj2pjpqnm0pb8c"; + }) + ]; + + doCheck = true; + preCheck = let + ldLibraryPathEnv = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH"; + in '' + export ${ldLibraryPathEnv}="$(pwd)/build:''${${ldLibraryPathEnv}}" + ''; nativeBuildInputs = [ cmake ninja ]; cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ]; @@ -25,10 +40,9 @@ stdenv.mkDerivation rec { in '' # first, move headers and cmake files, that's easy mkdir -p $dev/lib - mv $out/include $dev/include - mv $out/cmake $dev/lib/ + mv $out/lib/cmake $dev/lib/ - find $out/lib + find $dev $out -type f '' + (lib.optionalString secureBuild '' # pretend we're normal mimalloc ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${suffix} @@ -44,6 +58,6 @@ stdenv.mkDerivation rec { homepage = "https://github.com/microsoft/mimalloc"; license = licenses.bsd2; platforms = platforms.unix; - maintainers = with maintainers; [ thoughtpolice ]; + maintainers = with maintainers; [ kamadorueda thoughtpolice ]; }; } diff --git a/pkgs/development/python-modules/fleep/0001-Fixing-paths-on-tests.patch b/pkgs/development/python-modules/fleep/0001-Fixing-paths-on-tests.patch new file mode 100644 index 0000000000000..234bf0cb379b5 --- /dev/null +++ b/pkgs/development/python-modules/fleep/0001-Fixing-paths-on-tests.patch @@ -0,0 +1,48 @@ +From 716fcfa3203bc881b543916bdb9a17460951cd26 Mon Sep 17 00:00:00 2001 +From: "P. R. d. O" <d.ol.rod@protonmail.com> +Date: Fri, 26 Nov 2021 07:13:32 -0600 +Subject: [PATCH] Fixing paths on tests + +--- + tests/maintest.py | 7 ++++++- + tests/speedtest.py | 7 ++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/tests/maintest.py b/tests/maintest.py +index 0e24ca4..3484437 100644 +--- a/tests/maintest.py ++++ b/tests/maintest.py +@@ -1,6 +1,11 @@ + import fleep ++import os + +-with open("testfile", "rb") as file: ++current_dir = os.path.realpath(os.path.join(os.getcwd(), ++ os.path.dirname(__file__))) ++ ++with open(os.path.join(current_dir, "./testfile"), ++ "rb") as file: + info = fleep.get(file.read(128)) + + assert info.type == ["raster-image"] +diff --git a/tests/speedtest.py b/tests/speedtest.py +index 89338ab..829d563 100644 +--- a/tests/speedtest.py ++++ b/tests/speedtest.py +@@ -1,7 +1,12 @@ + import time + import fleep ++import os + +-with open("testfile", "rb") as file: ++current_dir = os.path.realpath(os.path.join(os.getcwd(), ++ os.path.dirname(__file__))) ++ ++with open(os.path.join(current_dir, "./testfile"), ++ "rb") as file: + stream = file.read(128) + + times = [] +-- +2.33.1 + diff --git a/pkgs/development/python-modules/fleep/default.nix b/pkgs/development/python-modules/fleep/default.nix new file mode 100644 index 0000000000000..04b607325136e --- /dev/null +++ b/pkgs/development/python-modules/fleep/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, python +}: + +buildPythonPackage rec { + pname = "fleep"; + version = "1.0.1"; + + # Pypi version does not have tests + src = fetchFromGitHub { + owner = "floyernick"; + repo = "fleep-py"; + rev = "994bc2c274482d80ab13d89d8f7343eb316d3e44"; + sha256 = "sha256-TaU7njx98nxkhZawGMFqWj4g+yCtIX9aPWQHoamzfMY="; + }; + + patches = [ + ./0001-Fixing-paths-on-tests.patch + ]; + + checkPhase = '' + ${python.interpreter} tests/maintest.py + ${python.interpreter} tests/speedtest.py + ''; + + pythonImportsCheck = [ "fleep" ]; + + meta = with lib; { + description = "File format determination library"; + homepage = "https://github.com/floyernick/fleep-py"; + license = licenses.mit; + maintainers = with maintainers; [ wolfangaukang ]; + }; +} diff --git a/pkgs/development/python-modules/graphql-subscription-manager/default.nix b/pkgs/development/python-modules/graphql-subscription-manager/default.nix index db3aea752b709..afcbe157a1e24 100644 --- a/pkgs/development/python-modules/graphql-subscription-manager/default.nix +++ b/pkgs/development/python-modules/graphql-subscription-manager/default.nix @@ -8,7 +8,7 @@ buildPythonPackage rec { pname = "graphql-subscription-manager"; - version = "0.5.0"; + version = "0.5.1"; disabled = pythonOlder "3.7"; @@ -16,7 +16,7 @@ buildPythonPackage rec { owner = "Danielhiversen"; repo = "PyGraphqlWebsocketManager"; rev = version; - sha256 = "sha256-18GR0OZeEh6EQT0kKCJyq7ckvKYKDJn/lugN5xlRg64="; + sha256 = "sha256-PVQa6JmBnToXuL/wNkYO0b+K1e9yrQgRUzWNUbFN5mM="; }; propagatedBuildInputs = [ diff --git a/pkgs/development/python-modules/nextcord/default.nix b/pkgs/development/python-modules/nextcord/default.nix new file mode 100644 index 0000000000000..345a77239bf4b --- /dev/null +++ b/pkgs/development/python-modules/nextcord/default.nix @@ -0,0 +1,64 @@ +{ lib +, stdenv +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, substituteAll +, ffmpeg +, libopus +, aiohttp +, aiodns +, brotli +, cchardet +, orjson +, pynacl +}: + +buildPythonPackage rec { + pname = "nextcord"; + version = "2.0.0a8"; + + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "nextcord"; + repo = "nextcord"; + rev = version; + hash = "sha256-aYFY58zWZlZwW3xwa1iAK4w29AofKIkTyCjQ2nR8JrY="; + }; + + patches = [ + (substituteAll { + src = ./paths.patch; + ffmpeg = "${ffmpeg}/bin/ffmpeg"; + libopus = "${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}"; + }) + ]; + + propagatedBuildInputs = [ + aiodns + aiohttp + brotli + cchardet + orjson + pynacl + ]; + + # upstream has no tests + doCheck = false; + + pythonImportsCheck = [ + "nextcord" + "nextcord.ext.commands" + "nextcord.ext.tasks" + ]; + + meta = with lib; { + description = "Python wrapper for the Discord API forked from discord.py"; + homepage = "https://github.com/nextcord/nextcord"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/python-modules/nextcord/paths.patch b/pkgs/development/python-modules/nextcord/paths.patch new file mode 100644 index 0000000000000..389637a18878c --- /dev/null +++ b/pkgs/development/python-modules/nextcord/paths.patch @@ -0,0 +1,26 @@ +diff --git a/nextcord/opus.py b/nextcord/opus.py +index 97d437a3..755e1a5c 100644 +--- a/nextcord/opus.py ++++ b/nextcord/opus.py +@@ -213,7 +213,7 @@ def _load_default() -> bool: + _filename = os.path.join(_basedir, 'bin', f'libopus-0.{_target}.dll') + _lib = libopus_loader(_filename) + else: +- _lib = libopus_loader(ctypes.util.find_library('opus')) ++ _lib = libopus_loader('@libopus@') + except Exception: + _lib = None + +diff --git a/nextcord/player.py b/nextcord/player.py +index bedefc5a..34de0459 100644 +--- a/nextcord/player.py ++++ b/nextcord/player.py +@@ -140,7 +140,7 @@ class FFmpegAudio(AudioSource): + .. versionadded:: 1.3 + """ + +- def __init__(self, source: Union[str, io.BufferedIOBase], *, executable: str = 'ffmpeg', args: Any, **subprocess_kwargs: Any): ++ def __init__(self, source: Union[str, io.BufferedIOBase], *, executable: str = '@ffmpeg@', args: Any, **subprocess_kwargs: Any): + piping = subprocess_kwargs.get('stdin') == subprocess.PIPE + if piping and isinstance(source, str): + raise TypeError("parameter conflict: 'source' parameter cannot be a string when piping to stdin") diff --git a/pkgs/development/tools/build-managers/leiningen/default.nix b/pkgs/development/tools/build-managers/leiningen/default.nix index 7dfb6c9b2ad5d..80919cfc377fb 100644 --- a/pkgs/development/tools/build-managers/leiningen/default.nix +++ b/pkgs/development/tools/build-managers/leiningen/default.nix @@ -3,16 +3,16 @@ stdenv.mkDerivation rec { pname = "leiningen"; - version = "2.9.7"; + version = "2.9.8"; src = fetchurl { url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg"; - sha256 = "sha256-948g0ZMfAoJw53vA8MAKWg76Tst6VnYwSjSuT0aeKB0="; + sha256 = "1sgnxw58srjxqnskl700p7r7n23pfpjvqpiqnz1m8r6c76jwnllr"; }; jarsrc = fetchurl { url = "https://github.com/technomancy/leiningen/releases/download/${version}/${pname}-${version}-standalone.jar"; - sha256 = "sha256-gvAUFKzs3bsOvW1XFQW7Zxpv0JMja82sJGjP5fLqqAI="; + sha256 = "13f4n15i0gsk9jq52gxivnsk32qjahmxgrddm54cf8ynw0a923ia"; }; JARNAME = "${pname}-${version}-standalone.jar"; |