nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 writableTmpDirAsHomeHook,
7
8 # build-system
9 hatchling,
10
11 # dependencies
12 pytools,
13 pymbolic,
14 genpy,
15 numpy,
16 cgen,
17 islpy,
18 codepy,
19 colorama,
20 mako,
21 constantdict,
22 typing-extensions,
23
24 # optional-dependencies
25 pyopencl,
26 fparser,
27 ply,
28}:
29
30buildPythonPackage (finalAttrs: {
31 pname = "loopy";
32 version = "2025.2";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "inducer";
37 repo = "loopy";
38 tag = "v${finalAttrs.version}";
39 hash = "sha256-VgsUOMCIg61mYNDMcGpMs5I1CkobhUFVjoQFdD8Vchs=";
40 fetchSubmodules = true; # submodule at `loopy/target/c/compyte`
41 };
42
43 build-system = [ hatchling ];
44
45 nativeBuildInputs = [ writableTmpDirAsHomeHook ];
46
47 dependencies = [
48 pytools
49 pymbolic
50 genpy
51 numpy
52 cgen
53 islpy
54 codepy
55 colorama
56 mako
57 constantdict
58 typing-extensions
59 ];
60
61 optional-dependencies = {
62 pyopencl = [
63 pyopencl
64 ];
65 fortran = [
66 fparser
67 ply
68 ];
69 };
70
71 pythonImportsCheck = [ "loopy" ];
72
73 # pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR
74 doCheck = false;
75
76 meta = {
77 description = "Code generator for array-based code on CPUs and GPUs";
78 homepage = "https://github.com/inducer/loopy";
79 changelog = "https://github.com/inducer/loopy/releases/tag/${finalAttrs.src.tag}";
80 license = lib.licenses.mit;
81 maintainers = with lib.maintainers; [ tomasajt ];
82 };
83})