-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
default.nix
4425 lines (3949 loc) · 166 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
}:
let
addBuildSystem' =
{ final
, drv
, attr
, extraAttrs ? [ ]
}:
let
buildSystem =
if builtins.isAttrs attr then
let
fromIsValid =
if builtins.hasAttr "from" attr then
lib.versionAtLeast drv.version attr.from
else
true;
untilIsValid =
if builtins.hasAttr "until" attr then
lib.versionOlder drv.version attr.until
else
true;
intendedBuildSystem =
if lib.elem attr.buildSystem [ "cython" "cython_0" ] then
(final.python.pythonOnBuildForHost or final.python.pythonForBuild).pkgs.${attr.buildSystem}
else
final.${attr.buildSystem};
in
if fromIsValid && untilIsValid then intendedBuildSystem else null
else
if lib.elem attr [ "cython" "cython_0" ] then
(final.python.pythonOnBuildForHost or final.python.pythonForBuild).pkgs.${attr}
else
final.${attr};
in
if (attr == "flit-core" || attr == "flit" || attr == "hatchling") && !final.isPy3k then drv
else if drv == null then null
else if !drv ? overridePythonAttrs then drv
else
drv.overridePythonAttrs (
old:
# We do not need the build system for wheels.
if old ? format && old.format == "wheel" then
{ }
else if attr == "poetry" then
{
# replace poetry
postPatch = (old.postPatch or "") + ''
if [ -f pyproject.toml ]; then
toml="$(mktemp)"
yj -tj < pyproject.toml | jq --from-file ${./poetry-to-poetry-core.jq} | yj -jt > "$toml"
mv "$toml" pyproject.toml
fi
'';
nativeBuildInputs = old.nativeBuildInputs or [ ]
++ [ final.poetry-core final.pkgs.yj final.pkgs.jq ]
++ map (a: final.${a}) extraAttrs;
}
else
{
nativeBuildInputs =
old.nativeBuildInputs or [ ]
++ lib.optionals (!(builtins.isNull buildSystem)) [ buildSystem ]
++ map (a: final.${a}) extraAttrs;
}
);
notNull = x: !(builtins.isNull x);
sharedLibExt = pkgs.stdenv.hostPlatform.extensions.sharedLibrary;
removePackagesByName = packages: packagesToRemove:
let
namesToRemove = map lib.getName (lib.filter notNull packagesToRemove);
in
lib.filter (x: !(builtins.elem (lib.getName x) namesToRemove)) packages;
in
lib.composeManyExtensions [
# NixOps
(final: prev:
lib.mapAttrs (_: v: addBuildSystem' { inherit final; drv = v; attr = "poetry"; }) (lib.filterAttrs (n: _: lib.strings.hasPrefix "nixops" n) prev)
// {
# NixOps >=2 dependency
nixos-modules-contrib = addBuildSystem' { inherit final; drv = prev.nixos-modules-contrib; attr = "poetry"; };
}
)
# Add build systems
(final: prev:
let
buildSystems = lib.importJSON ./build-systems.json;
in
lib.mapAttrs
(attr: systems: builtins.foldl'
(drv: attr: addBuildSystem' {
inherit drv final attr;
})
(prev.${attr} or null)
systems)
buildSystems)
# Build fixes
(final: prev:
let
inherit (final.python) stdenv;
inherit (pkgs.buildPackages) pkg-config cmake swig jdk gfortran meson ninja autoconf automake libtool;
pyBuildPackages = (final.python.pythonOnBuildForHost or final.python.pythonForBuild).pkgs;
selectQt5 = version:
let
selector = builtins.concatStringsSep "" (lib.take 2 (builtins.splitVersion version));
in
pkgs."qt${selector}" or pkgs.qt5;
pyQt5Modules = qt5: with qt5; [
qt3d
qtbase
qtcharts
qtconnectivity
qtdatavis3d
qtdeclarative
qtgamepad
qtlocation
qtmultimedia
qtsensors
qtserialport
qtsvg
qtwebchannel
qtwebengine
qtwebsockets
qtx11extras
qtxmlpatterns
];
bootstrappingBase = (pkgs.${final.python.pythonAttr}.pythonOnBuildForHost or pkgs.${final.python.pythonAttr}.pythonForBuild).pkgs;
# Build gdal without python bindings to prevent version mixing
# We're only interested in the native libraries, not the python ones
# as we build that separately.
gdal = (pkgs.gdal.override { useJava = false; }).overrideAttrs (old: {
doInstallCheck = false;
doCheck = false;
cmakeFlags = old.cmakeFlags or [ ] ++ [ "-DBUILD_PYTHON_BINDINGS=OFF" ];
});
tensorflowAttrs = {
postInstall = ''
rm $out/bin/tensorboard
'';
};
in
{
addBuildSystem = attr: drv: addBuildSystem' { inherit final drv attr; };
#### BEGIN bootstrapping pkgs
installer = bootstrappingBase.installer.override {
inherit (final) buildPythonPackage flit-core;
};
build = bootstrappingBase.build.override {
inherit (final) buildPythonPackage flit-core packaging pyproject-hooks tomli;
};
flit-core = bootstrappingBase.flit-core.override {
inherit (final) buildPythonPackage flit;
};
packaging = bootstrappingBase.packaging.override {
inherit (final) buildPythonPackage flit-core;
};
tomli = bootstrappingBase.tomli.override {
inherit (final) buildPythonPackage flit-core;
};
pyproject-hooks = bootstrappingBase.pyproject-hooks.override {
inherit (final) buildPythonPackage flit-core tomli;
};
wheel = bootstrappingBase.wheel.override {
inherit (final) buildPythonPackage flit-core;
};
inherit (bootstrappingBase) cython cython_0;
#### END bootstrapping pkgs
poetry = final.poetry-core;
automat = prev.automat.overridePythonAttrs (
old: lib.optionalAttrs (lib.versionOlder old.version "22.10.0") {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.m2r ];
}
);
aiokafka = prev.aiokafka.overridePythonAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.zlib ];
});
aiohttp-swagger3 = prev.aiohttp-swagger3.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
}
);
ansible = prev.ansible.overridePythonAttrs (
old: {
# Inputs copied from nixpkgs as ansible doesn't specify it's dependencies
# in a correct manner.
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [
final.pycrypto
final.paramiko
final.jinja2
final.pyyaml
final.httplib2
final.six
final.netaddr
final.dnspython
final.jmespath
final.dopy
final.ncclient
];
}
);
ansible-base = prev.ansible-base.overridePythonAttrs (
old:
{
prePatch = ''sed -i "s/\[python, /[/" lib/ansible/executor/task_executor.py'';
postInstall = ''
for m in docs/man/man1/*; do
install -vD $m -t $out/share/man/man1
done
'';
}
// lib.optionalAttrs (lib.versionOlder old.version "2.4") {
prePatch = ''sed -i "s,/usr/,$out," lib/ansible/constants.py'';
}
);
ansible-lint = prev.ansible-lint.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.setuptools-scm ];
preBuild = ''
export HOME=$(mktemp -d)
'';
}
);
argcomplete = prev.argcomplete.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.importlib-metadata ];
}
);
arpeggio = prev.arpeggio.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
}
);
astroid = prev.astroid.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
}
);
av = prev.av.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.ffmpeg_4 ];
}
);
apache-flink-libraries = prev.apache-flink-libraries.overridePythonAttrs (_old: {
# apache-flink and apache-flink-libraries both install version.py into the
# pyflink output derivation, which is invalid: whichever gets installed
# last will be used
postInstall = ''
rm $out/${final.python.sitePackages}/pyflink/{README.txt,version.py,__pycache__/version.*.pyc}
'';
});
apsw = prev.apsw.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
# without this patch a download of sqlite is attempted
substituteInPlace setup.py --replace-warn 'if self.fetch:' 'if False:'
'';
buildInputs = old.buildInputs or [ ] ++ [ pkgs.sqlite ];
}
);
autoawq-kernels = prev.autoawq-kernels.overridePythonAttrs (_attrs: {
autoPatchelfIgnoreMissingDeps = true;
});
avro-python3 = prev.avro-python3.overridePythonAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs or [ ]
++ [ final.isort final.pycodestyle ];
});
aws-cdk-asset-node-proxy-agent-v6 = prev.aws-cdk-asset-node-proxy-agent-v6.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn 'setuptools~=67.3.2' 'setuptools'
'';
}
);
aws-cdk-asset-awscli-v1 = prev.aws-cdk-asset-awscli-v1.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn 'setuptools~=67.3.2' 'setuptools'
'';
}
);
aws-cdk-asset-kubectl-v20 = prev.aws-cdk-asset-kubectl-v20.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn 'setuptools~=62.1.0' 'setuptools' \
--replace-warn 'wheel~=0.37.1' 'wheel'
'';
}
);
aws-cdk-lib = prev.aws-cdk-lib.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn 'setuptools~=67.3.2' 'setuptools'
'';
}
);
awscrt = prev.awscrt.overridePythonAttrs (
old: {
nativeBuildInputs = [ cmake ] ++ old.nativeBuildInputs or [ ];
dontUseCmakeConfigure = true;
}
);
awsume = prev.awsume.overridePythonAttrs (_: {
preBuild = ''
HOME="$(mktemp -d)"
export HOME
'';
});
bcrypt =
let
getCargoHash = version: {
"4.0.0" = "sha256-HvfRLyUhlXVuvxWrtSDKx3rMKJbjvuiMcDY6g+pYFS0=";
"4.0.1" = "sha256-lDWX69YENZFMu7pyBmavUZaalGvFqbHSHfkwkzmDQaY=";
"4.1.1" = "sha256-QYg1+DsZEdXB74vuS4SFvV0n5GXkuwHkOS9j1ogSTjA=";
"4.1.2" = "sha256-fTD1AKvyeni5ukYjK53gueKLey+rcIUjW/0R289xeb0=";
"4.1.3" = "sha256-Uag1pUuis5lpnus2p5UrMLa4HP7VQLhKxR5TEMfpK0s=";
"4.2.0" = "sha256-dOS9A3pTwXYkzPFFNh5emxJw7pSdDyY+mNIoHdwNdmg=";
}.${version} or (
lib.warn "Unknown bcrypt version: '${version}'. Please update getCargoHash." lib.fakeHash
);
in
prev.bcrypt.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ]
++ [ pkgs.libffi ]
++ lib.optionals (lib.versionAtLeast old.version "4" && stdenv.isDarwin)
[ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ];
nativeBuildInputs = with pkgs;
old.nativeBuildInputs or [ ]
++ lib.optionals (lib.versionAtLeast old.version "4") [ rustc cargo pkgs.rustPlatform.cargoSetupHook final.setuptools-rust ];
} // lib.optionalAttrs (lib.versionAtLeast old.version "4") {
cargoDeps =
pkgs.rustPlatform.fetchCargoTarball
{
inherit (old) src;
sourceRoot = "${old.pname}-${old.version}/src/_bcrypt";
name = "${old.pname}-${old.version}";
sha256 = getCargoHash old.version;
};
cargoRoot = "src/_bcrypt";
}
);
bjoern = prev.bjoern.overridePythonAttrs (
old: {
buildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.libev ];
}
);
borgbackup = prev.borgbackup.overridePythonAttrs (
old: {
BORG_OPENSSL_PREFIX = pkgs.openssl.dev;
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.openssl pkgs.acl ];
}
);
bitsandbytes = prev.bitsandbytes.overridePythonAttrs (_attrs: {
autoPatchelfIgnoreMissingDeps = true;
});
cairocffi = prev.cairocffi.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
# apply necessary patches in postInstall if the source is a wheel
postInstall = lib.optionalString (old.src.isWheel or false) ''
pushd "$out/${final.python.sitePackages}"
for patch in ${lib.concatMapStringsSep " " (p: "${p}") pkgs.python3.pkgs.cairocffi.patches}; do
patch -p1 < "$patch"
done
popd
'';
} // lib.optionalAttrs (!(old.src.isWheel or false)) {
inherit (pkgs.python3.pkgs.cairocffi) patches;
}
);
cairosvg = prev.cairosvg.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
}
);
cattrs = prev.cattrs.overridePythonAttrs (
old: lib.optionalAttrs (old.version == "1.10.0") {
# 1.10.0 contains a pyproject.toml that requires a pre-release Poetry
# We can avoid using Poetry and use the generated setup.py
preConfigure = old.preConfigure or "" + ''
rm pyproject.toml
'';
}
);
ccxt = prev.ccxt.overridePythonAttrs (_old: {
preBuild = ''
ln -s README.{rst,md}
'';
});
cdk-nag = prev.cdk-nag.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn 'setuptools~=67.3.2' 'setuptools'
'';
}
);
celery = prev.celery.overridePythonAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
});
cerberus = prev.cerberus.overridePythonAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
});
constructs = prev.constructs.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-warn 'setuptools~=67.3.2' 'setuptools'
'';
}
);
cssselect2 = prev.cssselect2.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
}
);
cffi =
# cffi is bundled with pypy
if final.python.implementation == "pypy" then null else
(
prev.cffi.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.libffi ];
prePatch = (old.prePatch or "") + lib.optionalString (!(old.src.isWheel or false) && stdenv.isDarwin) ''
# Remove setup.py impurities
substituteInPlace setup.py --replace-warn "'-iwithsysroot/usr/include/ffi'" ""
substituteInPlace setup.py --replace-warn "'/usr/include/ffi'," ""
substituteInPlace setup.py --replace-warn '/usr/include/libffi' '${lib.getDev pkgs.libffi}/include'
'';
}
)
);
cmdstanpy = prev.cmdstanpy.overridePythonAttrs (
old:
let
fixupScriptText = ''
substituteInPlace cmdstanpy/model.py \
--replace-warn 'cmd = [make]' \
'cmd = ["${pkgs.cmdstan}/bin/stan"]'
'';
isWheel = old.src.isWheel or false;
in
{
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ pkgs.cmdstan ];
patchPhase = lib.optionalString (!isWheel) fixupScriptText;
postFixup = lib.optionalString isWheel ''
cd $out/${final.python.sitePackages}
${fixupScriptText}
'';
CMDSTAN = "${pkgs.cmdstan}";
}
);
contourpy = prev.contourpy.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
dontUseMesonConfigure = true;
postPatch = ''
substituteInPlace pyproject.toml --replace-warn 'meson[ninja]' 'meson'
'';
}
);
clarabel = prev.dbt-extractor.overridePythonAttrs
(
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.cargo pkgs.rustc pkgs.maturin ];
}
);
cloudflare = prev.cloudflare.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
postPatch = ''
rm -rf examples/*
'';
}
);
colour = prev.colour.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) {
patches = old.patches or [ ] ++ [
(pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/NixOS/nixpkgs/485bbe58365f3c44a42f87b8cec2385b88380d74/pkgs/development/python-modules/colour/remove-unmaintained-d2to1.diff";
hash = "sha256-Bj01qQlBd2oydv0afLV2Puqquuo3bnOOyDp7FR8cQnA=";
})
];
}
);
coincurve = prev.coincurve.overridePythonAttrs (
_old: {
# package setup logic
LIB_DIR = "${lib.getLib pkgs.secp256k1}/lib";
# for actual C toolchain build
NIX_CFLAGS_COMPILE = "-I ${lib.getDev pkgs.secp256k1}/include";
NIX_LDFLAGS = "-L ${lib.getLib pkgs.secp256k1}/lib";
}
);
configparser = prev.configparser.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [
final.toml
];
}
);
confluent-kafka = prev.confluent-kafka.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [
pkgs.rdkafka
];
}
);
copier = prev.copier.overrideAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ pkgs.git ];
});
cryptography =
let
getCargoHash = version: {
"35.0.0" = "sha256-tQoQfo+TAoqAea86YFxyj/LNQCiViu5ij/3wj7ZnYLI=";
"36.0.0" = "sha256-Y6TuW7AryVgSvZ6G8WNoDIvi+0tvx8ZlEYF5qB0jfNk=";
"36.0.1" = "sha256-kozYXkqt1Wpqyo9GYCwN08J+zV92ZWFJY/f+rulxmeQ=";
"36.0.2" = "1a0ni1a3dbv2dvh6gx2i54z8v5j9m6asqg97kkv7gqb1ivihsbp8";
"37.0.2" = "sha256-qvrxvneoBXjP96AnUPyrtfmCnZo+IriHR5HbtWQ5Gk8=";
"37.0.4" = "sha256-f8r6QclTwkgK20CNe9i65ZOqvSUeDc4Emv6BFBhh1hI";
"38.0.1" = "sha256-o8l13fnfEUvUdDasq3LxSPArozRHKVsZfQg9DNR6M6Q=";
"38.0.3" = "sha256-lzHLW1N4hZj+nn08NZiPVM/X+SEcIsuZDjEOy0OOkSc=";
"38.0.4" = "sha256-BN0kOblUwgHj5QBf52RY2Jx0nBn03lwoN1O5PEohbwY=";
"39.0.0" = "sha256-clorC0NtGukpE3DnZ84MSdGhJN+qC89DZPITZFuL01Q=";
"39.0.2" = "sha256-Admz48/GS2t8diz611Ciin1HKQEyMDEwHxTpJ5tZ1ZA=";
"40.0.0" = "sha256-/TBANavYria9YrBpMgjtFyqg5feBcloETcYJ8fdBgkI=";
"40.0.1" = "sha256-gFfDTc2QWBWHBCycVH1dYlCsWQMVcRZfOBIau+njtDU=";
"40.0.2" = "sha256-cV4GTfbVYanElXOVmynvrru2wJuWvnT1Z1tQKXdkbg0=";
"41.0.1" = "sha256-38q81vRf8QHR8lFRM2KbH7Ng5nY7nmtWRMoPWS9VO/U=";
"41.0.2" = "sha256-hkuoICa/suMXlr4u95JbMlFzi27lJqJRmWnX3nZfzKU=";
"41.0.3" = "sha256-LQu7waympGUs+CZun2yDQd2gUUAgyisKBG5mddrfSo0=";
"41.0.4" = "sha256-oXR8yBUgiA9BOfkZKBJneKWlpwHB71t/74b/5WpiKmw=";
"41.0.5" = "sha256-ABCK144//RUJ3AksFHEgqC+kHvoHl1ifpVuqMTkGNH8=";
"41.0.6" = "sha256-E7O0035BnJfTQeZNAN3Oz0fMbfj45htvnK8AHOzfdcY=";
"41.0.7" = "sha256-VeZhKisCPDRvmSjGNwCgJJeVj65BZ0Ge+yvXbZw86Rw=";
"42.0.1" = "sha256-Kq/TSoI1cm9Pwg5CulNlAADmxdq0oWbgymHeMErUtcE=";
"42.0.2" = "sha256-jw/FC5rQO77h6omtBp0Nc2oitkVbNElbkBUduyprTIc=";
"42.0.3" = "sha256-QBZLGXdQz2WIBlAJM+yBk1QgmfF4b3G0Y1I5lZmAmtU=";
"42.0.4" = "sha256-qaXQiF1xZvv4sNIiR2cb5TfD7oNiYdvUwcm37nh2P2M=";
"42.0.5" = "sha256-Pw3ftpcDMfZr/w6US5fnnyPVsFSB9+BuIKazDocYjTU=";
"42.0.6" = "sha256-q1nCn82wVfADPMYX2LCq7CpIIbMvFkqsXRYfhzGyvSg=";
"42.0.7" = "sha256-wAup/0sI8gYVsxr/vtcA+tNkBT8wxmp68FPbOuro1E4=";
"42.0.8" = "sha256-PgxPcFocEhnQyrsNtCN8YHiMptBmk1PUhEDQFdUR1nU=";
"43.0.0" = "sha256-TEQy8PrIaZshiBFTqR/OJp3e/bVM1USjcmpDYcjPJPM=";
"43.0.1" = "sha256-wiAHM0ucR1X7GunZX8V0Jk2Hsi+dVdGgDKqcYjSdD7Q=";
"43.0.3" = "sha256-d3Gt4VrBWk6qowwX0Epp4mc1PbySARVU9YMsHYKImCs=";
}.${version} or (
lib.warn "Unknown cryptography version: '${version}'. Please update getCargoHash." lib.fakeHash
);
sha256 = getCargoHash prev.cryptography.version;
isWheel = lib.hasSuffix ".whl" prev.cryptography.src;
scrypto =
if isWheel then
(
prev.cryptography.overridePythonAttrs { preferWheel = true; }
) else prev.cryptography;
in
scrypto.overridePythonAttrs
(
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ]
++ lib.optionals (lib.versionAtLeast old.version "3.4") [ final.setuptools-rust ]
++ lib.optionals (!final.isPyPy) [ pyBuildPackages.cffi ]
++ lib.optionals (lib.versionAtLeast old.version "3.5" && !isWheel) [ pkgs.rustPlatform.cargoSetupHook pkgs.cargo pkgs.rustc ]
++ lib.optionals (lib.versionAtLeast old.version "43" && !isWheel) [ pkgs.rustPlatform.maturinBuildHook ]
++ [ pkg-config ]
;
buildInputs = old.buildInputs or [ ]
++ [ pkgs.libxcrypt ]
++ [ (if lib.versionAtLeast old.version "37" then pkgs.openssl_3 else pkgs.openssl_1_1) ]
++ lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ];
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.cffi ];
} // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") {
CRYPTOGRAPHY_DONT_BUILD_RUST = "1";
} // lib.optionalAttrs (lib.versionAtLeast old.version "3.5" && !isWheel) rec {
cargoDeps =
pkgs.rustPlatform.fetchCargoTarball {
inherit (old) src;
sourceRoot = "${old.pname}-${old.version}/${cargoRoot}";
name = "${old.pname}-${old.version}";
inherit sha256;
};
cargoRoot = "src/rust";
}
);
cupy-cuda12x = prev.cupy-cuda12x.overridePythonAttrs (_attrs: {
autoPatchelfIgnoreMissingDeps = true;
});
cyclonedx-python-lib = prev.cyclonedx-python-lib.overridePythonAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
postPatch = ''
if [ -f setup.py ]; then
substituteInPlace setup.py --replace-warn 'setuptools>=50.3.2,<51.0.0' 'setuptools'
fi
'';
});
cysystemd = prev.cysystemd.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ [ pkgs.systemd ];
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
});
daphne = prev.daphne.overridePythonAttrs (_old: {
postPatch = ''
# sometimes setup.py doesn't exist
if [ -f setup.py ]; then
substituteInPlace setup.py --replace-warn 'setup_requires=["pytest-runner"],' ""
fi
'';
});
darts = prev.darts.override {
preferWheel = true;
};
dask = prev.dask.overridePythonAttrs (
old: {
propagatedBuildInputs = removePackagesByName
old.propagatedBuildInputs or [ ]
(
# dask[dataframe] depends on dask-expr, which depends on dask, resulting in infinite recursion
lib.optionals (final ? dask-expr) [ final.dask-expr ] ++
# dask[dataframe] depends on distributed, which depends on dask, resulting in infinite recursion
lib.optionals (final ? distributed) [ final.distributed ]
);
}
);
datadog-lambda = prev.datadog-lambda.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace setup.py --replace-warn "setuptools==" "setuptools>="
'';
buildInputs = old.buildInputs or [ ] ++ [ final.setuptools ];
});
databricks-connect = prev.databricks-connect.overridePythonAttrs (_old: {
sourceRoot = ".";
});
dbt-extractor = prev.dbt-extractor.overridePythonAttrs
(
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.cargo pkgs.rustc pkgs.maturin ];
}
);
dbus-python = prev.dbus-python.overridePythonAttrs (old: {
outputs = [ "out" "dev" ];
nativeBuildInputs = old.nativeBuildInputs or [ ]
++ lib.optionals (lib.versionAtLeast old.version "1.3") [ pkgs.dbus ];
} // lib.optionalAttrs (lib.versionOlder old.version "1.3") {
postPatch = old.postPatch or "" + ''
substituteInPlace ./configure --replace-warn /usr/bin/file ${pkgs.file}/bin/file
substituteInPlace ./dbus-python.pc.in --replace-warn 'Cflags: -I''${includedir}' 'Cflags: -I''${includedir}/dbus-1.0'
'';
configureFlags = old.configureFlags or [ ] ++ [
"PYTHON_VERSION=${lib.versions.major final.python.version}"
];
preConfigure = old.preConfigure or "" + lib.optionalString
(lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin)
"MACOSX_DEPLOYMENT_TARGET=10.16";
preBuild = old.preBuild or "" + "make distclean";
preInstall = old.preInstall or "" + "mkdir -p $out/${final.python.sitePackages}";
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.dbus pkgs.dbus-glib ]
# My guess why it's sometimes trying to -lncurses.
# It seems not to retain the dependency anyway.
++ lib.optionals (! final.python ? modules) [ pkgs.ncurses ];
});
dcli = prev.dcli.overridePythonAttrs (old: {
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
});
ddtrace = prev.ddtrace.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++
lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ];
});
deepspeed = prev.deepspeed.overridePythonAttrs (old: rec {
CUDA_HOME = pkgs.symlinkJoin {
name = "deepspeed-cuda-home";
paths = [
pkgs.cudaPackages.libnvjitlink
pkgs.cudaPackages.libcufft
pkgs.cudaPackages.libcusparse
pkgs.cudaPackages.cuda_nvcc
];
};
buildInputs = old.buildInputs or [ ] ++ [ final.setuptools ];
LD_LIBRARY_PATH = "${CUDA_HOME}/lib";
preBuild = ''
# Prevent the build from trying to access the default triton cache directory under /homeless-shelter
export TRITON_CACHE_DIR=$TMPDIR
'';
});
dictdiffer = prev.dictdiffer.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
}
);
django = prev.django.overridePythonAttrs (
old: {
propagatedNativeBuildInputs = old.propagatedNativeBuildInputs or [ ]
++ [ pkgs.gettext final.pytest-runner ];
}
);
django-bakery = prev.django-bakery.overridePythonAttrs (
old: {
configurePhase = ''
if ! test -e LICENSE; then
touch LICENSE
fi
'' + (old.configurePhase or "");
}
);
django-cors-headers = prev.django-cors-headers.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
}
);
django-hijack = prev.django-hijack.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
}
);
django-prometheus = prev.django-prometheus.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
}
);
django-rosetta = prev.django-rosetta.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ final.pytest-runner ];
}
);
django-stubs-ext = prev.django-stubs-ext.overridePythonAttrs (
old: {
prePatch = (old.prePatch or "") + "touch ../LICENSE.txt";
}
);
dlib = prev.dlib.overridePythonAttrs (
old: {
# Parallel building enabled
inherit (pkgs.python.pkgs.dlib) patches;
enableParallelBuilding = true;
dontUseCmakeConfigure = true;
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ pkgs.dlib.nativeBuildInputs;
buildInputs = old.buildInputs or [ ] ++ pkgs.dlib.buildInputs;
}
);
# Setuptools >= 60 broke build_py_2to3
docutils = prev.docutils.overridePythonAttrs (
_: lib.optionalAttrs (lib.versionOlder prev.docutils.version "0.16" && lib.versionAtLeast prev.setuptools.version "60") {
SETUPTOOLS_USE_DISTUTILS = "stdlib";
}
);
duckdb = prev.duckdb.overridePythonAttrs (old: {
postPatch = lib.optionalString (!(old.src.isWheel or false)) ''
${lib.optionalString (lib.versionOlder old.version "0.8") "cd tools/pythonpkg"}
substituteInPlace setup.py \
--replace-warn 'multiprocessing.cpu_count()' "$NIX_BUILD_CORES" \
--replace-warn 'setuptools_scm<7.0.0' 'setuptools_scm'
'';
});
# Environment markers are not always included (depending on how a dep was defined)
enum34 = if final.pythonAtLeast "3.4" then null else prev.enum34;
eth-hash = prev.eth-hash.overridePythonAttrs {
preConfigure = ''
substituteInPlace setup.py --replace-warn \'setuptools-markdown\' ""
'';
};
eth-keyfile = prev.eth-keyfile.overridePythonAttrs (old: {
preConfigure = ''
substituteInPlace setup.py --replace-warn \'setuptools-markdown\' ""
'';
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
});
eth-keys = prev.eth-keys.overridePythonAttrs {
preConfigure = ''
substituteInPlace setup.py --replace-warn \'setuptools-markdown\' ""
'';
};
# FIXME: this is a workaround for https://github.com/nix-community/poetry2nix/issues/1161
eth-utils = prev.eth-utils.override { preferWheel = true; };
evdev = prev.evdev.overridePythonAttrs (_old: {
preConfigure = ''
substituteInPlace setup.py --replace-warn /usr/include/linux ${pkgs.linuxHeaders}/include/linux
'';
});
faker = prev.faker.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
doCheck = false;
}
);
fancycompleter = prev.fancycompleter.overridePythonAttrs (
old: {
postPatch = lib.optionalString (!(old.src.isWheel or false)) ''
substituteInPlace setup.py \
--replace-warn 'setup_requires="setupmeta"' 'setup_requires=[]' \
--replace-warn 'versioning="devcommit"' 'version="${old.version}"'
'';
}
);
fastapi = prev.fastapi.overridePythonAttrs (old: {
# fastapi 0.111 depends on fastapi-cli, which depends on fastapi, resulting in infinite recursion
propagatedBuildInputs = removePackagesByName
(old.propagatedBuildInputs or [ ])
(lib.optionals (final ? fastapi-cli) [ final.fastapi-cli ]);
});
fastecdsa = prev.fastecdsa.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ [ pkgs.gmp.dev ];
});
fastparquet = prev.fastparquet.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
}
);
file-magic = prev.file-magic.overridePythonAttrs (_: {
postPatch = ''
substituteInPlace magic.py \
--replace-warn \
"find_library('magic')" \
"'${pkgs.file}/lib/libmagic${sharedLibExt}'"
'';
});
fiona = prev.fiona.overridePythonAttrs (
old: {
format = lib.optionalString (!(old.src.isWheel or false)) "setuptools";
buildInputs = old.buildInputs or [ ] ++ [ gdal ];
nativeBuildInputs = old.nativeBuildInputs or [ ]
++ lib.optionals ((old.src.isWheel or false) && (!pkgs.stdenv.isDarwin)) [ pkgs.autoPatchelfHook ]
# for gdal-config
++ [ gdal ];
}
);
flatbuffers = prev.flatbuffers.overrideAttrs (old: {
VERSION = old.version;
});
gdal = prev.gdal.overridePythonAttrs (
old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ gdal final.numpy ];
preBuild = (old.preBuild or "") + ''
substituteInPlace setup.cfg \
--replace-warn "../../apps/gdal-config" '${gdal}/bin/gdal-config'
'';
}
);
gdstk = prev.gdstk.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ [ final.setuptools pkgs.zlib pkgs.qhull ];
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ cmake ];
dontUseCmakeConfigure = true;
# gdstk ships with its own FindQhull.cmake, but that isn't
# included in the python release -- fix
postPatch = ''
if [ ! -e cmake_modules/FindQhull.cmake ]; then
mkdir -p cmake_modules
cp ${pkgs.fetchurl {
url = "https://github.com/heitzmann/gdstk/raw/57c9ecec1f7bc2345182bcf383602a792026a28b/cmake_modules/FindQhull.cmake";
hash = "sha256-lJNWAfSItbg7jsHfe7gZryqJruHjjMM0GXudXa/SJu4=";
}} cmake_modules/FindQhull.cmake
fi
'';
});
gnureadline = prev.gnureadline.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ pkgs.ncurses ];
}
);
grandalf = prev.grandalf.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ] ++ [ final.pytest-runner ];
doCheck = false;
}
);
granian = prev.granian.overridePythonAttrs (old: lib.optionalAttrs (!(old.src.isWheel or false))
(
let
githubHash = {
"0.2.1" = "sha256-XEhu6M1hFi3/gAKZcei7KJSrIhhlZhlvZvbfyA6VLR4=";
"0.2.2" = "sha256-KWwefJ3CfOUGCgAm7AhFlIxRF9qxNEo3npGOxVJ23FY=";
"0.2.3" = "sha256-2JnyO0wxkV49R/0wzDb/PnUWWHi3ckwK4nVe7dWeH1k=";
"0.2.4" = "sha256-GdQJvVPsWgC1z7La9h11x2pRAP+L998yImhTFrFT5l8=";
"0.2.5" = "sha256-vMXMxss77rmXSjoB53eE8XN2jXyIEf03WoQiDfvhDmw=";
"0.2.6" = "sha256-l9W9+KDg/43mc0toEz1n1pqw+oQdiHdAxGlS+KLIGhw=";