From a756d983d42d64d80430fe1d0e6c066adf66082d Mon Sep 17 00:00:00 2001 From: Sigmanificient Date: Mon, 18 Sep 2023 23:30:56 +0200 Subject: [PATCH] python3Packages.libclang: init at 16.0.6 --- .../python-modules/libclang-pip/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/libclang-pip/default.nix diff --git a/pkgs/development/python-modules/libclang-pip/default.nix b/pkgs/development/python-modules/libclang-pip/default.nix new file mode 100644 index 0000000000000..f2f6f535f095e --- /dev/null +++ b/pkgs/development/python-modules/libclang-pip/default.nix @@ -0,0 +1,46 @@ +{ stdenvNoCC +, lib +, buildPythonPackage +, fetchPypi +}: + +let + supported-platforms = { + x86_64-linux = "manylinux2010_x86_64"; + x86_64-darwin = "macosx_10_9_x86_64"; + aarch64-darwin = "macosx_11_0_arm64"; + aarch64-linux = "manylinux2014_aarch64"; + }; + + platform = let + os = if stdenvNoCC.isDarwin then "darwin" else "linux"; + arch = if stdenvNoCC.isAarch64 then "aarch64" else "x86_64"; + in "${arch}-${os}"; + +in buildPythonPackage rec { + # libclang is reserved by clang package + pname = "libclan-pip"; + version = "16.0.6"; + format = "wheel"; + + src = fetchPypi { + inherit version format; + + pname = "libclang"; + platform = supported-platforms.${platform}; + sha256 = { + x86_64-linux = "sha256-nc3HMJOXiLi2n/1tXXX+U2bj7gB/Hjapl5nsCwwAFJI="; + x86_64-darwin = "sha256-2p5H68PwptkPsWnvJfn7zSm0pO+XqLDj46F4AK8UI/Q="; + aarch64-darwin = "sha256-4aWtHoleVEPiBVaMhcBLRgjk6XPa5C9N/Zy0bIHRSGs="; + aarch64-linux = "sha256-gTBIISBQBHagJxcfjzyN/CU2tZFxbupx/F2iLK4TExs="; + }.${platform}; + }; + + meta = { + description = "Clang Python Bindings, mirrored from the official LLVM repo"; + homepage = "https://github.com/sighingnow/libclang"; + license = lib.licenses.asl20-llvm; + maintainers = with lib.maintainers; [ sigmanificient ]; + platforms = builtins.attrNames supported-platforms; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index cd10caec3cd38..b2dced5ddd7d4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6001,6 +6001,8 @@ self: super: with self; { inherit (pkgs) libasyncns; }; + libclang-pip = callPackage ../development/python-modules/libclang-pip { }; + libcloud = callPackage ../development/python-modules/libcloud { }; libcst = callPackage ../development/python-modules/libcst { };