Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions pkgs/development/python-modules/libclang-pip/default.nix
Original file line number Diff line number Diff line change
@@ -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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pname = "libclan-pip";
pname = "libclang-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;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down