mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 21:10:08 +00:00
Upstream's macOS wheel bundles ANGLE, since macOS has no EGL. Link against nixpkgs' angle there instead of libGL. Assisted-by: Claude Code (Claude Opus 5.5)
51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
angle,
|
|
buildPythonPackage,
|
|
fetchFromGitHub,
|
|
libGL,
|
|
setuptools,
|
|
stdenv,
|
|
comfyui,
|
|
}:
|
|
|
|
buildPythonPackage (finalAttrs: {
|
|
pname = "comfy-angle";
|
|
version = "0.1.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Comfy-Org";
|
|
repo = "comfy-angle";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-FnS2aQmPb5a3dO9m5McpO5Kfyy1aOaboc+oAtYqauQo=";
|
|
};
|
|
|
|
# Upstream wheels bundle ANGLE on macOS; on Linux the system libGL provides EGL
|
|
postPatch =
|
|
let
|
|
egl = if stdenv.hostPlatform.isDarwin then angle else lib.getLib libGL;
|
|
in
|
|
''
|
|
mkdir -p comfy_angle/libs
|
|
ln -s ${egl}/lib/{libEGL,libGLESv2}${stdenv.hostPlatform.extensions.sharedLibrary} comfy_angle/libs/
|
|
'';
|
|
|
|
build-system = [
|
|
setuptools
|
|
];
|
|
|
|
# Repository has no tests
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "comfy_angle" ];
|
|
|
|
meta = {
|
|
description = "Redistributable ANGLE libraries";
|
|
homepage = "https://github.com/Comfy-Org/comfy-angle";
|
|
license = lib.licenses.bsd3;
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
inherit (comfyui.meta) maintainers;
|
|
};
|
|
})
|