2020-04-29 14:12:59 +01:00
{ pkgs ? import <nixpkgs> { }
2019-12-11 13:31:22 +01:00
, lib ? pkgs . lib
2019-06-27 16:44:42 +01:00
} :
2019-06-24 12:31:59 +01:00
2022-01-18 15:07:15 +12:00
let
2023-10-24 09:28:31 -04:00
addBuildSystem' =
2024-04-14 20:27:42 +02:00
{ final
2022-01-21 12:46:20 +12:00
, drv
, attr
2022-04-23 18:06:38 +12:00
, extraAttrs ? [ ]
2022-01-21 14:51:40 +12:00
} :
let
2022-06-15 15:02:23 -05:00
buildSystem =
if builtins . isAttrs attr then
2022-06-16 04:55:18 -05:00
let
fromIsValid =
if builtins . hasAttr " f r o m " attr then
lib . versionAtLeast drv . version attr . from
else
true ;
untilIsValid =
2022-06-15 15:02:23 -05:00
if builtins . hasAttr " u n t i l " attr then
2022-06-16 04:55:18 -05:00
lib . versionOlder drv . version attr . until
2022-06-15 15:02:23 -05:00
else
2022-06-16 04:55:18 -05:00
true ;
intendedBuildSystem =
2024-03-09 12:10:18 -05:00
if lib . elem attr . buildSystem [ " c y t h o n " " c y t h o n _ 0 " ] then
2024-05-02 12:10:53 -04:00
( final . python . pythonOnBuildForHost or final . python . pythonForBuild ) . pkgs . ${ attr . buildSystem }
2022-06-16 04:55:18 -05:00
else
2024-04-14 20:27:42 +02:00
final . ${ attr . buildSystem } ;
2022-06-16 04:55:18 -05:00
in
if fromIsValid && untilIsValid then intendedBuildSystem else null
2022-06-15 15:02:23 -05:00
else
2024-03-09 12:10:18 -05:00
if lib . elem attr [ " c y t h o n " " c y t h o n _ 0 " ] then
2024-05-02 12:10:53 -04:00
( final . python . pythonOnBuildForHost or final . python . pythonForBuild ) . pkgs . ${ attr }
2024-03-09 12:10:18 -05:00
else
2024-05-02 12:10:53 -04:00
final . ${ attr } ;
2022-01-21 14:51:40 +12:00
in
2024-04-14 20:27:42 +02:00
if ( attr = = " f l i t - c o r e " || attr = = " f l i t " || attr = = " h a t c h l i n g " ) && ! final . isPy3k then drv
2023-10-26 12:18:24 +13:00
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 = = " w h e e l " then
{ }
else if attr = = " p o e t r y " then
{
# replace poetry
postPatch = ( old . postPatch or " " ) + ''
if [ - f pyproject . toml ] ; then
toml = " $ ( m k t e m p ) "
yj - tj < pyproject . toml | jq - - from-file $ { ./poetry-to-poetry-core.jq } | yj - jt > " $ t o m l "
mv " $ t o m l " pyproject . toml
fi
'' ;
nativeBuildInputs = old . nativeBuildInputs or [ ]
2024-04-14 20:27:42 +02:00
++ [ final . poetry-core final . pkgs . yj final . pkgs . jq ]
++ map ( a : final . ${ a } ) extraAttrs ;
2023-10-26 12:18:24 +13:00
}
else
{
nativeBuildInputs =
( old . nativeBuildInputs or [ ] )
++ lib . optionals ( ! ( builtins . isNull buildSystem ) ) [ buildSystem ]
2024-04-14 20:27:42 +02:00
++ map ( a : final . ${ a } ) extraAttrs ;
2023-10-26 12:18:24 +13:00
}
) ;
2022-01-18 15:07:15 +12:00
2023-10-25 07:31:10 -04:00
removePackagesByName = packages : packagesToRemove :
let
namesToRemove = map lib . getName packagesToRemove ;
in
lib . filter ( x : ! ( builtins . elem ( lib . getName x ) namesToRemove ) ) packages ;
2022-01-18 16:29:46 +12:00
2022-01-18 15:45:06 +12:00
in
2022-01-21 12:46:20 +12:00
lib . composeManyExtensions [
# NixOps
2024-04-14 20:27:42 +02:00
( final : prev :
lib . mapAttrs ( _ : v : addBuildSystem' { inherit final ; drv = v ; attr = " p o e t r y " ; } ) ( lib . filterAttrs ( n : _ : lib . strings . hasPrefix " n i x o p s " n ) prev )
2022-01-21 12:46:20 +12:00
// {
# NixOps >=2 dependency
2024-04-14 20:27:42 +02:00
nixos-modules-contrib = addBuildSystem' { inherit final ; drv = prev . nixos-modules-contrib ; attr = " p o e t r y " ; } ;
2020-05-19 21:06:02 +01:00
}
2022-01-21 12:46:20 +12:00
)
2022-01-20 11:54:26 +12:00
2022-01-21 12:46:20 +12:00
# Add build systems
2024-04-14 20:27:42 +02:00
( final : prev :
2022-01-21 12:46:20 +12:00
let
buildSystems = lib . importJSON ./build-systems.json ;
in
lib . mapAttrs
( attr : systems : builtins . foldl'
2023-10-24 09:28:31 -04:00
( drv : attr : addBuildSystem' {
2024-04-14 20:27:42 +02:00
inherit drv final attr ;
2022-01-21 12:46:20 +12:00
} )
2024-04-14 20:27:42 +02:00
( prev . ${ attr } or null )
2022-01-21 12:46:20 +12:00
systems )
buildSystems )
# Build fixes
2024-04-14 20:27:42 +02:00
( final : prev :
2022-01-21 12:46:20 +12:00
let
2024-04-14 20:27:42 +02:00
inherit ( final . python ) stdenv ;
2022-01-21 12:46:20 +12:00
inherit ( pkgs . buildPackages ) pkg-config ;
2024-04-14 20:27:42 +02:00
pyBuildPackages = ( final . python . pythonOnBuildForHost or final . python . pythonForBuild ) . pkgs ;
2022-01-12 17:33:03 +13:00
2022-05-13 08:21:16 +12:00
selectQt5 = version :
let
selector = builtins . concatStringsSep " " ( lib . take 2 ( builtins . splitVersion version ) ) ;
in
pkgs . " q t ${ selector } " or pkgs . qt5 ;
2023-08-14 20:18:50 +03:00
pyQt5Modules = qt5 : with qt5 ; [
qt3d
qtbase
qtcharts
qtconnectivity
qtdatavis3d
qtdeclarative
qtgamepad
qtlocation
qtmultimedia
qtsensors
qtserialport
qtsvg
qtwebchannel
qtwebengine
qtwebsockets
qtx11extras
qtxmlpatterns
] ;
2023-10-24 06:43:18 -04:00
2024-05-02 12:10:53 -04:00
bootstrappingBase = ( pkgs . ${ final . python . pythonAttr } . pythonOnBuildForHost or pkgs . ${ final . python . pythonAttr } . pythonForBuild ) . pkgs ;
2024-03-09 12:10:18 -05:00
# 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 [ ] ++ [ " - D B U I L D _ P Y T H O N _ B I N D I N G S = O F F " ] ;
} ) ;
2022-01-21 12:46:20 +12:00
in
2020-01-09 14:07:36 +00:00
2022-01-21 12:46:20 +12:00
{
2024-04-14 20:27:42 +02:00
addBuildSystem = attr : drv : addBuildSystem' { inherit final drv attr ; } ;
2023-10-24 09:28:31 -04:00
2023-10-24 06:43:18 -04:00
#### BEGIN bootstrapping pkgs
installer = bootstrappingBase . installer . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit-core ;
2023-10-24 06:43:18 -04:00
} ;
build = bootstrappingBase . build . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit-core packaging pyproject-hooks tomli ;
2023-10-24 06:43:18 -04:00
} ;
flit-core = bootstrappingBase . flit-core . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit ;
2023-10-24 06:43:18 -04:00
} ;
packaging = bootstrappingBase . packaging . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit-core ;
2023-10-24 06:43:18 -04:00
} ;
tomli = bootstrappingBase . tomli . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit-core ;
2023-10-24 06:43:18 -04:00
} ;
pyproject-hooks = bootstrappingBase . pyproject-hooks . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit-core tomli ;
2023-10-24 06:43:18 -04:00
} ;
wheel = bootstrappingBase . wheel . override {
2024-04-14 20:27:42 +02:00
inherit ( final ) buildPythonPackage flit-core ;
2023-10-24 06:43:18 -04:00
} ;
2024-03-09 12:10:18 -05:00
inherit ( bootstrappingBase ) cython cython_0 ;
2023-10-24 06:43:18 -04:00
#### END bootstrapping pkgs
2024-04-14 20:27:42 +02:00
poetry = final . poetry-core ;
2023-10-24 09:28:31 -04:00
2024-04-14 20:27:42 +02:00
automat = prev . automat . overridePythonAttrs (
2023-02-03 12:29:13 +01:00
old : lib . optionalAttrs ( lib . versionOlder old . version " 2 2 . 1 0 . 0 " ) {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . m2r ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-07 10:24:21 +00:00
2024-04-14 20:27:42 +02:00
aiokafka = prev . aiokafka . overridePythonAttrs ( old : {
2024-02-01 09:10:08 -03:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . zlib ] ;
} ) ;
2024-04-14 20:27:42 +02:00
aiohttp-swagger3 = prev . aiohttp-swagger3 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-08-25 18:11:19 +02:00
2024-04-14 20:27:42 +02:00
ansible = prev . ansible . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
# Inputs copied from nixpkgs as ansible doesn't specify it's dependencies
# in a correct manner.
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . pycrypto
final . paramiko
final . jinja2
final . pyyaml
final . httplib2
final . six
final . netaddr
final . dnspython
final . jmespath
final . dopy
final . ncclient
2022-01-21 12:46:20 +12:00
] ;
2022-10-06 13:48:09 +02:00
}
) ;
2024-04-14 20:27:42 +02:00
ansible-base = prev . ansible-base . overridePythonAttrs (
2022-10-06 13:48:09 +02:00
old :
{
prePatch = '' s e d - i " s / \ [ p y t h o n , / [ / " l i b / a n s i b l e / e x e c u t o r / t a s k _ e x e c u t o r . p y '' ;
postInstall = ''
for m in docs/man/man1 /* ; d o
install - vD $ m - t $ out/share/man/man1
done
'' ;
}
// lib . optionalAttrs ( lib . versionOlder old . version " 2 . 4 " ) {
prePatch = '' s e d - i " s , / u s r / , $o u t , " l i b / a n s i b l e / c o n s t a n t s . p y '' ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-08-27 18:22:57 +07:00
2024-04-14 20:27:42 +02:00
ansible-lint = prev . ansible-lint . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-05-02 12:10:53 -04:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools-scm ] ;
2022-01-21 12:46:20 +12:00
preBuild = ''
export HOME = $ ( mktemp - d )
2022-01-19 17:09:31 +12:00
'' ;
2020-05-19 21:06:02 +01:00
}
2022-01-21 12:46:20 +12:00
) ;
2020-03-28 20:47:08 +01:00
2024-04-14 20:27:42 +02:00
argcomplete = prev . argcomplete . overridePythonAttrs (
2022-09-29 20:39:37 +03:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . importlib-metadata ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-18 11:19:43 +12:00
2024-04-14 20:27:42 +02:00
arpeggio = prev . arpeggio . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-09-27 19:20:05 -05:00
2024-04-14 20:27:42 +02:00
astroid = prev . astroid . overridePythonAttrs (
2022-09-29 20:39:37 +03:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-11-08 10:09:52 -05:00
2024-04-14 20:27:42 +02:00
av = prev . av . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkg-config
] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . ffmpeg_4 ] ;
}
) ;
2020-11-23 19:40:27 +01:00
2024-05-02 12:10:53 -04:00
apsw = prev . apsw . overridePythonAttrs (
2024-05-01 05:41:41 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
# without this patch a download of sqlite is attempted
substituteInPlace setup . py - - replace ' if self.fetch:' ' if False:'
'' ;
buildInputs = old . buildInputs or [ ] ++ [ pkgs . sqlite ] ;
2024-04-26 14:56:23 +01:00
}
2024-05-01 05:41:41 -04:00
) ;
2024-04-26 14:56:23 +01:00
2022-01-21 12:46:20 +12:00
argon2-cffi =
2024-04-14 20:27:42 +02:00
if ( lib . versionAtLeast prev . argon2-cffi . version " 2 1 . 2 . 0 " ) then
2023-10-24 09:28:31 -04:00
addBuildSystem'
2022-01-21 12:46:20 +12:00
{
2024-04-14 20:27:42 +02:00
inherit final ;
drv = prev . argon2-cffi ;
2022-01-21 12:46:20 +12:00
attr = " f l i t - c o r e " ;
2024-04-14 20:27:42 +02:00
} else prev . argon2-cffi ;
2022-01-20 11:54:26 +12:00
2024-03-25 15:47:39 -07:00
autoawq-kernels = prev . autoawq-kernels . overridePythonAttrs ( _attrs : {
autoPatchelfIgnoreMissingDeps = true ;
} ) ;
2024-04-14 20:27:42 +02:00
aws-cdk-asset-node-proxy-agent-v6 = prev . aws-cdk-asset-node-proxy-agent-v6 . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 67 .3 . 2 ' ' setuptools'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
aws-cdk-asset-awscli-v1 = prev . aws-cdk-asset-awscli-v1 . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 67 .3 . 2 ' ' setuptools'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
aws-cdk-asset-kubectl-v20 = prev . aws-cdk-asset-kubectl-v20 . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 62 .1 . 0 ' ' setuptools' \
- - replace ' wheel ~ = 0 .37 . 1 ' ' wheel'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
aws-cdk-lib = prev . aws-cdk-lib . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 67 .3 . 2 ' ' setuptools'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
awscrt = prev . awscrt . overridePythonAttrs (
2022-05-15 16:08:13 -07:00
old : {
nativeBuildInputs = [ pkgs . cmake ] ++ old . nativeBuildInputs ;
dontUseCmakeConfigure = true ;
}
) ;
2023-10-26 06:05:15 -04:00
2024-04-14 20:27:42 +02:00
awsume = prev . awsume . overridePythonAttrs ( _ : {
2023-10-26 06:05:15 -04:00
preBuild = ''
HOME = " $ ( m k t e m p - d ) "
export HOME
'' ;
} ) ;
2022-09-29 15:20:50 -04:00
bcrypt =
let
getCargoHash = version : {
" 4 . 0 . 0 " = " s h a 2 5 6 - H v f R L y U h l X V u v x W r t S D K x 3 r M K J b j v u i M c D Y 6 g + p Y F S 0 = " ;
2022-11-11 14:44:55 -08:00
" 4 . 0 . 1 " = " s h a 2 5 6 - l D W X 6 9 Y E N Z F M u 7 p y B m a v U Z a a l G v F q b H S H f k w k z m D Q a Y = " ;
2023-12-07 17:03:29 -03:00
" 4 . 1 . 1 " = " s h a 2 5 6 - Q Y g 1 + D s Z E d X B 7 4 v u S 4 S F v V 0 n 5 G X k u w H k O S 9 j 1 o g S T j A = " ;
2024-01-03 14:42:27 -05:00
" 4 . 1 . 2 " = " s h a 2 5 6 - f T D 1 A K v y e n i 5 u k Y j K 5 3 g u e K L e y + r c I U j W / 0 R 2 8 9 x e b 0 = " ;
2022-09-29 15:20:50 -04:00
} . ${ version } or (
lib . warn " U n k n o w n b c r y p t v e r s i o n : ' ${ version } ' . P l e a s e u p d a t e g e t C a r g o H a s h . " lib . fakeHash
) ;
in
2024-04-14 20:27:42 +02:00
prev . bcrypt . overridePythonAttrs (
2022-09-29 15:20:50 -04:00
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 [ ] )
2024-04-14 20:27:42 +02:00
++ lib . optionals ( lib . versionAtLeast old . version " 4 " ) [ rustc cargo pkgs . rustPlatform . cargoSetupHook final . setuptools-rust ] ;
2022-10-07 09:37:55 +03:00
} // lib . optionalAttrs ( lib . versionAtLeast old . version " 4 " ) {
2022-09-29 15:20:50 -04:00
cargoDeps =
pkgs . rustPlatform . fetchCargoTarball
{
2023-10-26 12:18:24 +13:00
inherit ( old ) src ;
2022-09-29 15:20:50 -04:00
sourceRoot = " ${ old . pname } - ${ old . version } / s r c / _ b c r y p t " ;
name = " ${ old . pname } - ${ old . version } " ;
sha256 = getCargoHash old . version ;
} ;
cargoRoot = " s r c / _ b c r y p t " ;
}
) ;
2024-04-14 20:27:42 +02:00
bjoern = prev . bjoern . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . libev ] ;
}
) ;
2020-01-17 11:00:36 +00:00
2024-04-14 20:27:42 +02:00
borgbackup = prev . borgbackup . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
BORG_OPENSSL_PREFIX = pkgs . openssl . dev ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . openssl pkgs . acl ] ;
}
) ;
2021-04-12 21:00:43 +02:00
2024-03-25 15:47:39 -07:00
bitsandbytes = prev . bitsandbytes . overridePythonAttrs ( _attrs : {
autoPatchelfIgnoreMissingDeps = true ;
} ) ;
2024-04-14 20:27:42 +02:00
cairocffi = prev . cairocffi . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2023-07-06 10:19:45 -04:00
# apply necessary patches in postInstall if the source is a wheel
postInstall = lib . optionalString ( old . src . isWheel or false ) ''
2024-04-14 20:27:42 +02:00
pushd " $ o u t / ${ final . python . sitePackages } "
2023-07-06 10:19:45 -04:00
for patch in $ { lib . concatMapStringsSep " " ( p : " ${ p } " ) pkgs . python3 . pkgs . cairocffi . patches } ; do
patch - p1 < " $ p a t c h "
done
popd
'' ;
} // lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
inherit ( pkgs . python3 . pkgs . cairocffi ) patches ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-04-12 21:00:43 +02:00
2024-04-14 20:27:42 +02:00
cairosvg = prev . cairosvg . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-04-12 21:00:43 +02:00
2022-01-23 10:24:53 +12:00
cattrs =
let
2024-04-14 20:27:42 +02:00
drv = prev . cattrs ;
2022-01-23 10:24:53 +12:00
in
if drv . version = = " 1 . 1 0 . 0 " then
drv . overridePythonAttrs
( old : {
# 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
'' ;
} ) else drv ;
2024-04-14 20:27:42 +02:00
ccxt = prev . ccxt . overridePythonAttrs ( _old : {
2022-03-27 12:26:07 +02:00
preBuild = ''
ln - s README . { rst , md }
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
cdk-nag = prev . cdk-nag . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 67 .3 . 2 ' ' setuptools'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
celery = prev . celery . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2021-04-12 21:00:43 +02:00
2024-04-14 20:27:42 +02:00
cerberus = prev . cerberus . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-10-07 09:37:55 +03:00
} ) ;
2024-04-14 20:27:42 +02:00
constructs = prev . constructs . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 67 .3 . 2 ' ' setuptools'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
cssselect2 = prev . cssselect2 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-04-12 21:00:43 +02:00
2022-01-21 12:46:20 +12:00
cffi =
# cffi is bundled with pypy
2024-04-14 20:27:42 +02:00
if final . python . implementation = = " p y p y " then null else
2022-01-21 12:46:20 +12:00
(
2024-04-14 20:27:42 +02:00
prev . cffi . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [ pkg-config ] ;
buildInputs = old . buildInputs or [ ] ++ [ pkgs . libffi ] ;
2023-01-07 06:55:46 -05:00
prePatch = ( old . prePatch or " " ) + lib . optionalString ( ! ( old . src . isWheel or false ) && stdenv . isDarwin ) ''
2022-01-21 12:46:20 +12:00
# Remove setup.py impurities
substituteInPlace setup . py - - replace " ' - i w i t h s y s r o o t / u s r / i n c l u d e / f f i ' " " "
substituteInPlace setup . py - - replace " ' / u s r / i n c l u d e / f f i ' , " " "
substituteInPlace setup . py - - replace ' /usr/include/libffi ' ' $ { lib . getDev pkgs . libffi } /include '
'' ;
2020-04-29 14:12:59 +01:00
2022-01-21 12:46:20 +12:00
}
)
) ;
2020-05-19 21:06:02 +01:00
2024-04-14 20:27:42 +02:00
cmdstanpy = prev . cmdstanpy . overridePythonAttrs (
2022-10-30 16:25:26 -04:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . cmdstan ] ;
2022-10-30 17:00:14 -04:00
patchPhase = ''
substituteInPlace cmdstanpy/model.py \
- - replace ' cmd = [ make ] ' \
' cmd = [ " ${ pkgs . cmdstan } / b i n / s t a n " ] '
'' ;
2022-10-30 17:01:02 -04:00
CMDSTAN = " ${ pkgs . cmdstan } " ;
2022-10-30 16:25:26 -04:00
}
) ;
2024-04-14 20:27:42 +02:00
contourpy = prev . contourpy . overridePythonAttrs (
2023-08-26 07:47:35 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-08-21 09:46:40 +09:00
dontUseMesonConfigure = true ;
2023-10-23 12:23:59 -04:00
postPatch = ''
substituteInPlace pyproject . toml - - replace ' meson [ ninja ] ' ' meson'
'' ;
2022-09-25 15:01:06 +01:00
}
) ;
2024-04-14 20:27:42 +02:00
clarabel = prev . dbt-extractor . overridePythonAttrs
2024-02-20 05:27:39 +08:00
(
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . cargo pkgs . rustc pkgs . maturin ] ;
}
) ;
2024-04-14 20:27:42 +02:00
cloudflare = prev . cloudflare . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2022-01-21 12:46:20 +12:00
postPatch = ''
rm - rf examples /*
'' ;
}
) ;
2022-01-11 10:12:50 +13:00
2024-04-14 20:27:42 +02:00
colour = prev . colour . overridePythonAttrs (
2023-12-11 05:14:58 -05:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
patches = old . patches or [ ] ++ [
( pkgs . fetchpatch {
url = " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / N i x O S / n i x p k g s / 4 8 5 b b e 5 8 3 6 5 f 3 c 4 4 a 4 2 f 8 7 b 8 c e c 2 3 8 5 b 8 8 3 8 0 d 7 4 / p k g s / d e v e l o p m e n t / p y t h o n - m o d u l e s / c o l o u r / r e m o v e - u n m a i n t a i n e d - d 2 t o 1 . d i f f " ;
hash = " s h a 2 5 6 - B j 0 1 q Q l B d 2 o y d v 0 a f L V 2 P u q q u u o 3 b n O O y D p 7 F R 8 c Q n A = " ;
} )
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-05-18 14:48:41 +12:00
2024-04-14 20:27:42 +02:00
coincurve = prev . coincurve . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-03-29 16:10:19 -07:00
# package setup logic
LIB_DIR = " ${ lib . getLib pkgs . secp256k1 } / l i b " ;
# for actual C toolchain build
NIX_CFLAGS_COMPILE = " - I ${ lib . getDev pkgs . secp256k1 } / i n c l u d e " ;
NIX_LDFLAGS = " - L ${ lib . getLib pkgs . secp256k1 } / l i b " ;
}
) ;
2024-04-14 20:27:42 +02:00
configparser = prev . configparser . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . toml
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2021-02-21 01:21:46 +11:00
2024-04-14 20:27:42 +02:00
confluent-kafka = prev . confluent-kafka . overridePythonAttrs (
2022-02-03 12:00:51 -05:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . rdkafka
] ;
}
) ;
2024-04-14 20:27:42 +02:00
copier = prev . copier . overrideAttrs ( old : {
2022-10-07 09:11:23 +01:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . git ] ;
} ) ;
2022-03-31 13:10:24 +12:00
cryptography =
let
getCargoHash = version : {
" 3 5 . 0 . 0 " = " s h a 2 5 6 - t Q o Q f o + T A o q A e a 8 6 Y F x y j / L N Q C i V i u 5 i j / 3 w j 7 Z n Y L I = " ;
" 3 6 . 0 . 0 " = " s h a 2 5 6 - Y 6 T u W 7 A r y V g S v Z 6 G 8 W N o D I v i + 0 t v x 8 Z l E Y F 5 q B 0 j f N k = " ;
" 3 6 . 0 . 1 " = " s h a 2 5 6 - k o z Y X k q t 1 W p q y o 9 G Y C w N 0 8 J + z V 9 2 Z W F J Y / f + r u l x m e Q = " ;
2022-04-01 00:17:50 +12:00
" 3 6 . 0 . 2 " = " 1 a 0 n i 1 a 3 d b v 2 d v h 6 g x 2 i 5 4 z 8 v 5 j 9 m 6 a s q g 9 7 k k v 7 g q b 1 i v i h s b p 8 " ;
2022-05-10 11:02:40 -07:00
" 3 7 . 0 . 2 " = " s h a 2 5 6 - q v r x v n e o B X j P 9 6 A n U P y r t f m C n Z o + I r i H R 5 H b t W Q 5 G k 8 = " ;
2022-07-05 18:23:45 +02:00
" 3 7 . 0 . 4 " = " s h a 2 5 6 - f 8 r 6 Q c l T w k g K 2 0 C N e 9 i 6 5 Z O q v S U e D c 4 E m v 6 B F B h h 1 h I " ;
2022-09-11 00:10:33 -04:00
" 3 8 . 0 . 1 " = " s h a 2 5 6 - o 8 l 1 3 f n f E U v U d D a s q 3 L x S P A r o z R H K V s Z f Q g 9 D N R 6 M 6 Q = " ;
2022-11-06 23:58:44 -08:00
" 3 8 . 0 . 3 " = " s h a 2 5 6 - l z H L W 1 N 4 h Z j + n n 0 8 N Z i P V M / X + S E c I s u Z D j E O y 0 O O k S c = " ;
2022-11-28 05:30:46 -05:00
" 3 8 . 0 . 4 " = " s h a 2 5 6 - B N 0 k O b l U w g H j 5 Q B f 5 2 R Y 2 J x 0 n B n 0 3 l w o N 1 O 5 P E o h b w Y = " ;
2023-01-09 14:15:19 -08:00
" 3 9 . 0 . 0 " = " s h a 2 5 6 - c l o r C 0 N t G u k p E 3 D n Z 8 4 M S d G h J N + q C 8 9 D Z P I T Z F u L 0 1 Q = " ;
2023-03-10 20:21:07 +00:00
" 3 9 . 0 . 2 " = " s h a 2 5 6 - A d m z 4 8 / G S 2 t 8 d i z 6 1 1 C i i n 1 H K Q E y M D E w H x T p J 5 t Z 1 Z A = " ;
2023-03-24 16:55:01 +07:00
" 4 0 . 0 . 0 " = " s h a 2 5 6 - / T B A N a v Y r i a 9 Y r B p M g j t F y q g 5 f e B c l o E T c Y J 8 f d B g k I = " ;
2023-04-05 03:30:21 +02:00
" 4 0 . 0 . 1 " = " s h a 2 5 6 - g F f D T c 2 Q W B W H B C y c V H 1 d Y l C s W Q M V c R Z f O B I a u + n j t D U = " ;
2023-04-19 23:53:35 -07:00
" 4 0 . 0 . 2 " = " s h a 2 5 6 - c V 4 G T f b V Y a n E l X O V m y n v r r u 2 w J u W v n T 1 Z 1 t Q K X d k b g 0 = " ;
2023-06-06 22:07:21 +02:00
" 4 1 . 0 . 1 " = " s h a 2 5 6 - 3 8 q 8 1 v R f 8 Q H R 8 l F R M 2 K b H 7 N g 5 n Y 7 n m t W R M o P W S 9 V O / U = " ;
2023-07-13 15:15:23 -04:00
" 4 1 . 0 . 2 " = " s h a 2 5 6 - h k u o I C a / s u M X l r 4 u 9 5 J b M l F z i 2 7 l J q J R m W n X 3 n Z f z K U = " ;
2023-08-06 16:52:35 +02:00
" 4 1 . 0 . 3 " = " s h a 2 5 6 - L Q u 7 w a y m p G U s + C Z u n 2 y D Q d 2 g U U A g y i s K B G 5 m d d r f S o 0 = " ;
2023-09-22 14:08:06 +02:00
" 4 1 . 0 . 4 " = " s h a 2 5 6 - o X R 8 y B U g i A 9 B O f k Z K B J n e K W l p w H B 7 1 t / 7 4 b / 5 W p i K m w = " ;
2023-10-27 13:47:04 +13:00
" 4 1 . 0 . 5 " = " s h a 2 5 6 - A B C K 1 4 4 / / R U J 3 A k s F H E g q C + k H v o H l 1 i f p V u q M T k G N H 8 = " ;
2023-12-14 11:30:50 +01:00
" 4 1 . 0 . 6 " = " s h a 2 5 6 - E 7 O 0 0 3 5 B n J f T Q e Z N A N 3 O z 0 f M b f j 4 5 h t v n K 8 A H O z f d c Y = " ;
2023-11-29 18:00:38 +00:00
" 4 1 . 0 . 7 " = " s h a 2 5 6 - V e Z h K i s C P D R v m S j G N w C g J J e V j 6 5 B Z 0 G e + y v X b Z w 8 6 R w = " ;
2024-01-30 13:46:48 +02:00
" 4 2 . 0 . 1 " = " s h a 2 5 6 - K q / T S o I 1 c m 9 P w g 5 C u l N l A A D m x d q 0 o W b g y m H e M E r U t c E = " ;
2024-01-31 18:47:59 -08:00
" 4 2 . 0 . 2 " = " s h a 2 5 6 - j w / F C 5 r Q O 7 7 h 6 o m t B p 0 N c 2 o i t k V b N E l b k B U d u y p r T I c = " ;
2024-02-16 08:37:47 +01:00
" 4 2 . 0 . 3 " = " s h a 2 5 6 - Q B Z L G X d Q z 2 W I B l A J M + y B k 1 Q g m f F 4 b 3 G 0 Y 1 I 5 l Z m A m t U = " ;
2024-02-22 10:44:58 +01:00
" 4 2 . 0 . 4 " = " s h a 2 5 6 - q a X Q i F 1 x Z v v 4 s N I i R 2 c b 5 T f D 7 o N i Y d v U w c m 3 7 n h 2 P 2 M = " ;
2024-03-09 12:10:18 -05:00
" 4 2 . 0 . 5 " = " s h a 2 5 6 - P w 3 f t p c D M f Z r / w 6 U S 5 f n n y P V s F S B 9 + B u I K a z D o c Y j T U = " ;
2022-07-05 18:24:27 +02:00
} . ${ version } or (
lib . warn " U n k n o w n c r y p t o g r a p h y v e r s i o n : ' ${ version } ' . P l e a s e u p d a t e g e t C a r g o H a s h . " lib . fakeHash
) ;
2024-04-14 20:27:42 +02:00
sha256 = getCargoHash prev . cryptography . version ;
isWheel = lib . hasSuffix " . w h l " prev . cryptography . src ;
2022-04-01 00:17:50 +12:00
scrypto =
2022-09-09 11:12:32 +02:00
if isWheel then
2022-04-01 00:17:50 +12:00
(
2024-04-14 20:27:42 +02:00
prev . cryptography . overridePythonAttrs { preferWheel = true ; }
) else prev . cryptography ;
2022-03-31 13:10:24 +12:00
in
2022-04-01 00:17:50 +12:00
scrypto . overridePythonAttrs
2022-03-31 13:10:24 +12:00
(
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ lib . optionals ( lib . versionAtLeast old . version " 3 . 4 " ) [ final . setuptools-rust ]
++ lib . optional ( ! final . isPyPy ) pyBuildPackages . cffi
2023-07-03 21:19:44 -04:00
++ lib . optionals ( lib . versionAtLeast old . version " 3 . 5 " && ! isWheel ) [ pkgs . rustPlatform . cargoSetupHook pkgs . cargo pkgs . rustc ]
2023-04-05 00:19:43 +12:00
++ [ pkg-config ]
;
2022-10-03 14:14:50 +02:00
buildInputs = ( old . buildInputs or [ ] )
2023-04-05 00:19:43 +12:00
++ [ pkgs . libxcrypt ]
2022-10-03 14:14:50 +02:00
++ [ ( if lib . versionAtLeast old . version " 3 7 " then pkgs . openssl_3 else pkgs . openssl_1_1 ) ]
2022-03-31 13:10:24 +12:00
++ lib . optionals stdenv . isDarwin [ pkgs . darwin . apple_sdk . frameworks . Security pkgs . libiconv ] ;
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [ final . cffi ] ;
2022-03-31 13:10:24 +12:00
} // lib . optionalAttrs ( lib . versionAtLeast old . version " 3 . 4 " && lib . versionOlder old . version " 3 . 5 " ) {
CRYPTOGRAPHY_DONT_BUILD_RUST = " 1 " ;
2022-09-09 11:12:32 +02:00
} // lib . optionalAttrs ( lib . versionAtLeast old . version " 3 . 5 " && ! isWheel ) rec {
2022-03-31 13:10:24 +12:00
cargoDeps =
pkgs . rustPlatform . fetchCargoTarball {
2023-10-26 12:18:24 +13:00
inherit ( old ) src ;
2022-03-31 13:10:24 +12:00
sourceRoot = " ${ old . pname } - ${ old . version } / ${ cargoRoot } " ;
name = " ${ old . pname } - ${ old . version } " ;
inherit sha256 ;
} ;
cargoRoot = " s r c / r u s t " ;
}
) ;
2020-05-07 10:54:04 -07:00
2024-03-25 15:47:39 -07:00
cupy-cuda12x = prev . cupy-cuda12x . overridePythonAttrs ( _attrs : {
autoPatchelfIgnoreMissingDeps = true ;
} ) ;
2024-04-14 20:27:42 +02:00
cyclonedx-python-lib = prev . cyclonedx-python-lib . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
postPatch = ''
2024-05-01 10:42:05 -07:00
if [ - f setup . py ] ; then
substituteInPlace setup . py - - replace ' setuptools >= 50 .3 .2 , < 51 .0 . 0 ' ' setuptools'
fi
2022-01-21 12:46:20 +12:00
'' ;
} ) ;
2022-01-18 15:45:06 +12:00
2024-04-14 20:27:42 +02:00
cysystemd = prev . cysystemd . overridePythonAttrs ( old : {
2023-04-29 21:42:08 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . systemd ] ;
2023-04-26 13:08:44 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . pkg-config ] ;
} ) ;
2024-04-14 20:27:42 +02:00
daphne = prev . daphne . overridePythonAttrs ( _old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
2024-05-03 13:59:42 -05:00
# sometimes setup.py doesn't exist
if [ - f setup . py ] ; then
substituteInPlace setup . py - - replace ' setup_requires = [ " p y t e s t - r u n n e r " ] , ' " "
fi
2022-01-21 12:46:20 +12:00
'' ;
} ) ;
2021-05-11 12:56:52 +12:00
2024-04-14 20:27:42 +02:00
darts = prev . darts . override {
2022-10-31 11:18:41 -04:00
preferWheel = true ;
} ;
2024-04-14 20:27:42 +02:00
datadog-lambda = prev . datadog-lambda . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
substituteInPlace setup . py - - replace " s e t u p t o o l s = = " " s e t u p t o o l s > = "
'' ;
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2020-05-07 10:54:04 -07:00
2024-04-14 20:27:42 +02:00
databricks-connect = prev . databricks-connect . overridePythonAttrs ( _old : {
2023-03-06 15:50:15 -05:00
sourceRoot = " . " ;
} ) ;
2024-04-14 20:27:42 +02:00
dbt-extractor = prev . dbt-extractor . overridePythonAttrs
2023-03-06 15:48:09 -05:00
(
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . cargo pkgs . rustc pkgs . maturin ] ;
}
) ;
2024-04-14 20:27:42 +02:00
dbus-python = prev . dbus-python . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
outputs = [ " o u t " " d e v " ] ;
2021-11-22 00:46:01 +03:00
2022-01-21 12:46:20 +12:00
postPatch = old . postPatch or " " + ''
substituteInPlace ./configure - - replace /usr/bin/file $ { pkgs . file } /bin/file
substituteInPlace ./dbus-python.pc.in - - replace ' Cflags : - I'' $ { includedir } ' ' Cflags : - I'' $ { includedir } /dbus-1.0 '
'' ;
2020-06-08 17:29:43 +02:00
2022-01-21 12:46:20 +12:00
configureFlags = ( old . configureFlags or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
" P Y T H O N _ V E R S I O N = ${ lib . versions . major final . python . version } "
2022-01-21 12:46:20 +12:00
] ;
2020-02-26 10:50:13 +01:00
2022-01-21 12:46:20 +12:00
preConfigure = lib . concatStringsSep " \n " [
( old . preConfigure or " " )
( if ( lib . versionAtLeast stdenv . hostPlatform . darwinMinVersion " 1 1 " && stdenv . isDarwin ) then ''
MACOSX_DEPLOYMENT_TARGET = 10 .16
'' e l s e " " )
] ;
2021-09-17 21:34:48 +10:00
2023-10-23 23:56:13 +09:00
preBuild = ( old . preBuild or " " ) + ''
2022-01-21 12:46:20 +12:00
make distclean
'' ;
2021-09-17 21:34:48 +10:00
2023-10-23 23:56:13 +09:00
preInstall = ( old . preInstall or " " ) + ''
2024-04-14 20:27:42 +02:00
mkdir - p $ out / $ { final . python . sitePackages }
2023-10-23 23:56:13 +09:00
'' ;
2022-01-21 12:46:20 +12:00
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.
2024-04-14 20:27:42 +02:00
++ lib . optional ( ! final . python ? modules ) pkgs . ncurses ;
2022-01-21 12:46:20 +12:00
} ) ;
2020-10-01 14:36:10 +02:00
2024-04-14 20:27:42 +02:00
dcli = prev . dcli . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2020-04-08 14:57:58 +12:00
2024-04-14 20:27:42 +02:00
ddtrace = prev . ddtrace . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++
2022-01-21 15:08:33 +12:00
( lib . optionals pkgs . stdenv . isDarwin [ pkgs . darwin . IOKit ] ) ;
2022-01-21 12:46:20 +12:00
} ) ;
2019-12-11 13:31:22 +01:00
2024-05-02 12:10:53 -04:00
deepspeed = prev . deepspeed . overridePythonAttrs ( old : rec {
2024-04-25 23:47:55 +00:00
CUDA_HOME = pkgs . symlinkJoin {
name = " d e e p s p e e d - c u d a - h o m e " ;
paths = [
pkgs . cudaPackages . libnvjitlink
pkgs . cudaPackages . libcufft
pkgs . cudaPackages . libcusparse
pkgs . cudaPackages . cuda_nvcc
] ;
} ;
2024-05-02 12:10:53 -04:00
buildInputs = old . buildInputs or [ ] ++ [ final . setuptools ] ;
2024-04-25 23:47:55 +00:00
LD_LIBRARY_PATH = " ${ CUDA_HOME } / l i b " ;
preBuild = ''
# Prevent the build from trying to access the default triton cache directory under /homeless-shelter
export TRITON_CACHE_DIR = $ TMPDIR
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
dictdiffer = prev . dictdiffer . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-07-14 14:33:53 +02:00
2024-04-14 20:27:42 +02:00
django = prev . django . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
old : {
propagatedNativeBuildInputs = ( old . propagatedNativeBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ pkgs . gettext final . pytest-runner ] ;
2023-10-26 12:18:24 +13:00
}
2022-01-21 12:46:20 +12:00
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
django-bakery = prev . django-bakery . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
configurePhase = ''
if ! test - e LICENSE ; then
touch LICENSE
fi
'' + ( o l d . c o n f i g u r e P h a s e o r " " ) ;
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
django-cors-headers = prev . django-cors-headers . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
django-hijack = prev . django-hijack . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
django-prometheus = prev . django-prometheus . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
django-rosetta = prev . django-rosetta . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
django-stubs-ext = prev . django-stubs-ext . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
prePatch = ( old . prePatch or " " ) + " t o u c h . . / L I C E N S E . t x t " ;
}
) ;
2022-01-20 11:54:26 +12:00
2024-04-14 20:27:42 +02:00
dlib = prev . dlib . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
# Parallel building enabled
inherit ( pkgs . python . pkgs . dlib ) patches ;
2019-12-11 13:31:22 +01:00
2022-01-21 12:46:20 +12:00
enableParallelBuilding = true ;
dontUseCmakeConfigure = true ;
2019-12-11 13:31:22 +01:00
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ pkgs . dlib . nativeBuildInputs ;
buildInputs = ( old . buildInputs or [ ] ) ++ pkgs . dlib . buildInputs ;
}
) ;
2019-12-11 13:31:22 +01:00
2022-04-15 22:58:46 +12:00
# Setuptools >= 60 broke build_py_2to3
docutils =
2024-04-14 20:27:42 +02:00
if lib . versionOlder prev . docutils . version " 0 . 1 6 " && lib . versionAtLeast prev . setuptools . version " 6 0 " then
2022-04-15 22:58:46 +12:00
(
2024-04-14 20:27:42 +02:00
prev . docutils . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-04-15 22:58:46 +12:00
SETUPTOOLS_USE_DISTUTILS = " s t d l i b " ;
}
)
2024-04-14 20:27:42 +02:00
) else prev . docutils ;
2022-04-15 22:58:46 +12:00
2024-04-14 20:27:42 +02:00
duckdb = prev . duckdb . overridePythonAttrs ( old : {
2023-01-07 06:55:46 -05:00
postPatch = lib . optionalString ( ! ( old . src . isWheel or false ) ) ''
2023-07-11 06:46:08 -07:00
$ { lib . optionalString ( lib . versionOlder old . version " 0 . 8 " ) " c d t o o l s / p y t h o n p k g " }
2023-04-29 19:44:12 +02:00
2022-12-12 06:34:05 -05:00
substituteInPlace setup . py \
- - replace ' multiprocessing . cpu_count ( ) ' " $ N I X _ B U I L D _ C O R E S " \
- - replace ' setuptools_scm < 7 .0 . 0 ' ' setuptools_scm'
'' ;
} ) ;
2022-01-21 12:46:20 +12:00
# Environment markers are not always included (depending on how a dep was defined)
2024-04-14 20:27:42 +02:00
enum34 = if final . pythonAtLeast " 3 . 4 " then null else prev . enum34 ;
2020-03-14 23:13:51 +00:00
2024-04-14 20:27:42 +02:00
eth-hash = prev . eth-hash . overridePythonAttrs {
2022-01-21 12:46:20 +12:00
preConfigure = ''
substituteInPlace setup . py - - replace \ ' setuptools-markdown \ ' " "
'' ;
} ;
2022-01-20 11:54:26 +12:00
2024-04-14 20:27:42 +02:00
eth-keyfile = prev . eth-keyfile . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
preConfigure = ''
substituteInPlace setup . py - - replace \ ' setuptools-markdown \ ' " "
'' ;
2023-05-21 14:41:28 +02:00
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2023-05-21 14:41:28 +02:00
} ) ;
2022-01-20 11:54:26 +12:00
2024-04-14 20:27:42 +02:00
eth-keys = prev . eth-keys . overridePythonAttrs {
2022-01-21 12:46:20 +12:00
preConfigure = ''
substituteInPlace setup . py - - replace \ ' setuptools-markdown \ ' " "
2022-01-20 11:54:26 +12:00
'' ;
2022-01-21 12:46:20 +12:00
} ;
2022-01-20 11:54:26 +12:00
2023-06-05 17:39:49 +02:00
# FIXME: this is a workaround for https://github.com/nix-community/poetry2nix/issues/1161
2024-04-14 20:27:42 +02:00
eth-utils = prev . eth-utils . override { preferWheel = true ; } ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
evdev = prev . evdev . overridePythonAttrs ( _old : {
2022-07-03 17:56:11 +10:00
preConfigure = ''
substituteInPlace setup . py - - replace /usr/include/linux $ { pkgs . linuxHeaders } /include/linux
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
faker = prev . faker . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
doCheck = false ;
}
) ;
2020-01-12 19:27:19 +00:00
2024-04-14 20:27:42 +02:00
fancycompleter = prev . fancycompleter . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2023-01-12 08:13:51 -05:00
postPatch = lib . optionalString ( ! ( old . src . isWheel or false ) ) ''
2022-01-21 12:46:20 +12:00
substituteInPlace setup . py \
2022-02-02 23:39:50 +00:00
- - replace ' setup_requires = " s e t u p m e t a " ' ' setup_requires = [ ] ' \
2022-02-01 20:33:37 +00:00
- - replace ' versioning = " d e v c o m m i t " ' ' version = " ${ old . version } " '
2022-01-21 12:46:20 +12:00
'' ;
}
) ;
2020-04-29 14:12:59 +01:00
2024-05-06 01:37:47 +00:00
fastapi = prev . fastapi . overridePythonAttrs ( old : {
# fastapi 0.111 depends on fastapi-cli, which depends on fastapi, resulting in infinite recursion
propagatedBuildInputs = builtins . filter ( i : i . pname != " f a s t a p i - c l i " ) old . propagatedBuildInputs ;
} ) ;
2024-04-14 20:27:42 +02:00
fastecdsa = prev . fastecdsa . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
buildInputs = old . buildInputs ++ [ pkgs . gmp . dev ] ;
} ) ;
2020-07-06 11:28:10 +02:00
2024-04-14 20:27:42 +02:00
fastparquet = prev . fastparquet . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-07-06 11:28:10 +02:00
2024-04-14 20:27:42 +02:00
file-magic = prev . file-magic . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-05-12 14:32:14 +02:00
postPatch = ''
substituteInPlace magic . py - - replace " f i n d _ l i b r a r y ( ' m a g i c ' ) " " ' ${ pkgs . file } / l i b / l i b m a g i c ${ pkgs . stdenv . hostPlatform . extensions . sharedLibrary } ' "
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
fiona = prev . fiona . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2023-01-07 06:55:46 -05:00
format = lib . optionalString ( ! ( old . src . isWheel or false ) ) " s e t u p t o o l s " ;
2024-03-09 12:10:18 -05:00
buildInputs = old . buildInputs or [ ] ++ [ gdal ] ;
2022-12-17 08:52:17 -05:00
nativeBuildInputs = old . nativeBuildInputs or [ ]
2023-01-07 06:55:46 -05:00
++ lib . optionals ( ( old . src . isWheel or false ) && ( ! pkgs . stdenv . isDarwin ) ) [ pkgs . autoPatchelfHook ]
2022-12-17 08:52:17 -05:00
# for gdal-config
2024-03-09 12:10:18 -05:00
++ [ gdal ] ;
2020-10-01 19:08:57 +02:00
}
2022-01-21 12:46:20 +12:00
) ;
2024-04-14 20:27:42 +02:00
flatbuffers = prev . flatbuffers . overrideAttrs ( old : {
2022-01-21 12:46:20 +12:00
VERSION = old . version ;
2020-10-01 19:08:57 +02:00
} ) ;
2020-08-24 21:31:48 +02:00
2024-05-02 12:10:53 -04:00
gdal = prev . gdal . overridePythonAttrs (
2024-03-09 12:10:18 -05:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ gdal ] ;
preBuild = ( old . preBuild or " " ) + ''
substituteInPlace setup . cfg \
- - replace " . . / . . / a p p s / g d a l - c o n f i g " ' $ { gdal } /bin/gdal-config '
'' ;
}
) ;
2020-08-31 11:15:36 +02:00
2024-05-02 12:10:53 -04:00
gdstk = prev . gdstk . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools pkgs . zlib pkgs . qhull ] ;
2024-04-12 00:05:16 +01:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . 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 = " h t t p s : / / g i t h u b . c o m / h e i t z m a n n / g d s t k / r a w / 5 7 c 9 e c e c 1 f 7 b c 2 3 4 5 1 8 2 b c f 3 8 3 6 0 2 a 7 9 2 0 2 6 a 2 8 b / c m a k e _ m o d u l e s / F i n d Q h u l l . c m a k e " ;
hash = " s h a 2 5 6 - l J N W A f S I t b g 7 j s H f e 7 g Z r y q J r u H j j M M 0 G X u d X a / S J u 4 = " ;
} } cmake_modules/FindQhull.cmake
fi
'' ;
} ) ;
2020-08-31 11:15:36 +02:00
2024-04-14 20:27:42 +02:00
gnureadline = prev . gnureadline . overridePythonAttrs (
2024-01-28 09:21:32 -05:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . ncurses ] ;
}
) ;
2024-04-14 20:27:42 +02:00
grandalf = prev . grandalf . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
doCheck = false ;
}
) ;
2020-10-03 14:58:23 +02:00
2024-04-14 20:27:42 +02:00
granian = prev . granian . overridePythonAttrs ( old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) )
2024-03-09 12:10:18 -05:00
(
let
githubHash = {
" 0 . 2 . 1 " = " s h a 2 5 6 - X E h u 6 M 1 h F i 3 / g A K Z c e i 7 K J S r I h h l Z h l v Z v b f y A 6 V L R 4 = " ;
" 0 . 2 . 2 " = " s h a 2 5 6 - K W w e f J 3 C f O U G C g A m 7 A h F l I x R F 9 q x N E o 3 n p G O x V J 2 3 F Y = " ;
" 0 . 2 . 3 " = " s h a 2 5 6 - 2 J n y O 0 w x k V 4 9 R / 0 w z D b / P n U W W H i 3 c k w K 4 n V e 7 d W e H 1 k = " ;
" 0 . 2 . 4 " = " s h a 2 5 6 - G d Q J v V P s W g C 1 z 7 L a 9 h 1 1 x 2 p R A P + L 9 9 8 y I m h T F r F T 5 l 8 = " ;
" 0 . 2 . 5 " = " s h a 2 5 6 - v M X M x s s 7 7 r m X S j o B 5 3 e E 8 X N 2 j X y I E f 0 3 W o Q i D f v h D m w = " ;
" 0 . 2 . 6 " = " s h a 2 5 6 - l 9 W 9 + K D g / 4 3 m c 0 t o E z 1 n 1 p q w + o Q d i H d A x G l S + K L I G h w = " ;
" 0 . 3 . 0 " = " s h a 2 5 6 - i c B j t W 8 f Z j T 3 m L o 4 3 n K W d i r M z 6 G Z I y / R g h E O 9 5 p H J E U = " ;
" 0 . 3 . 1 " = " s h a 2 5 6 - E K K + R x k J / / f Y 4 3 E j v N 1 F r y 7 m n 2 Z L I a N l T y K P J R x y K Z s = " ;
" 1 . 0 . 2 " = " s h a 2 5 6 - H O L i m D G V 0 7 8 Z J a d j y w b B g p Y I K R 2 j V k 9 Z A I t 0 k k 6 2 V a 4 = " ;
} . ${ old . version } or lib . fakeHash ;
# we can count on this repo's root to have Cargo.lock
2024-01-29 18:24:29 +02:00
2024-03-09 12:10:18 -05:00
src = pkgs . fetchFromGitHub {
owner = " e m m e t t - f r a m e w o r k " ;
repo = " g r a n i a n " ;
rev = " v ${ old . version } " ;
sha256 = githubHash ;
} ;
in
{
inherit src ;
cargoDeps = pkgs . rustPlatform . importCargoLock {
lockFile = " ${ src . out } / C a r g o . l o c k " ;
} ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkgs . rustPlatform . cargoSetupHook
pkgs . rustPlatform . maturinBuildHook
] ;
}
) ) ;
2023-01-16 22:09:10 +06:00
2024-04-14 20:27:42 +02:00
gitpython = prev . gitpython . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . typing-extensions ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-09-14 12:37:23 +02:00
2024-04-14 20:27:42 +02:00
grpcio = prev . grpcio . overridePythonAttrs ( old : {
2022-01-21 14:51:40 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . c-ares pkgs . openssl pkgs . zlib ] ;
2021-03-12 17:07:19 +11:00
2022-01-21 12:46:20 +12:00
outputs = [ " o u t " " d e v " ] ;
2021-05-06 23:53:19 -07:00
2022-01-21 12:46:20 +12:00
GRPC_BUILD_WITH_BORING_SSL_ASM = " " ;
GRPC_PYTHON_BUILD_SYSTEM_OPENSSL = 1 ;
GRPC_PYTHON_BUILD_SYSTEM_ZLIB = 1 ;
GRPC_PYTHON_BUILD_SYSTEM_CARES = 1 ;
DISABLE_LIBC_COMPATIBILITY = 1 ;
} ) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
grpcio-tools = prev . grpcio-tools . overridePythonAttrs ( _old : {
2022-01-21 12:46:20 +12:00
outputs = [ " o u t " " d e v " ] ;
} ) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
gunicorn = prev . gunicorn . overridePythonAttrs ( old : {
2022-09-29 20:39:37 +03:00
# actually needs setuptools as a runtime dependency
2023-08-10 17:28:34 +02:00
# 21.0.0 starts transition away from runtime dependency, starting with packaging
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools final . packaging ] ;
2022-09-29 20:39:37 +03:00
} ) ;
2024-04-14 20:27:42 +02:00
h3 = prev . h3 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
preBuild = ( old . preBuild or " " ) + ''
substituteInPlace h3/h3.py \
- - replace " ' { } / { } ' . f o r m a t ( _ d i r n a m e , l i b h 3 _ p a t h ) " ' " ${ pkgs . h3 } / l i b / l i b h 3 ${ pkgs . stdenv . hostPlatform . extensions . sharedLibrary } " '
'' ;
}
) ;
2022-01-07 16:32:04 +03:00
2024-04-14 20:27:42 +02:00
h5py = prev . h5py . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
if old . format != " w h e e l " then
(
let
2023-10-26 12:18:24 +13:00
inherit ( pkgs . hdf5 ) mpi ;
inherit ( pkgs . hdf5 ) mpiSupport ;
2022-01-21 12:46:20 +12:00
in
{
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
buildInputs =
( old . buildInputs or [ ] )
2024-04-08 11:20:00 +09:00
++ [ pkgs . hdf5 pkgs . pkg-config ]
2022-01-21 12:46:20 +12:00
++ lib . optional mpiSupport mpi
;
propagatedBuildInputs =
( old . propagatedBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ lib . optionals mpiSupport [ final . mpi4py pkgs . openssh ]
2022-01-21 12:46:20 +12:00
;
preBuild = if mpiSupport then " e x p o r t C C = ${ mpi } / b i n / m p i c c " else " " ;
HDF5_DIR = " ${ pkgs . hdf5 } " ;
HDF5_MPI = if mpiSupport then " O N " else " O F F " ;
# avoid strict pinning of numpy
postPatch = ''
substituteInPlace setup . py \
- - replace " n u m p y = = " " n u m p y > = "
'' ;
pythonImportsCheck = [ " h 5 p y " ] ;
}
) else old
) ;
2021-09-18 01:22:49 +10:00
2024-04-14 20:27:42 +02:00
hid = prev . hid . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
found =
for name in libhidapi-hidraw libhidapi-libusb libhidapi-iohidmanager libhidapi ; do
full_path = $ { pkgs . hidapi . out } /lib / $ name $ { pkgs . stdenv . hostPlatform . extensions . sharedLibrary }
if test - f $ full_path ; then
found = t
sed - i - e " s | ' $ n a m e \. . * ' | ' $ f u l l _ p a t h ' | " hid/__init__.py
fi
done
test - n " $ f o u n d " || { echo " E R R O R : N o k n o w n l i b r a r i e s f o u n d i n ${ pkgs . hidapi . out } / l i b , p l e a s e u p d a t e / f i x t h i s b u i l d e x p r e s s i o n . " ; exit 1 ; }
'' ;
}
) ;
2020-02-26 10:50:13 +01:00
2024-04-14 20:27:42 +02:00
hidapi = prev . hidapi . overridePythonAttrs (
2023-10-06 15:20:41 +02:00
old : {
2023-10-07 21:10:39 +02:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
2023-10-06 15:20:41 +02:00
pkgs . libusb1
] ;
postPatch = lib . optionalString stdenv . isLinux ''
libusb = $ { pkgs . libusb1 . dev } /include/libusb-1.0
test - d $ libusb || { echo " E R R O R : $ l i b u s b d o e s n ' t e x i s t , p l e a s e u p d a t e / f i x t h i s b u i l d e x p r e s s i o n . " ; exit 1 ; }
sed - i - e " s | / u s r / i n c l u d e / l i b u s b - 1 . 0 | $ l i b u s b | " setup . py
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
hikari = prev . hikari . overrideAttrs (
2022-11-12 10:22:28 +05:30
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-11-12 10:22:28 +05:30
}
) ;
2023-03-02 10:48:25 +05:30
2024-04-14 20:27:42 +02:00
hikari-lightbulb = prev . hikari-lightbulb . overrideAttrs (
2023-03-02 10:48:25 +05:30
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools ] ;
2023-03-02 10:48:25 +05:30
}
) ;
2023-03-02 12:14:01 +05:30
2024-04-14 20:27:42 +02:00
horovod = prev . horovod . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . mpi ] ;
}
) ;
2020-11-30 15:56:18 +02:00
2024-04-14 20:27:42 +02:00
httplib2 = prev . httplib2 . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . pyparsing ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2021-12-30 14:46:14 -08:00
2024-04-14 20:27:42 +02:00
icecream = prev . icecream . overridePythonAttrs ( _old : {
2022-01-21 12:46:20 +12:00
# # ERROR: Could not find a version that satisfies the requirement executing>=0.3.1 (from icecream) (from versions: none)
postPatch = ''
substituteInPlace setup . py - - replace ' executing >= 0 .3 . 1 ' ' executing'
'' ;
} ) ;
2022-01-18 11:19:43 +12:00
2024-04-14 20:27:42 +02:00
igraph = prev . igraph . overridePythonAttrs (
2022-01-27 20:36:21 -05:00
old : {
nativeBuildInputs = [ pkgs . cmake ] ++ old . nativeBuildInputs ;
dontUseCmakeConfigure = true ;
}
) ;
2024-04-14 20:27:42 +02:00
imagecodecs = prev . imagecodecs . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
patchPhase = ''
substituteInPlace setup . py \
- - replace " / u s r / i n c l u d e / o p e n j p e g - 2 . 3 " \
" ${ pkgs . openjpeg . dev } / i n c l u d e / ${ pkgs . openjpeg . dev . incDir }
substituteInPlace setup . py \
- - replace " / u s r / i n c l u d e / j x r l i b " \
" $ o u t / i n c l u d e / l i b j x r "
substituteInPlace imagecodecs/_zopfli.c \
- - replace ' " z o p f l i / z o p f l i . h " ' \
' <zopfli.h> '
substituteInPlace imagecodecs/_zopfli.c \
- - replace ' " z o p f l i / z l i b _ c o n t a i n e r . h " ' \
' <zlib_container.h> '
substituteInPlace imagecodecs/_zopfli.c \
- - replace ' " z o p f l i / g z i p _ c o n t a i n e r . h " ' \
' <gzip_container.h> '
'' ;
2021-11-22 01:37:27 +01:00
2022-01-21 12:46:20 +12:00
preBuild = ''
mkdir - p $ out/include/libjxr
ln - s $ { pkgs . jxrlib } /include/libjxr /* */ * $ out/include/libjxr
2020-06-01 12:42:33 +02:00
2022-01-21 12:46:20 +12:00
'' ;
2021-02-21 01:21:46 +11:00
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
# Commented out packages are declared required, but not actually
# needed to build. They are not yet packaged for nixpkgs.
# bitshuffle
pkgs . brotli
# brunsli
pkgs . bzip2
pkgs . c-blosc
# charls
pkgs . giflib
pkgs . jxrlib
pkgs . lcms
pkgs . libaec
pkgs . libaec
pkgs . libjpeg_turbo
# liblzf
# liblzma
pkgs . libpng
pkgs . libtiff
pkgs . libwebp
pkgs . lz4
pkgs . openjpeg
pkgs . snappy
# zfp
pkgs . zopfli
pkgs . zstd
pkgs . zlib
] ;
}
) ;
2019-11-28 02:24:33 +00:00
2022-01-21 12:46:20 +12:00
# importlib-metadata has an incomplete dependency specification
2024-04-14 20:27:42 +02:00
importlib-metadata = prev . importlib-metadata . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ lib . optional final . python . isPy2 final . pathlib2 ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-20 11:54:26 +12:00
2024-04-14 20:27:42 +02:00
intreehooks = prev . intreehooks . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
doCheck = false ;
}
) ;
2020-08-19 22:59:13 -05:00
2024-04-14 20:27:42 +02:00
ipython = prev . ipython . overridePythonAttrs (
2022-10-07 09:37:55 +03:00
old : {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-10-07 09:37:55 +03:00
}
) ;
2024-04-14 20:27:42 +02:00
isort = prev . isort . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-12 17:33:24 +13:00
2024-04-14 20:27:42 +02:00
jaraco-functools = prev . jaraco-functools . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
# required for the extra "toml" dependency in setuptools_scm[toml]
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . toml
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2020-03-30 02:44:26 +01:00
2024-04-14 20:27:42 +02:00
trio = prev . trio . overridePythonAttrs ( old : {
2023-02-06 10:37:47 +08:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ final . async-generator final . idna ] ;
2023-02-06 10:37:47 +08:00
} ) ;
2024-04-14 20:27:42 +02:00
jeepney = prev . jeepney . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . outcome final . trio ] ;
2023-02-03 16:13:34 +13:00
} ) ;
2024-04-14 20:27:42 +02:00
jinja2-ansible-filters = prev . jinja2-ansible-filters . overridePythonAttrs (
2022-05-07 19:29:50 -07:00
old : {
preBuild = ( old . preBuild or " " ) + ''
echo " ${ old . version } " > VERSION
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
jira = prev . jira . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
inherit ( pkgs . python3Packages . jira ) patches ;
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . pytestrunner
final . cryptography
final . pyjwt
final . setuptools-scm-git-archive
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2020-03-30 02:09:51 +01:00
2024-04-14 20:27:42 +02:00
pyviz-comms = prev . pyviz-comms . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools >= 40 .8 .0 , < 6 1 ' ' setuptools'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
jq = prev . jq . overridePythonAttrs ( attrs : {
2022-01-21 12:46:20 +12:00
buildInputs = [ pkgs . jq ] ;
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = [ final . certifi final . requests ] ;
2023-10-24 08:44:34 -04:00
patches = lib . optionals ( lib . versionOlder attrs . version " 1 . 2 . 3 " ) [
2022-01-21 12:46:20 +12:00
( pkgs . fetchpatch {
url = " h t t p s : / / r a w . g i t h u b u s e r c o n t e n t . c o m / N i x O S / n i x p k g s / 0 8 8 d a 8 7 3 5 f 6 6 2 0 b 6 0 d 7 2 4 a a 7 d b 7 4 2 6 0 7 e a 2 1 6 0 8 7 / p k g s / d e v e l o p m e n t / p y t h o n - m o d u l e s / j q / j q - p y - s e t u p . p a t c h " ;
sha256 = " s h a 2 5 6 - M Y v X 3 S 1 Y G e 0 Q s U t E x t O t U L v p + + A d V r v + F i d 4 J h 1 x e w Q = " ;
} )
] ;
} ) ;
2020-10-01 19:08:57 +02:00
2023-06-27 13:52:24 -07:00
jsondiff =
2024-04-14 20:27:42 +02:00
if lib . versionOlder prev . jsondiff . version " 2 . 0 . 0 "
2023-06-27 13:52:24 -07:00
then
2024-04-14 20:27:42 +02:00
prev . jsondiff . overridePythonAttrs
2023-06-27 13:52:24 -07:00
(
old : {
preBuild = lib . optionalString ( ! ( old . src . isWheel or false ) ) (
( old . preBuild or " " ) + ''
substituteInPlace setup . py \
- - replace " ' j s o n d i f f = j s o n d i f f . c l i : m a i n _ d e p r e c a t e d ' , " " "
''
) ;
}
)
2024-04-14 20:27:42 +02:00
else prev . jsondiff ;
2020-03-30 02:09:51 +01:00
2024-04-14 20:27:42 +02:00
jsonslicer = prev . jsonslicer . overridePythonAttrs ( old : {
2023-12-05 22:59:10 +01:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . pkg-config ] ;
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . yajl ] ;
} ) ;
2019-12-11 13:31:22 +01:00
2022-09-02 13:32:04 +12:00
jsonschema =
2024-04-14 20:27:42 +02:00
if lib . versionAtLeast prev . jsonschema . version " 4 . 0 . 0 "
2022-09-02 13:32:04 +12:00
then
2024-04-14 20:27:42 +02:00
prev . jsonschema . overridePythonAttrs
2022-09-02 13:32:04 +12:00
( old : {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . importlib-resources ] ;
postPatch = old . postPatch or " " + lib . optionalString ( ! ( old . src . isWheel or false ) && ( lib . versionAtLeast prev . jsonschema . version " 4 . 1 8 . 0 " ) ) ''
2023-07-08 00:21:50 +03:00
sed - i " / T o p i c : : F i l e F o r m a t s : : J S O N / d " pyproject . toml
'' ;
2022-09-02 13:32:04 +12:00
} )
2024-04-14 20:27:42 +02:00
else prev . jsonschema ;
2022-09-02 13:32:04 +12:00
2024-04-14 20:27:42 +02:00
jsonschema-specifications = prev . jsonschema-specifications . overridePythonAttrs ( old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-07-08 00:21:50 +03:00
postPatch = old . postPatch or " " + ''
sed - i " / T o p i c : : F i l e F o r m a t s : : J S O N / d " pyproject . toml
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
jupyter = prev . jupyter . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
# jupyter is a meta-package. Everything relevant comes from the
# dependencies. It does however have a jupyter.py file that conflicts
# with jupyter-core so this meta solves this conflict.
meta . priority = 100 ;
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
jupyter-packaging = prev . jupyter-packaging . overridePythonAttrs ( old : {
2023-10-23 12:23:59 -04:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . setuptools
final . wheel
final . packaging
2023-10-23 12:23:59 -04:00
] ;
2022-03-28 23:41:14 +02:00
} ) ;
2024-04-14 20:27:42 +02:00
jupyter-server = prev . jupyter-server . overridePythonAttrs ( old : {
buildInputs = old . buildInputs or [ ] ++ [ final . hatch-jupyter-builder ] ;
2023-02-06 12:40:15 +08:00
} ) ;
2024-04-14 20:27:42 +02:00
nbclassic = prev . nbclassic . overridePythonAttrs ( old : {
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [ final . babel ] ;
2023-10-23 12:23:59 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
jupyterlab-pygments = prev . jupyterlab-pygments . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
# remove the dependency cycle (why does jupyter-pygments depend on
# jupyterlab?)
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' , " j u p y t e r l a b ~ = 3 . 1 " ' " "
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
jupyterlab-widgets = prev . jupyterlab-widgets . overridePythonAttrs (
2022-09-29 20:39:37 +03:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = old . buildInputs or [ ] ++ [ final . jupyter-packaging ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
kerberos = prev . kerberos . overrideAttrs ( old : {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . libkrb5 ] ;
} ) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
keyring = prev . keyring . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . toml
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
kiwisolver = prev . kiwisolver . overridePythonAttrs (
2020-10-01 19:08:57 +02:00
old : {
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . cppy
2020-10-01 19:08:57 +02:00
] ;
}
) ;
2020-02-26 18:55:41 +01:00
2024-04-14 20:27:42 +02:00
lap = prev . lap . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . numpy
2022-01-21 12:46:20 +12:00
] ;
2020-05-19 21:06:02 +01:00
}
2022-01-21 12:46:20 +12:00
) ;
2019-11-29 11:24:53 +01:00
2024-04-14 20:27:42 +02:00
libarchive = prev . libarchive . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools ] ;
2023-02-03 12:43:38 +01:00
postPatch = ''
substituteInPlace libarchive/library.py - - replace \
" _ F I L E P A T H = f i n d _ a n d _ l o a d _ l i b r a r y ( ) " " _ F I L E P A T H = ' ${ pkgs . libarchive . lib } / l i b / l i b a r c h i v e ${ stdenv . hostPlatform . extensions . sharedLibrary } ' "
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
libvirt-python = prev . libvirt-python . overridePythonAttrs ( { nativeBuildInputs ? [ ] , . . . }: {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = nativeBuildInputs ++ [ pkg-config ] ;
propagatedBuildInputs = [ pkgs . libvirt ] ;
} ) ;
2020-01-13 00:24:05 +00:00
2024-04-14 20:27:42 +02:00
lightgbm = prev . lightgbm . overridePythonAttrs (
2022-06-12 23:28:39 -05:00
old : {
nativeBuildInputs = [ pkgs . cmake ] ++ old . nativeBuildInputs ;
dontUseCmakeConfigure = true ;
2022-06-15 12:01:36 -05:00
postConfigure = ''
export HOME = $ ( mktemp - d )
'' ;
2022-06-12 23:28:39 -05:00
}
) ;
2024-04-14 20:27:42 +02:00
llama-cpp-python = prev . llama-cpp-python . overridePythonAttrs (
2023-05-02 21:48:58 -07:00
old : {
buildInputs = with pkgs ; lib . optionals stdenv . isDarwin [
darwin . apple_sdk . frameworks . Accelerate
] ;
nativeBuildInputs = [ pkgs . cmake ] ++ ( old . nativeBuildInputs or [ ] ) ;
preBuild = ''
cd " $ O L D P W D "
'' ;
}
) ;
2024-05-03 11:48:28 -05:00
llama-index = prev . llama-index . overridePythonAttrs ( _old : {
postInstall = ''
# Conflicts with same file from `llama-index-cli`
rm - f $ out/bin/llamaindex-cli
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
llvmlite = prev . llvmlite . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
let
2023-05-19 13:14:08 +03:00
# see https://github.com/numba/llvmlite#compatibility
llvm_version = toString (
if lib . versionAtLeast old . version " 0 . 4 0 . 0 " then 14
else if lib . versionAtLeast old . version " 0 . 3 7 . 0 " then 11
else if lib . versionAtLeast old . version " 0 . 3 4 . 0 " && ! stdenv . buildPlatform . isAarch64 then 10
else if lib . versionAtLeast old . version " 0 . 3 3 . 0 " then 9
else if lib . versionAtLeast old . version " 0 . 2 9 . 0 " then 8
else if lib . versionAtLeast old . version " 0 . 2 7 . 0 " then 7
else if lib . versionAtLeast old . version " 0 . 2 3 . 0 " then 6
else if lib . versionAtLeast old . version " 0 . 2 1 . 0 " then 5
else 4
) ;
llvm = pkgs . " l l v m P a c k a g e s _ ${ llvm_version } " . llvm or ( throw " L L V M ${ llvm_version } h a s b e e n r e m o v e d f r o m n i x p k g s ; u p g r a d e l l v m l i t e o r u s e o l d e r n i x p k g s " ) ;
2022-01-21 12:46:20 +12:00
in
2024-03-25 15:47:39 -07:00
lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-05-19 13:14:08 +03:00
inherit llvm ;
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . llvmlite . llvm ] ;
2020-05-19 21:06:02 +01:00
2024-01-01 22:38:14 -05:00
# Static linking
2022-01-21 12:46:20 +12:00
# https://github.com/numba/llvmlite/issues/93
2024-01-01 22:38:14 -05:00
# was disabled by default in
# https://github.com/numba/llvmlite/pull/250
2021-03-12 17:07:19 +11:00
2022-01-21 12:46:20 +12:00
# Set directory containing llvm-config binary
preConfigure = ''
export LLVM_CONFIG = $ { llvm . dev } /bin/llvm-config
'' ;
2020-05-19 21:06:02 +01:00
2022-01-21 12:46:20 +12:00
__impureHostDeps = lib . optionals pkgs . stdenv . isDarwin [ " / u s r / l i b / l i b m . d y l i b " ] ;
2020-05-19 21:06:02 +01:00
2023-10-26 12:18:24 +13:00
passthru = old . passthru // { inherit llvm ; } ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-14 16:51:34 +00:00
2022-04-29 03:21:45 +12:00
lsassy =
2024-04-14 20:27:42 +02:00
if prev . lsassy . version = = " 3 . 1 . 1 " then
prev . lsassy . overridePythonAttrs
2022-04-29 03:21:45 +12:00
( old : {
# pyproject.toml contains a constraint `rich = "^10.6.0"` which is not replicated in setup.py
# hence pypi misses it and poetry pins rich to 11.0.0
preConfigure = ( old . preConfigure or " " ) + ''
rm pyproject . toml
'' ;
2024-04-14 20:27:42 +02:00
} ) else prev . lsassy ;
2022-04-29 03:21:45 +12:00
2024-05-02 12:10:53 -04:00
lxml = prev . lxml . overridePythonAttrs (
2024-03-09 12:10:18 -05:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
nativeBuildInputs = with pkgs . buildPackages ;
old . nativeBuildInputs or [ ]
++ [ pkg-config libxml2 . dev libxslt . dev ]
++ lib . optionals stdenv . isDarwin [ xcodebuild ] ;
buildInputs = old . buildInputs or [ ] ++ [ pkgs . libxml2 pkgs . libxslt ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-21 10:20:47 +12:00
2024-04-14 20:27:42 +02:00
m2crypto = prev . m2crypto . overridePythonAttrs (
2024-01-31 17:14:03 +02:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . swig ] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . openssl ] ;
}
) ;
2024-04-14 20:27:42 +02:00
markdown-it-py = prev . markdown-it-py . overridePythonAttrs (
2023-05-17 09:47:37 -07:00
old : {
propagatedBuildInputs = builtins . filter ( i : i . pname != " m d i t - p y - p l u g i n s " ) old . propagatedBuildInputs ;
2023-05-20 05:59:30 -04:00
preConfigure = lib . optionalString ( ! ( old . src . isWheel or false ) ) (
( old . preConfigure or " " ) + ''
substituteInPlace pyproject . toml - - replace ' plugins = [ " m d i t - p y - p l u g i n s " ] ' ' plugins = [ ] '
''
) ;
2023-05-17 09:47:37 -07:00
}
) ;
2024-04-14 20:27:42 +02:00
markupsafe = prev . markupsafe . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
src = old . src . override { pname = builtins . replaceStrings [ " m a r k u p s a f e " ] [ " M a r k u p S a f e " ] old . pname ; } ;
}
) ;
2020-01-21 11:43:44 +00:00
2024-04-14 20:27:42 +02:00
matplotlib = prev . matplotlib . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
let
enableGhostscript = old . passthru . args . enableGhostscript or false ;
enableGtk3 = old . passthru . args . enableGtk3 or false ;
enableQt = old . passthru . args . enableQt or false ;
enableTk = old . passthru . args . enableTk or false ;
2022-01-19 09:42:17 +03:00
2022-01-21 12:46:20 +12:00
interactive = enableTk || enableGtk3 || enableQt ;
2021-02-21 01:21:46 +11:00
2022-01-22 01:42:48 +12:00
passthru = {
config = {
directories = { basedirlist = " . " ; } ;
libs = {
system_freetype = true ;
system_qhull = true ;
} // lib . optionalAttrs stdenv . isDarwin {
# LTO not working in darwin stdenv, see Nixpkgs #19312
enable_lto = false ;
} ;
} ;
} ;
2022-01-21 12:46:20 +12:00
inherit ( pkgs ) tk tcl wayland qhull ;
inherit ( pkgs . xorg ) libX11 ;
inherit ( pkgs . darwin . apple_sdk . frameworks ) Cocoa ;
in
{
XDG_RUNTIME_DIR = " / t m p " ;
2021-05-07 09:47:48 +09:00
2022-01-22 01:42:48 +12:00
buildInputs = old . buildInputs or [ ] ++ [
pkgs . which
2022-12-11 02:24:16 +13:00
] ++ lib . optionals enableGhostscript [
2022-01-22 01:42:48 +12:00
pkgs . ghostscript
2022-12-11 02:24:16 +13:00
] ++ lib . optionals stdenv . isDarwin [
2022-01-22 01:42:48 +12:00
Cocoa
2024-04-14 20:27:42 +02:00
] ++ lib . optionals ( lib . versionAtLeast prev . matplotlib . version " 3 . 7 . 0 " ) [
final . pybind11
2022-01-22 01:42:48 +12:00
] ;
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . certifi
2022-01-22 01:42:48 +12:00
pkgs . libpng
pkgs . freetype
qhull
]
2024-04-14 20:27:42 +02:00
++ lib . optionals enableGtk3 [ pkgs . cairo final . pycairo pkgs . gtk3 pkgs . gobject-introspection final . pygobject3 ]
++ lib . optionals enableTk [ pkgs . tcl pkgs . tk final . tkinter pkgs . libX11 ]
++ lib . optionals enableQt [ final . pyqt5 ]
2022-01-22 01:42:48 +12:00
;
2022-01-14 12:21:26 +00:00
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkg-config
2024-04-14 20:27:42 +02:00
] ++ lib . optionals ( lib . versionAtLeast prev . matplotlib . version " 3 . 5 . 0 " ) [
final . setuptools-scm
2022-01-21 12:46:20 +12:00
] ;
2022-01-06 05:30:14 +13:00
2022-10-07 09:37:55 +03:00
# Clang doesn't understand -fno-strict-overflow, and matplotlib builds with -Werror
hardeningDisable = if stdenv . isDarwin then [ " s t r i c t o v e r f l o w " ] else [ ] ;
2022-01-22 01:42:48 +12:00
passthru = old . passthru or { } // passthru ;
2022-01-21 12:46:20 +12:00
2022-01-22 01:42:48 +12:00
MPLSETUPCFG = pkgs . writeText " m p l s e t u p . c f g " ( lib . generators . toINI { } passthru . config ) ;
2021-05-18 14:48:41 +12:00
2022-01-21 12:46:20 +12:00
# Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the
# corresponding interpreter object for its library paths. This fails if
# `$DISPLAY` is not set. The fallback option assumes that Tcl/Tk are both
# installed under the same path which is not true in Nix.
# With the following patch we just hard-code these paths into the install
# script.
postPatch =
let
tcl_tk_cache = '' " ${ tk } / l i b " , " ${ tcl } / l i b " , " ${ lib . strings . substring 0 3 tk . version } " '' ;
in
lib . optionalString enableTk ''
2024-04-14 20:27:42 +02:00
sed - i ' /final.tcl_tk_cache = None/s | None | $ { tcl_tk_cache } | ' setupext . py
2022-01-21 12:46:20 +12:00
'' + l i b . o p t i o n a l S t r i n g ( s t d e n v . i s L i n u x & & i n t e r a c t i v e ) ''
# fix paths to libraries in dlopen calls (headless detection)
substituteInPlace src/_c_internal_utils.c \
- - replace libX11 . so .6 $ { libX11 } /lib/libX11.so.6 \
- - replace libwayland-client . so .0 $ { wayland } /lib/libwayland-client.so.0
2022-01-22 01:42:48 +12:00
'' +
# avoid matplotlib trying to download dependencies
''
echo " [ l i b s ]
system_freetype = true
system_qhull = true " > m p l s e t u p . c f g
2022-01-21 12:46:20 +12:00
'' ;
2020-10-17 14:44:47 +00:00
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-18 15:45:06 +12:00
2024-04-14 20:27:42 +02:00
mccabe = prev . mccabe . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
doCheck = false ;
}
) ;
2021-02-21 12:43:13 +01:00
2024-04-14 20:27:42 +02:00
mip = prev . mip . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . autoPatchelfHook ] ;
2020-01-21 11:43:44 +00:00
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . zlib final . cppy ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-01-21 11:43:44 +00:00
2024-04-14 20:27:42 +02:00
mmdet = prev . mmdet . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytorch ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-01-13 00:24:05 +00:00
2022-01-21 12:46:20 +12:00
molecule =
2024-04-14 20:27:42 +02:00
if lib . versionOlder prev . molecule . version " 3 . 0 . 0 " then
( prev . molecule . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
patches = ( old . patches or [ ] ) ++ [
# Fix build with more recent setuptools versions
( pkgs . fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / a n s i b l e - c o m m u n i t y / m o l e c u l e / c o m m i t / c 9 f e e 4 9 8 6 4 6 a 7 0 2 c 7 7 b 5 a e c f 6 4 9 7 c f f 3 2 4 a c d 0 5 6 . p a t c h " ;
sha256 = " 1 g 1 n 4 5 i z d z 0 a 3 c 9 a k g x x 1 4 z h d w 6 c 3 d k b 4 8 j 8 p q 6 4 n 8 2 f a 6 n d l 1 b 7 " ;
excludes = [ " p y p r o j e c t . t o m l " ] ;
} )
] ;
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools final . setuptools-scm ] ;
2022-01-21 12:46:20 +12:00
}
) ) else
2024-05-02 12:10:53 -04:00
prev . molecule . overridePythonAttrs ( old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools final . setuptools-scm ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2020-04-29 14:12:59 +01:00
2024-04-14 20:27:42 +02:00
msgpack = prev . msgpack . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' Cython ~ = 3 .0 . 0 ' ' Cython'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
munch = prev . munch . overridePythonAttrs (
2023-04-17 15:09:03 -07:00
old : {
# Latest version of pypi imports pkg_resources at runtime, so setuptools is needed at runtime. :(
# They fixed this last year but never released a new version.
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2023-04-17 15:09:03 -07:00
}
) ;
2024-04-14 20:27:42 +02:00
mpi4py = prev . mpi4py . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
let
cfg = pkgs . writeTextFile {
name = " m p i . c f g " ;
2023-10-26 12:18:24 +13:00
text = lib . generators . toINI
{ }
{
mpi = {
mpicc = " ${ pkgs . mpi . outPath } / b i n / m p i c c " ;
} ;
} ;
2022-01-21 12:46:20 +12:00
} ;
in
{
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . mpi ] ;
enableParallelBuilding = true ;
preBuild = ''
ln - sf $ { cfg } mpi . cfg
'' ;
}
) ;
2020-05-19 21:06:02 +01:00
2024-04-14 20:27:42 +02:00
multiaddr = prev . multiaddr . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-05-19 21:06:02 +01:00
2024-04-14 20:27:42 +02:00
mypy = prev . mypy . overridePythonAttrs (
2023-04-25 10:03:04 +02:00
old :
let
# Compile mypy with mypyc, which makes mypy about 4 times faster. The compiled
# version is also the default in the wheels on Pypi that include binaries.
# is64bit: unfortunately the build would exhaust all possible memory on i686-linux.
MYPY_USE_MYPYC = stdenv . buildPlatform . is64bit ;
envAttrs =
if old ? env
then { env = old . env // { inherit MYPY_USE_MYPYC ; } ; }
else { inherit MYPY_USE_MYPYC ; } ;
in
{
2022-05-09 20:36:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . types-typed-ast
final . types-setuptools
2022-12-01 20:32:17 +13:00
]
2024-04-14 20:27:42 +02:00
++ lib . optional ( lib . strings . versionAtLeast old . version " 0 . 9 9 0 " ) final . types-psutil
2022-12-01 20:32:17 +13:00
;
2022-05-09 20:36:20 +12:00
# when testing reduce optimisation level to drastically reduce build time
# (default is 3)
# MYPYC_OPT_LEVEL = 1;
2023-04-25 10:03:04 +02:00
} // envAttrs // lib . optionalAttrs ( old . format != " w h e e l " ) {
2022-03-21 16:55:07 -07:00
# FIXME: Remove patch after upstream has decided the proper solution.
# https://github.com/python/mypy/pull/11143
patches = ( old . patches or [ ] ) ++ lib . optionals ( ( lib . strings . versionAtLeast old . version " 0 . 9 0 0 " ) && lib . strings . versionOlder old . version " 0 . 9 4 0 " ) [
2022-01-25 10:10:39 -08:00
( pkgs . fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / f 1 7 5 5 2 5 9 d 5 4 3 3 0 c d 0 8 7 c a e 7 6 3 c d 5 b b b f f 2 6 e 3 e 8 a . p a t c h " ;
sha256 = " s h a 2 5 6 - 5 g P a h X 2 X 6 + / q U a q D Q I G J G v h 9 l Q 2 E D t k s 2 c p Q u t g b O H k = " ;
} )
2022-05-27 14:14:56 -07:00
] ++ lib . optionals ( ( lib . strings . versionAtLeast old . version " 0 . 9 4 0 " ) && lib . strings . versionOlder old . version " 0 . 9 6 0 " ) [
2022-03-21 16:55:07 -07:00
( pkgs . fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / e 7 8 6 9 f 0 5 7 5 1 5 6 1 9 5 8 b 9 4 6 b 5 6 2 0 9 3 3 9 7 0 2 7 f 6 d 5 f a . p a t c h " ;
sha256 = " s h a 2 5 6 - w a I Z + m 3 t f v Y E 4 H J 8 k L 6 r N / C 4 f M j v L E e 9 U o P b t 9 m H W I M = " ;
} )
2022-07-23 15:30:19 -05:00
] ++ lib . optionals ( ( lib . strings . versionAtLeast old . version " 0 . 9 6 0 " ) && ( lib . strings . versionOlder old . version " 0 . 9 7 1 " ) ) [
2022-05-27 14:14:56 -07:00
( pkgs . fetchpatch {
2022-06-09 17:52:34 -07:00
url = " h t t p s : / / g i t h u b . c o m / p y t h o n / m y p y / c o m m i t / 2 0 0 4 a e 0 2 3 b 9 d 3 6 2 8 d 9 f 0 9 8 8 6 c b b c 2 0 8 6 8 a e e 8 5 5 4 . p a t c h " ;
sha256 = " s h a 2 5 6 - y + t X v g y i E C O 5 + 6 6 Y L v a j e 8 B z 5 i P v f W N I B J c s n Z 2 n O d I = " ;
2022-05-27 14:14:56 -07:00
} )
2022-01-25 10:10:39 -08:00
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-04-29 14:12:59 +01:00
2024-04-14 20:27:42 +02:00
mysqlclient = prev . mysqlclient . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2023-10-02 15:58:43 +00:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . pkg-config pkgs . libmysqlclient ] ;
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . libmysqlclient ] ;
}
) ;
2020-05-19 21:06:02 +01:00
2024-03-25 15:47:39 -07:00
numba = prev . numba . overridePythonAttrs (
old : {
autoPatchelfIgnoreMissingDeps = old . src . isWheel or false ;
}
) ;
2024-04-14 20:27:42 +02:00
netcdf4 = prev . netcdf4 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
pkgs . zlib
pkgs . netcdf
pkgs . hdf5
pkgs . curl
pkgs . libjpeg
] ;
2020-05-19 21:06:02 +01:00
2022-01-21 12:46:20 +12:00
# Variables used to configure the build process
USE_NCCONFIG = " 0 " ;
HDF5_DIR = lib . getDev pkgs . hdf5 ;
NETCDF4_DIR = pkgs . netcdf ;
CURL_DIR = pkgs . curl . dev ;
JPEG_DIR = pkgs . libjpeg . dev ;
}
) ;
2020-05-19 21:06:02 +01:00
2024-04-14 20:27:42 +02:00
numpy = prev . numpy . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
let
blas = old . passthru . args . blas or pkgs . openblasCompat ;
blasImplementation = lib . nameFromURL blas . name " - " ;
cfg = pkgs . writeTextFile {
name = " s i t e . c f g " ;
2023-10-26 12:18:24 +13:00
text = lib . generators . toINI
{ }
{
$ { blasImplementation } = {
include_dirs = " ${ blas } / i n c l u d e " ;
library_dirs = " ${ blas } / l i b " ;
} // lib . optionalAttrs ( blasImplementation = = " m k l " ) {
mkl_libs = " m k l _ r t " ;
lapack_libs = " " ;
} ;
} ;
2022-01-21 12:46:20 +12:00
} ;
in
{
2022-10-07 09:37:55 +03:00
# fails to build with format=pyproject and setuptools >= 65
2024-03-09 12:10:18 -05:00
format =
if ( ( old . format or null ) = = " p o e t r y 2 n i x " ) then
" s e t u p t o o l s "
else
old . format or null ;
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . gfortran ] ;
2022-01-21 14:51:40 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ blas ] ;
2022-01-21 12:46:20 +12:00
enableParallelBuilding = true ;
preBuild = ''
ln - s $ { cfg } site . cfg
'' ;
2023-02-28 12:04:07 +01:00
preConfigure = ''
export NPY_NUM_BUILD_JOBS = $ NIX_BUILD_CORES
'' ;
2022-01-21 12:46:20 +12:00
passthru = old . passthru // {
2023-10-26 12:18:24 +13:00
inherit blas ;
2022-01-21 12:46:20 +12:00
inherit blasImplementation cfg ;
} ;
}
) ;
2020-02-27 17:44:17 +00:00
2023-08-22 18:53:01 +08:00
notebook =
2024-04-14 20:27:42 +02:00
if ( lib . versionAtLeast prev . notebook . version " 7 . 0 . 0 " ) then
prev . notebook . overridePythonAttrs
2023-10-26 12:18:24 +13:00
( old : {
2023-08-22 18:53:01 +08:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
prev . hatchling
prev . hatch-jupyter-builder
2023-08-22 18:53:01 +08:00
] ;
# notebook requires jlpm which is in jupyterlab
# https://github.com/jupyterlab/jupyterlab/blob/main/jupyterlab/jlpmapp.py
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
prev . jupyterlab
2023-08-22 18:53:01 +08:00
] ;
2024-04-14 20:27:42 +02:00
} ) else prev . notebook ;
2023-08-22 18:53:01 +08:00
2024-05-05 08:59:11 -04:00
nvidia-cudnn-cu11 = prev . nvidia-cudnn-cu11 . overridePythonAttrs ( attrs : {
2023-04-06 16:27:16 -07:00
propagatedBuildInputs = attrs . propagatedBuildInputs or [ ] ++ [
2024-05-05 08:59:11 -04:00
final . nvidia-cublas-cu11
2023-04-06 16:27:16 -07:00
] ;
} ) ;
2024-03-25 15:47:39 -07:00
nvidia-cudnn-cu12 = prev . nvidia-cudnn-cu12 . overridePythonAttrs ( attrs : {
2024-03-05 14:15:46 +01:00
propagatedBuildInputs = attrs . propagatedBuildInputs or [ ] ++ [
2024-05-05 08:59:11 -04:00
final . nvidia-cublas-cu12
2024-03-05 14:15:46 +01:00
] ;
2023-04-06 16:27:16 -07:00
} ) ;
2024-05-05 08:59:11 -04:00
nvidia-cusolver-cu11 = prev . nvidia-cusolver-cu11 . overridePythonAttrs ( attrs : {
2024-03-05 14:15:46 +01:00
propagatedBuildInputs = attrs . propagatedBuildInputs or [ ] ++ [
2024-05-05 08:59:11 -04:00
final . nvidia-cublas-cu11
2024-03-05 14:15:46 +01:00
] ;
} ) ;
2024-03-25 15:47:39 -07:00
nvidia-cusolver-cu12 = prev . nvidia-cusolver-cu12 . overridePythonAttrs ( attrs : {
2024-03-05 14:15:46 +01:00
propagatedBuildInputs = attrs . propagatedBuildInputs or [ ] ++ [
2024-05-05 08:59:11 -04:00
final . nvidia-cublas-cu12
2023-04-06 16:27:16 -07:00
] ;
} ) ;
2024-04-14 20:27:42 +02:00
omegaconf = prev . omegaconf . overridePythonAttrs (
2022-09-25 15:01:06 +01:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . jdk ] ;
}
) ;
2024-05-02 12:10:53 -04:00
open3d = prev . open3d . overridePythonAttrs ( old : {
2024-03-09 12:10:18 -05:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-05-02 12:10:53 -04:00
final . ipywidgets
2024-03-09 12:10:18 -05:00
] ;
2022-10-06 13:48:32 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . libusb1
2022-12-07 15:15:40 +01:00
] ++ lib . optionals stdenv . isLinux [
pkgs . udev
2024-04-14 20:27:42 +02:00
] ++ lib . optionals ( lib . versionAtLeast prev . open3d . version " 0 . 1 6 . 0 " && ! pkgs . mesa . meta . broken ) [
2022-10-31 14:19:09 +01:00
pkgs . mesa
2024-04-14 20:27:42 +02:00
] ++ lib . optionals ( lib . versionAtLeast prev . open3d . version " 0 . 1 6 . 0 " ) [
2022-10-31 14:19:09 +01:00
(
pkgs . symlinkJoin {
name = " l l v m - w i t h - u b u n t u - c o m p a t i b l e - s y m l i n k " ;
2024-03-09 12:10:18 -05:00
paths =
let
llvmVersion = " 1 2 " ;
llvmPkg = pkgs . " l l v m _ ${ llvmVersion } " ;
in
[
llvmPkg . lib
( pkgs . runCommand " l l v m - u b u n t u - c o m p a t i b l e - s y m l i n k " { }
''
mkdir - p " $ o u t / l i b / " ;
ln - s " ${ llvmPkg . lib } / l i b / l i b L L V M - ${ llvmVersion } . s o " " $ o u t / l i b / l i b L L V M - ${ llvmVersion } . s o . 1 "
''
)
] ;
}
)
2022-12-07 15:15:40 +01:00
] ;
2022-12-08 16:17:33 +01:00
# Patch the dylib in the binary distribution to point to the nix build of libomp
2024-04-14 20:27:42 +02:00
preFixup = lib . optionalString ( stdenv . isDarwin && lib . versionAtLeast prev . open3d . version " 0 . 1 6 . 0 " ) ''
2024-03-09 12:10:18 -05:00
install_name_tool - change \
/opt/homebrew/opt/libomp/lib/libomp.dylib \
$ { pkgs . llvmPackages . openmp } /lib/libomp.dylib \
$ out/lib/python * /site-packages/open3d/cpu/pybind.cpython- * - darwin . so
2022-12-08 16:17:33 +01:00
'' ;
2022-03-28 23:41:14 +02:00
# TODO(Sem Mulder): Add overridable flags for CUDA/PyTorch/Tensorflow support.
autoPatchelfIgnoreMissingDeps = true ;
} ) ;
2024-04-14 20:27:42 +02:00
openbabel-wheel = prev . openbabel-wheel . override { preferWheel = true ; } ;
2023-02-27 13:09:00 +08:00
2023-08-18 20:02:30 +02:00
# opencensus is a namespace package but it is distributed incorrectly
2024-04-14 20:27:42 +02:00
opencensus = prev . opencensus . overridePythonAttrs ( _ : {
2023-08-18 20:02:30 +02:00
pythonNamespaces = [
" o p e n c e n s u s . c o m m o n "
] ;
} ) ;
# opencensus is a namespace package but it is distributed incorrectly
2024-04-14 20:27:42 +02:00
opencensus-context = prev . opencensus-context . overridePythonAttrs ( _ : {
2023-08-18 20:02:30 +02:00
pythonNamespaces = [
" o p e n c e n s u s . c o m m o n "
] ;
} ) ;
2022-12-07 19:10:33 +01:00
# Overrides for building packages based on OpenCV
# These flags are inspired by the opencv 4.x package in nixpkgs
2022-09-25 15:01:06 +01:00
_opencv-python-override =
2023-10-24 06:04:10 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2022-12-07 19:10:33 +01:00
# Disable OpenCL on macOS
# Can't use cmakeFlags because cmake is called by setup.py
CMAKE_ARGS = lib . optionalString stdenv . isDarwin " - D W I T H _ O P E N C L = O F F " ;
2022-01-21 12:46:20 +12:00
nativeBuildInputs = [ pkgs . cmake ] ++ old . nativeBuildInputs ;
2022-12-07 19:10:33 +01:00
buildInputs = [
2023-10-23 12:23:59 -04:00
pkgs . ninja
2022-12-07 19:10:33 +01:00
] ++ lib . optionals stdenv . isDarwin ( with pkgs . darwin . apple_sdk . frameworks ; [
2023-04-27 07:50:39 -04:00
Accelerate
2022-12-07 19:10:33 +01:00
AVFoundation
Cocoa
CoreMedia
MediaToolbox
VideoDecodeAcceleration
] ) ++ ( old . buildInputs or [ ] ) ;
2022-01-21 12:46:20 +12:00
dontUseCmakeConfigure = true ;
2023-10-23 12:23:59 -04:00
postPatch = ''
sed - i pyproject . toml - e ' s/numpy = = [ 0 -9 ] \ + \ . [ 0 -9 ] \ + \ . [ 0 -9 ] \ + ; /numpy ; /g '
'' ;
2022-09-25 15:01:06 +01:00
} ;
2024-04-14 20:27:42 +02:00
opencv-python = prev . opencv-python . overridePythonAttrs final . _opencv-python-override ;
2022-09-25 15:01:06 +01:00
2024-04-14 20:27:42 +02:00
opencv-python-headless = prev . opencv-python-headless . overridePythonAttrs final . _opencv-python-override ;
2020-11-26 12:39:10 -03:00
2024-04-14 20:27:42 +02:00
opencv-contrib-python = prev . opencv-contrib-python . overridePythonAttrs final . _opencv-python-override ;
2022-01-18 15:45:06 +12:00
2024-04-14 20:27:42 +02:00
openexr = prev . openexr . overridePythonAttrs (
2022-09-29 20:39:37 +03:00
old : {
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . openexr pkgs . ilmbase ] ;
NIX_CFLAGS_COMPILE = [ " - I ${ pkgs . openexr . dev } / i n c l u d e / O p e n E X R " " - I ${ pkgs . ilmbase . dev } / i n c l u d e / O p e n E X R " ] ;
}
) ;
2022-04-15 16:38:33 -07:00
2024-04-14 20:27:42 +02:00
openvino = prev . openvino . overridePythonAttrs (
2022-09-06 19:02:05 -03:00
old : {
buildInputs = [
pkgs . ocl-icd
pkgs . hwloc
pkgs . tbb
pkgs . numactl
pkgs . libxml2
] ++ ( old . buildInputs or [ ] ) ;
}
) ;
2024-04-14 20:27:42 +02:00
orjson = prev . orjson . overridePythonAttrs ( old : if old . src . isWheel or false then { } else
2023-11-05 16:16:04 -08:00
(
2022-04-15 16:38:33 -07:00
let
2023-11-05 16:16:04 -08:00
githubHash = {
" 3 . 8 . 1 0 " = " s h a 2 5 6 - X h O J A s F 9 H b y y K M U 9 o / f 9 Z l 3 + q Y o z k 8 t V Q U 8 b k b X G A Z s = " ;
" 3 . 8 . 1 1 " = " s h a 2 5 6 - T F o a g W U t d / n J c e N a p t g P p 4 a T R / t B C m x p i Z I V J w O l i a 4 = " ;
" 3 . 8 . 1 2 " = " s h a 2 5 6 - / 1 N c X G Y O j C I V s F e e 7 q g m C j n Y P J n D E t y H M K J 5 s B a m h W E = " ;
" 3 . 8 . 1 3 " = " s h a 2 5 6 - p I x h e v 7 A p 6 r 0 U V Y e O r a / Y A t b j T j n 7 2 J o d h d C Z I b A 6 l U = " ;
" 3 . 8 . 1 4 " = " s h a 2 5 6 - / 1 N c X G Y O j C I V s F e e 7 q g m C j n Y P J n D E t y H M K J 5 s B a m h W E = " ;
" 3 . 9 . 0 " = " s h a 2 5 6 - n L R l u F t 6 d E r L J U J 4 W 6 4 G 9 o 8 q L T L 1 I K N K V t N q p N 9 Y U N U = " ;
" 3 . 9 . 5 " = " s h a 2 5 6 - O F t a H Z a 7 w U r U x h M 8 D k a q A P 3 d Y Z J d F G r z 1 j O t C I G s b b Y = " ;
" 3 . 9 . 7 " = " s h a 2 5 6 - V k C w v k s U t g v F L S M y 2 f H L x r p Z j c W Y h i n c S M 4 f X / G w l 0 I = " ;
" 3 . 9 . 1 0 " = " s h a 2 5 6 - M k c u a y N D t 7 / G c s w X o F T v z u a Z z h Q E Q V + V 7 O f K q g J w V I Q = " ;
" 3 . 8 . 3 " = " s h a 2 5 6 - 4 r B X b 4 + e A a R f b l 2 P W Z L 4 I 0 1 F 0 G v b S N q B V t U 4 L / s X r V c = " ;
" 3 . 8 . 4 " = " s h a 2 5 6 - X Q B i E 8 h m L C / A I R t 0 e J r i / i l P H U E Y i O x d 0 o n R B Q s x + p M = " ;
" 3 . 8 . 5 " = " s h a 2 5 6 - R G 2 i 8 Q u W u 2 / j 5 j e U p 6 i Z z V w + c i J I z Q I 8 8 r L x R y 6 k n D g = " ;
" 3 . 8 . 6 " = " s h a 2 5 6 - L w L u M c n A u b O 7 U 1 / K S e 6 t H a S P 9 + b i 6 g D f v G o b i x z L 2 g M = " ;
" 3 . 8 . 7 " = " s h a 2 5 6 - 9 n B g M c A f G 4 D T l v 4 1 g w Q I m w y h Y m 0 6 Q e i E / G 4 O b c L b 7 w U = " ;
" 3 . 8 . 8 " = " s h a 2 5 6 - p R B 4 Q h x J h 4 J C D W W y p 0 B H 2 5 x 8 M R n + W i e Q o / d v B 1 m Q R 4 0 = " ;
" 3 . 8 . 9 " = " s h a 2 5 6 - 0 / y v X X j + z 2 j B E A G x O 4 B x M n x 1 z q U o u l t Y S Y f S k K s + h K Y = " ;
} . ${ old . version } or lib . fakeHash ;
# we can count on this repo's root to have Cargo.lock
2023-11-05 15:12:29 -08:00
2023-11-05 16:16:04 -08:00
src = pkgs . fetchFromGitHub {
owner = " i j l " ;
repo = " o r j s o n " ;
rev = old . version ;
sha256 = githubHash ;
} ;
2022-04-15 16:38:33 -07:00
in
2023-11-05 16:16:04 -08:00
{
inherit src ;
cargoDeps = pkgs . rustPlatform . importCargoLock {
lockFile = " ${ src . out } / C a r g o . l o c k " ;
2022-04-15 16:38:33 -07:00
} ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2023-11-05 16:16:04 -08:00
pkgs . rustPlatform . cargoSetupHook # handles `importCargoLock`
pkgs . rustPlatform . maturinBuildHook # orjson is based on maturin
2022-04-15 16:38:33 -07:00
] ;
buildInputs = ( old . buildInputs or [ ] ) ++ lib . optional pkgs . stdenv . isDarwin pkgs . libiconv ;
2023-11-05 16:16:04 -08:00
}
) ) ;
2021-08-25 12:25:05 +12:00
2024-04-14 20:27:42 +02:00
osqp = prev . osqp . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . cmake ] ;
dontUseCmakeConfigure = true ;
}
) ;
2020-02-27 17:38:36 +00:00
2022-05-05 04:37:19 +12:00
2024-04-14 20:27:42 +02:00
pandas = prev . pandas . overridePythonAttrs ( old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-10-24 09:28:31 -04:00
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [ pkg-config ] ;
2022-05-05 04:37:19 +12:00
buildInputs = old . buildInputs or [ ] ++ lib . optional stdenv . isDarwin pkgs . libcxx ;
2023-10-24 09:28:31 -04:00
dontUseMesonConfigure = true ;
2022-05-05 04:37:19 +12:00
# Doesn't work with -Werror,-Wunused-command-line-argument
# https://github.com/NixOS/nixpkgs/issues/39687
hardeningDisable = lib . optional stdenv . cc . isClang " s t r i c t o v e r f l o w " ;
# For OSX, we need to add a dependency on libcxx, which provides
# `complex.h` and other libraries that pandas depends on to build.
2023-11-25 21:46:05 +01:00
postPatch = ''
if [ - f pyproject . toml ] ; then
substituteInPlace pyproject . toml \
- - replace ' meson-python = = 0 .13 . 1 ' ' meson-python'
fi
'' + l i b . o p t i o n a l S t r i n g ( ! ( o l d . s r c . i s W h e e l o r f a l s e ) & & s t d e n v . i s D a r w i n ) ''
2023-10-25 07:43:39 -04:00
if [ - f setup . py ] ; then
cpp_sdk = " ${ lib . getDev pkgs . libcxx } / i n c l u d e / c + + / v 1 " ;
echo " A d d i n g $ c p p _ s d k t o t h e s e t u p . p y c o m m o n _ i n c l u d e v a r i a b l e "
substituteInPlace setup . py \
- - replace " [ ' p a n d a s / s r c / k l i b ' , ' p a n d a s / s r c ' ] " \
" [ ' p a n d a s / s r c / k l i b ' , ' p a n d a s / s r c ' , ' $ c p p _ s d k ' ] "
fi
2022-05-05 04:37:19 +12:00
'' ;
enableParallelBuilding = true ;
} ) ;
2024-04-14 20:27:42 +02:00
pantalaimon = prev . pantalaimon . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [ pkgs . installShellFiles ] ;
postInstall = old . postInstall or " " + ''
installManPage docs/man /* . [ 1 - 9 ]
'' ;
} ) ;
2021-01-21 10:44:39 +01:00
2024-04-14 20:27:42 +02:00
pao = prev . pao . overridePythonAttrs ( old : {
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [ final . pyutilib ] ;
2023-04-17 15:09:03 -07:00
} ) ;
2024-04-14 20:27:42 +02:00
paramiko = prev . paramiko . overridePythonAttrs ( _ : {
2022-01-21 12:46:20 +12:00
doCheck = false ; # requires networking
} ) ;
2021-12-30 12:55:35 -08:00
2024-04-14 20:27:42 +02:00
parsel = prev . parsel . overridePythonAttrs (
2022-09-29 20:39:37 +03:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-05-03 23:28:54 +09:00
2024-04-14 20:27:42 +02:00
pdal = prev . pdal . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
PDAL_CONFIG = " ${ pkgs . pdal } / b i n / p d a l - c o n f i g " ;
}
) ;
2021-09-01 16:35:44 +01:00
2024-04-14 20:27:42 +02:00
peewee = prev . peewee . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
let
withPostgres = old . passthru . withPostgres or false ;
withMysql = old . passthru . withMysql or false ;
in
{
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . sqlite ] ;
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ lib . optional withPostgres final . psycopg2
++ lib . optional withMysql final . mysql-connector ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-07-22 17:58:25 -05:00
2024-04-14 20:27:42 +02:00
pikepdf = prev . pikepdf . overridePythonAttrs (
2022-02-14 20:36:04 +01:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = old . buildInputs or [ ] ++ [ pkgs . qpdf final . pybind11 ] ;
2022-02-14 20:36:04 +01:00
pythonImportsCheck = old . pythonImportsCheck or [ ] ++ [ " p i k e p d f " ] ;
}
) ;
2024-04-14 20:27:42 +02:00
pillow = prev . pillow . overridePythonAttrs (
2022-08-22 19:56:00 +01:00
old :
let
preConfigure = ( old . preConfigure or " " ) + pkgs . python3 . pkgs . pillow . preConfigure ;
in
{
2022-04-14 12:06:50 +09:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ pkg-config final . pytest-runner ] ;
2022-04-14 12:06:50 +09:00
buildInputs = with pkgs ; ( old . buildInputs or [ ] )
2023-02-02 12:05:55 +00:00
++ [ freetype libjpeg zlib libtiff libxcrypt libwebp tcl lcms2 ]
2022-04-14 12:06:50 +09:00
++ lib . optionals ( lib . versionAtLeast old . version " 7 . 1 . 0 " ) [ xorg . libxcb ]
2024-04-14 20:27:42 +02:00
++ lib . optionals final . isPyPy [ tk xorg . libX11 ] ;
2022-08-22 19:56:00 +01:00
preConfigure = lib . optional ( old . format != " w h e e l " ) preConfigure ;
2024-04-12 00:05:53 +01:00
# https://github.com/nix-community/poetry2nix/issues/1139
2024-05-01 14:22:14 -04:00
patches = ( old . patches or [ ] ) ++ pkgs . lib . optionals ( ! ( old . src . isWheel or false ) && old . version = = " 9 . 5 . 0 " ) [
2024-04-12 00:05:53 +01:00
( pkgs . fetchpatch {
url = " h t t p s : / / g i t h u b . c o m / p y t h o n - p i l l o w / P i l l o w / c o m m i t / 0 e c 0 a 8 9 e a d 6 4 8 7 9 3 8 1 2 e 1 1 7 3 9 e 2 a 5 d 7 0 7 3 8 c 6 b e 5 . d i f f " ;
sha256 = " s h a 2 5 6 - r Z f k + O X Z U 6 x B p o u m I W 3 0 E 8 0 g R s o x / G o a 3 h M D x B U k T Y 0 = " ;
} )
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-05-11 12:57:26 +12:00
2024-04-14 20:27:42 +02:00
pillow-heif = prev . pillow-heif . overridePythonAttrs (
2023-08-22 05:51:28 -04:00
old : {
buildInputs = with pkgs ; ( old . buildInputs or [ ] ) ++ [
libheif
] ;
2024-04-11 15:53:44 +02:00
nativeBuildInputs = with pkgs ; ( old . nativeBuildInputs or [ ] ) ++ [
pkg-config
] ;
2023-08-22 05:51:28 -04:00
}
) ;
2024-04-14 20:27:42 +02:00
pip-requirements-parser = prev . pip-requirements-parser . overridePythonAttrs ( _old : {
2023-03-22 11:09:59 +00:00
dontConfigure = true ;
} ) ;
2024-04-14 20:27:42 +02:00
pluralizer = prev . pluralizer . overridePythonAttrs ( old : {
2022-12-30 17:18:47 +01:00
preBuild = ''
2023-01-07 06:34:28 -05:00
export PYPI_VERSION = " ${ old . version } "
'' ;
2022-12-30 17:18:47 +01:00
} ) ;
2024-04-14 20:27:42 +02:00
poethepoet = prev . poethepoet . overrideAttrs ( old : {
propagatedBuildInputs = old . propagatedBuildInputs ++ [ final . poetry ] ;
2022-11-18 13:55:54 +00:00
} ) ;
2024-04-14 20:27:42 +02:00
pkgutil-resolve-name = prev . pkgutil-resolve-name . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' flit_core >= 2 , < 3 ' ' flit_core'
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
plyvel = prev . plyvel . overridePythonAttrs ( old : {
2023-10-26 05:51:34 -04:00
buildInputs = old . buildInputs or [ ] ++ [ pkgs . leveldb ] ;
} ) ;
2024-04-14 20:27:42 +02:00
poetry-plugin-export = prev . poetry-plugin-export . overridePythonAttrs ( _old : {
2022-09-02 03:32:06 +12:00
dontUsePythonImportsCheck = true ;
pipInstallFlags = [
" - - n o - d e p s "
] ;
2022-09-02 01:33:30 +12:00
} ) ;
2024-05-02 12:10:53 -04:00
polling2 = prev . polling2 . overridePythonAttrs (
2024-05-02 06:38:48 -04:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [ final . pytest-runner ] ;
2024-05-02 06:38:48 -04:00
}
) ;
2024-04-14 20:27:42 +02:00
portend = prev . portend . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
# required for the extra "toml" dependency in setuptools_scm[toml]
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . toml
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2020-02-26 10:50:13 +01:00
2024-04-14 20:27:42 +02:00
prettytable = prev . prettytable . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
prophet = prev . prophet . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . cmdstan final . cmdstanpy ] ;
2022-10-30 17:00:14 -04:00
PROPHET_REPACKAGE_CMDSTAN = " f a l s e " ;
2022-10-30 17:01:02 -04:00
CMDSTAN = " ${ pkgs . cmdstan } " ;
2022-10-30 17:00:14 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
psycopg2 = prev . psycopg2 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] )
++ lib . optional stdenv . isDarwin pkgs . openssl ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . postgresql ] ;
}
) ;
2020-02-24 17:34:57 +00:00
2024-04-14 20:27:42 +02:00
psycopg2-binary = prev . psycopg2-binary . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] )
++ lib . optional stdenv . isDarwin pkgs . openssl ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . postgresql ] ;
}
) ;
2019-12-11 13:31:22 +01:00
2024-04-14 20:27:42 +02:00
psycopg2cffi = prev . psycopg2cffi . overridePythonAttrs (
2022-05-05 04:15:02 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] )
++ lib . optional stdenv . isDarwin pkgs . openssl ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . postgresql ] ;
}
) ;
2024-04-14 20:27:42 +02:00
pycurl = prev . pycurl . overridePythonAttrs (
2023-08-23 15:35:45 +02:00
old : {
2023-09-12 12:20:26 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . curl ] ;
2023-08-23 15:43:32 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . curl ] ;
2023-08-23 15:35:45 +02:00
}
) ;
2024-04-14 20:27:42 +02:00
pydantic-core = prev . pydantic-core . override {
2023-07-14 09:01:24 +01:00
preferWheel = true ;
} ;
2024-04-14 20:27:42 +02:00
py-solc-x = prev . py-solc-x . overridePythonAttrs (
2022-03-29 16:10:35 -07:00
old : {
preConfigure = ''
substituteInPlace setup . py - - replace \ ' setuptools-markdown \ ' " "
'' ;
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . requests final . semantic-version ] ;
2022-03-29 16:10:35 -07:00
}
) ;
2022-01-21 12:46:20 +12:00
pyarrow =
2024-04-14 20:27:42 +02:00
if ( ! prev . pyarrow . src . isWheel or false ) && lib . versionAtLeast prev . pyarrow . version " 0 . 1 6 . 0 " then
prev . pyarrow . overridePythonAttrs
2022-01-21 12:46:20 +12:00
(
old :
let
parseMinor = drv : lib . concatStringsSep " . " ( lib . take 2 ( lib . splitVersion drv . version ) ) ;
# Starting with nixpkgs revision f149c7030a7, pyarrow takes "python3" as an argument
# instead of "python". Below we inspect function arguments to maintain compatibilitiy.
_arrow-cpp = pkgs . arrow-cpp . override (
builtins . intersectAttrs
( lib . functionArgs pkgs . arrow-cpp . override )
2024-04-14 20:27:42 +02:00
{ inherit ( final ) python ; python3 = final . python ; }
2022-01-21 12:46:20 +12:00
) ;
ARROW_HOME = _arrow-cpp ;
arrowCppVersion = parseMinor _arrow-cpp ;
2024-04-14 20:27:42 +02:00
pyArrowVersion = parseMinor prev . pyarrow ;
2022-01-21 12:46:20 +12:00
errorMessage = " a r r o w - c p p v e r s i o n ( ${ arrowCppVersion } ) m i s m a t c h e s p y a r r o w v e r s i o n ( ${ pyArrowVersion } ) " ;
in
if arrowCppVersion != pyArrowVersion then throw errorMessage else {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkg-config
pkgs . cmake
] ;
2023-05-02 21:48:58 -07:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
_arrow-cpp
] ;
2022-01-21 12:46:20 +12:00
preBuild = ''
export PYARROW_PARALLEL = $ NIX_BUILD_CORES
'' ;
PARQUET_HOME = _arrow-cpp ;
inherit ARROW_HOME ;
PYARROW_BUILD_TYPE = " r e l e a s e " ;
PYARROW_WITH_FLIGHT = if _arrow-cpp . enableFlight then 1 else 0 ;
PYARROW_WITH_DATASET = 1 ;
PYARROW_WITH_PARQUET = 1 ;
PYARROW_CMAKE_OPTIONS = [
" - D C M A K E _ I N S T A L L _ R P A T H = ${ ARROW_HOME } / l i b "
# This doesn't use setup hook to call cmake so we need to workaround #54606
# ourselves
" - D C M A K E _ P O L I C Y _ D E F A U L T _ C M P 0 0 2 5 = N E W "
] ;
dontUseCmakeConfigure = true ;
}
) else
2024-04-14 20:27:42 +02:00
prev . pyarrow ;
2022-01-20 11:54:26 +12:00
2024-04-14 20:27:42 +02:00
pycairo = prev . pycairo . overridePythonAttrs (
2023-10-26 07:55:31 -04:00
old : {
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [
pkg-config
] ;
2022-01-05 20:43:30 -06:00
2023-10-26 07:55:31 -04:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
pkgs . cairo
] ;
}
) ;
2020-09-14 12:37:23 +02:00
2024-04-14 20:27:42 +02:00
pycocotools = prev . pycocotools . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . numpy
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2021-02-15 16:37:20 +01:00
2024-04-14 20:27:42 +02:00
pyfftw = prev . pyfftw . overridePythonAttrs ( old : {
2022-05-27 01:13:00 +08:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . fftw
pkgs . fftwFloat
pkgs . fftwLongDouble
] ;
} ) ;
2024-04-14 20:27:42 +02:00
pyfuse3 = prev . pyfuse3 . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . fuse3 ] ;
} ) ;
2022-01-18 15:45:06 +12:00
2024-04-14 20:27:42 +02:00
pygame = prev . pygame . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : rec {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = [
pkg-config
pkgs . SDL
] ;
2022-01-18 15:45:06 +12:00
2022-01-21 12:46:20 +12:00
buildInputs = [
pkgs . SDL
pkgs . SDL_image
pkgs . SDL_mixer
pkgs . SDL_ttf
pkgs . libpng
pkgs . libjpeg
pkgs . portmidi
pkgs . xorg . libX11
pkgs . freetype
] ;
2022-01-18 15:45:06 +12:00
2022-01-21 12:46:20 +12:00
# Tests fail because of no audio device and display.
doCheck = false ;
preConfigure = ''
sed \
- e " s / o r i g i n c d i r s = . * / o r i g i n c d i r s = [ ] / " \
- e " s / o r i g l i b d i r s = . * / o r i g l i b d i r s = [ ] / " \
- e " / ' \/ l i b \/ i 3 8 6 - l i n u x - g n u ' , ' \/ l i b \/ x 8 6 _ 6 4 - l i n u x - g n u ' ] / d " \
- e " / \/ i n c l u d e \/ s m p e g / d " \
- i buildconfig/config_unix.py
$ { lib . concatMapStrings
( dep : ''
sed \
- e " / o r i g i n c d i r s = / a \ o r i g i n c d i r s + = [ ' ${ lib . getDev dep } / i n c l u d e ' ] " \
- e " / o r i g l i b d i r s = / a \ o r i g l i b d i r s + = [ ' ${ lib . getLib dep } / l i b ' ] " \
- i buildconfig/config_unix.py
'' )
buildInputs
}
2024-04-14 20:27:42 +02:00
LOCALBASE = / $ { final . python . interpreter } buildconfig/config.py
2022-01-21 12:46:20 +12:00
'' ;
}
) ;
2021-02-15 16:37:20 +01:00
2024-04-14 20:27:42 +02:00
pygeos = prev . pygeos . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . geos ] ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . geos ] ;
}
) ;
2021-03-12 17:07:19 +11:00
2024-04-14 20:27:42 +02:00
pygobject = prev . pygobject . overridePythonAttrs (
2024-03-09 12:10:18 -05:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [
pkg-config
pkgs . meson
pkgs . ninja
pkgs . gobject-introspection
2024-04-14 20:27:42 +02:00
final . meson-python
2024-03-09 12:10:18 -05:00
] ;
buildInputs = old . buildInputs or [ ] ++ [
pkgs . cairo
pkgs . glib
] ++ lib . optionals stdenv . isDarwin [ pkgs . ncurses ] ;
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
2024-04-14 20:27:42 +02:00
final . pycairo
2024-03-09 12:10:18 -05:00
] ;
postConfigure = ''
cd . .
'' ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-02-26 10:50:13 +01:00
2024-04-14 20:27:42 +02:00
pymdown-extensions = prev . pymdown-extensions . overridePythonAttrs ( old : {
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [ final . pyyaml ] ;
2024-03-09 12:10:18 -05:00
} ) ;
2024-04-14 20:27:42 +02:00
pylint = prev . pylint . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-20 11:54:26 +12:00
2024-04-14 20:27:42 +02:00
pymediainfo = prev . pymediainfo . overridePythonAttrs (
2022-02-16 12:07:58 +01:00
old : {
postPatch = ( old . postPatch or " " ) + ''
substituteInPlace pymediainfo/__init__.py \
- - replace " l i b m e d i a i n f o . 0 . d y l i b " \
" ${ pkgs . libmediainfo } / l i b / l i b m e d i a i n f o . 0 ${ stdenv . hostPlatform . extensions . sharedLibrary } " \
- - replace " l i b m e d i a i n f o . d y l i b " \
" ${ pkgs . libmediainfo } / l i b / l i b m e d i a i n f o ${ stdenv . hostPlatform . extensions . sharedLibrary } " \
- - replace " l i b m e d i a i n f o . s o . 0 " \
" ${ pkgs . libmediainfo } / l i b / l i b m e d i a i n f o ${ stdenv . hostPlatform . extensions . sharedLibrary } . 0 "
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
pynetbox = prev . pynetbox . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2023-04-22 04:05:00 +08:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-applehelp = prev . sphinxcontrib-applehelp . overridePythonAttrs ( old : {
propagatedBuildInputs = removePackagesByName ( old . propagatedBuildInputs or [ ] ) [ final . sphinx ] ;
2023-10-25 07:31:10 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-devhelp = prev . sphinxcontrib-devhelp . overridePythonAttrs ( old : {
propagatedBuildInputs = removePackagesByName ( old . propagatedBuildInputs or [ ] ) [ final . sphinx ] ;
2023-10-25 07:31:10 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-htmlhelp = prev . sphinxcontrib-htmlhelp . overridePythonAttrs ( old : {
propagatedBuildInputs = removePackagesByName ( old . propagatedBuildInputs or [ ] ) [ final . sphinx ] ;
2023-10-25 07:31:10 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-jsmath = prev . sphinxcontrib-jsmath . overridePythonAttrs ( old : {
propagatedBuildInputs = removePackagesByName ( old . propagatedBuildInputs or [ ] ) [ final . sphinx ] ;
2023-10-25 07:31:10 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-jquery = prev . sphinxcontrib-jquery . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . sphinx ] ;
2024-03-07 10:52:22 +00:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-qthelp = prev . sphinxcontrib-qthelp . overridePythonAttrs ( old : {
propagatedBuildInputs = removePackagesByName ( old . propagatedBuildInputs or [ ] ) [ final . sphinx ] ;
2023-10-25 07:31:10 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
sphinxcontrib-serializinghtml = prev . sphinxcontrib-serializinghtml . overridePythonAttrs ( old : {
propagatedBuildInputs = removePackagesByName ( old . propagatedBuildInputs or [ ] ) [ final . sphinx ] ;
2023-10-25 07:31:10 -04:00
} ) ;
2024-04-14 20:27:42 +02:00
pynput = prev . pynput . overridePythonAttrs ( old : {
2022-07-03 18:11:36 +10:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ final . sphinx ] ;
2022-07-03 18:11:36 +10:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ final . setuptools-lint ] ;
2022-07-03 18:11:36 +10:00
} ) ;
2024-04-14 20:27:42 +02:00
pymssql = prev . pymssql . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] )
2022-12-06 06:18:18 -05:00
++ [ pkgs . openssl pkgs . libkrb5 ] ;
2022-01-21 12:46:20 +12:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] )
++ [ pkgs . freetds ] ;
} ) ;
2021-09-18 01:22:49 +10:00
2024-04-14 20:27:42 +02:00
pyodbc = prev . pyodbc . overridePythonAttrs (
2024-03-09 12:10:18 -05:00
old : lib . optionalAttrs ( old . src . isWheel or false ) {
preFixup = old . preFixup or " " + lib . optionalString stdenv . isLinux ''
2024-01-11 05:58:58 -05:00
addAutoPatchelfSearchPath $ { pkgs . unixODBC }
2024-03-09 12:10:18 -05:00
'' + l i b . o p t i o n a l S t r i n g s t d e n v . i s D a r w i n ''
if [ - e /opt/homebrew/opt/unixodbc/lib/libodbc.2.dylib ] ; then
install_name_tool - change \
/opt/homebrew/opt/unixodbc/lib/libodbc.2.dylib \
$ { lib . getLib pkgs . unixODBC } /lib/libodbc.2.dylib \
2024-04-14 20:27:42 +02:00
$ out / $ { final . python . sitePackages } /pyodbc.cpython- * - darwin . so
2024-03-09 12:10:18 -05:00
fi
2024-01-11 05:58:58 -05:00
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
pyopencl = prev . pyopencl . overridePythonAttrs (
2022-11-04 11:59:01 -04:00
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . numpy ] ;
2022-11-04 11:59:01 -04:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . ocl-icd pkgs . opencl-headers ] ;
}
) ;
2024-04-14 20:27:42 +02:00
pyopenssl = prev . pyopenssl . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . openssl ] ;
}
) ;
2020-06-10 02:37:01 -07:00
2024-04-14 20:27:42 +02:00
pyproj = prev . pyproj . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
PROJ_DIR = " ${ pkgs . proj } " ;
PROJ_LIBDIR = " ${ pkgs . proj } / l i b " ;
PROJ_INCDIR = " ${ pkgs . proj . dev } / i n c l u d e " ;
}
) ;
2024-04-14 20:27:42 +02:00
pyrealsense2 = prev . pyrealsense2 . overridePythonAttrs ( old : {
2022-10-06 13:49:12 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . libusb1 . out ] ;
} ) ;
2024-04-14 20:27:42 +02:00
pyrfr = prev . pyrfr . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . swig ] ;
} ) ;
2024-04-14 20:27:42 +02:00
pyscard = prev . pyscard . overridePythonAttrs ( old :
2022-11-24 07:15:07 +01:00
# see https://github.com/NixOS/nixpkgs/blob/93568862a610dc1469dc40b15c1096a9357698ac/pkgs/development/python-modules/pyscard/default.nix
let
inherit ( pkgs ) PCSC pcsclite ;
withApplePCSC = stdenv . isDarwin ;
in
{
postPatch =
if withApplePCSC then ''
substituteInPlace smartcard/scard/winscarddll.c \
- - replace " / S y s t e m / L i b r a r y / F r a m e w o r k s / P C S C . f r a m e w o r k / P C S C " \
" ${ PCSC } / L i b r a r y / F r a m e w o r k s / P C S C . f r a m e w o r k / P C S C "
'' e l s e ''
substituteInPlace smartcard/scard/winscarddll.c \
- - replace " l i b p c s c l i t e . s o . 1 " \
" ${ lib . getLib pcsclite } / l i b / l i b p c s c l i t e ${ stdenv . hostPlatform . extensions . sharedLibrary } "
'' ;
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ (
if withApplePCSC then [ PCSC ] else [ pcsclite ]
) ;
NIX_CFLAGS_COMPILE = lib . optionalString ( ! withApplePCSC )
" - I ${ lib . getDev pcsclite } / i n c l u d e / P C S C " ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkgs . swig
] ;
}
) ;
2024-04-14 20:27:42 +02:00
pytaglib = prev . pytaglib . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . taglib ] ;
} ) ;
2023-10-17 12:32:00 -07:00
pytesseract =
let
pytesseract-cmd-patch = pkgs . writeText " p y t e s s e r a c t - c m d . p a t c h " ''
- - - a/pytesseract/pytesseract.py
++ + b/pytesseract/pytesseract.py
@ @ -27 , 7 + 27 , 7 @ @
from PIL import Image
- tesseract_cmd = ' tesseract'
+ tesseract_cmd = ' $ { pkgs . tesseract4 } /bin/tesseract '
numpy_installed = find_loader ( ' numpy' ) is not None
if numpy_installed :
'' ;
in
2024-04-14 20:27:42 +02:00
prev . pytesseract . overridePythonAttrs ( old : {
2023-10-17 12:32:00 -07:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . tesseract4 ] ;
patches = ( old . patches or [ ] ) ++ lib . optionals ( ! ( old . src . isWheel or false ) ) [ pytesseract-cmd-patch ] ;
# apply patch in postInstall if the source is a wheel
postInstall = lib . optionalString ( old . src . isWheel or false ) ''
2024-04-14 20:27:42 +02:00
pushd " $ o u t / ${ final . python . sitePackages } "
2023-10-17 12:32:00 -07:00
patch - p1 < " ${ pytesseract-cmd-patch } "
popd
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
pytezos = prev . pytezos . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . libsodium ] ;
} ) ;
2024-04-14 20:27:42 +02:00
python-bugzilla = prev . python-bugzilla . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . docutils
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
python-ldap = prev . python-ldap . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-01-03 14:42:27 -05:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . openldap
pkgs . cyrus_sasl
2023-11-14 07:40:38 +01:00
# Fix for "cannot find -lldap_r: No such file or directory"
( pkgs . writeTextFile {
name = " o p e n l d a p - l i b - f i x " ;
destination = " / l i b / l i b l d a p _ r . s o " ;
text = " I N P U T ( l i b l d a p . s o ) \n " ;
} )
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
python-snap7 = prev . python-snap7 . overridePythonAttrs ( old : {
2023-01-09 13:18:16 +01:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
pkgs . snap7
] ;
postPatch = ( old . postPatch or " " ) + ''
echo " P a t c h i n g f i n d _ l i b r a r y c a l l . "
substituteInPlace snap7/common.py \
- - replace " f i n d _ l i b r a r y ( ' s n a p 7 ' ) " " \" ${ pkgs . snap7 } / l i b / l i b s n a p 7 . s o \" "
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
pytoml = prev . pytoml . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
doCheck = false ;
}
) ;
pyqt5 =
let
2024-04-14 20:27:42 +02:00
qt5 = selectQt5 prev . pyqt5 . version ;
2022-01-21 12:46:20 +12:00
in
2024-04-14 20:27:42 +02:00
prev . pyqt5 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2022-09-02 13:32:04 +12:00
postPatch = ''
# Confirm license
sed - i s / " i f t o o l = = ' p e p 5 1 7 ' : " / " i f T r u e : " / project . py
'' ;
2022-05-13 08:21:16 +12:00
dontConfigure = true ;
2022-01-21 12:46:20 +12:00
dontWrapQtApps = true ;
2023-08-14 20:18:50 +03:00
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ pyQt5Modules qt5 ++ [
2024-04-14 20:27:42 +02:00
final . pyqt-builder
final . sip
2022-05-13 08:21:16 +12:00
] ;
}
) ;
2022-01-21 12:46:20 +12:00
2022-05-13 08:21:16 +12:00
pyqt5-qt5 =
let
2024-04-14 20:27:42 +02:00
qt5 = selectQt5 prev . pyqt5-qt5 . version ;
2022-05-13 08:21:16 +12:00
in
2024-04-14 20:27:42 +02:00
prev . pyqt5-qt5 . overridePythonAttrs (
2022-05-13 08:21:16 +12:00
old : {
dontWrapQtApps = true ;
2023-08-14 20:18:50 +03:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ pyQt5Modules qt5 ++ [
2022-05-13 08:21:16 +12:00
pkgs . gtk3
pkgs . speechd
pkgs . postgresql
pkgs . unixODBC
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2023-10-26 18:41:56 +09:00
pyqt6 =
2023-10-23 23:56:13 +09:00
let
2023-10-26 18:41:56 +09:00
# The build from source fails unless the pyqt6 version agrees
# with the version of qt6 from nixpkgs. Thus, we prefer using
# the wheel here.
2024-04-14 20:27:42 +02:00
pyqt6-wheel = prev . pyqt6 . override { preferWheel = true ; } ;
2023-10-26 18:41:56 +09:00
pyqt6 = pyqt6-wheel . overridePythonAttrs ( old :
let
confirm-license = pkgs . writeText " c o n f i r m - l i c e n s e . p a t c h " ''
diff - - git a/project.py b/project.py
- - - a/project.py
++ + b/project.py
@ @ -163 , 8 + 163 , 7 @ @
2023-10-23 23:56:13 +09:00
2023-10-26 18:41:56 +09:00
# Automatically confirm the license if there might not be a command
# line option to do so.
- if tool = = ' pep517' :
2024-04-14 20:27:42 +02:00
- final . confirm_license = True
+ final . confirm_license = True
2023-10-23 23:56:13 +09:00
2024-04-14 20:27:42 +02:00
final . _check_license ( )
2023-10-23 23:56:13 +09:00
2023-10-26 18:41:56 +09:00
'' ;
isWheel = old . src . isWheel or false ;
in
{
propagatedBuildInputs = old . propagatedBuildInputs ++ [
2024-04-14 20:27:42 +02:00
final . dbus-python
2023-10-26 18:41:56 +09:00
] ;
nativeBuildInputs = old . nativeBuildInputs ++ [
pkgs . pkg-config
2024-04-14 20:27:42 +02:00
final . pyqt6-sip
final . sip
final . pyqt-builder
2023-10-26 18:41:56 +09:00
pkgs . xorg . lndir
pkgs . qt6 . qmake
] ++ lib . optionals isWheel [
pkgs . qt6 . full # building from source doesn't properly pick up libraries from pyqt6-qt6
] ;
patches = lib . optionals ( ! isWheel ) [
confirm-license
] ;
env . NIX_CFLAGS_COMPILE = " - f p e r m i s s i v e " ;
# be more verbose
postPatch = ''
cat > > pyproject . toml < < EOF
[ tool . sip . project ]
verbose = true
EOF
'' ;
dontWrapQtApps = true ;
dontConfigure = true ;
enableParallelBuilding = true ;
2024-05-05 09:06:10 -04:00
# HACK: parallelize compilation of make calls within pyqt's setup.py
2023-10-26 18:41:56 +09:00
# pkgs/stdenv/generic/setup.sh doesn't set this for us because
# make gets called by python code and not its build phase
# format=pyproject means the pip-build-hook hook gets used to build this project
# pkgs/development/interpreters/python/hooks/pip-build-hook.sh
# does not use the enableParallelBuilding flag
postUnpack = ''
export MAKEFLAGS + = " ' ' ${ enableParallelBuilding:+-j$NIX_BUILD_CORES } "
'' ;
2023-10-30 15:53:11 +13:00
preFixup = lib . optionalString isWheel ''
2024-04-14 20:27:42 +02:00
addAutoPatchelfSearchPath $ { final . pyqt6-qt6 } / $ { final . python . sitePackages } /PyQt6
2023-10-26 18:41:56 +09:00
'' ;
} ) ;
2023-10-23 23:56:13 +09:00
in
2023-10-26 18:41:56 +09:00
pyqt6 ;
2023-10-23 23:56:13 +09:00
2024-05-02 12:10:53 -04:00
pyqt6-qt6 = prev . pyqt6-qt6 . overridePythonAttrs ( old : {
2024-03-05 23:38:25 +09:00
autoPatchelfIgnoreMissingDeps = [ " l i b m y s q l c l i e n t . s o . 2 1 " " l i b m i m e r a p i . s o " " l i b Q t 6 * " ] ;
2023-10-26 12:09:28 +09:00
preFixup = ''
2024-04-14 20:27:42 +02:00
addAutoPatchelfSearchPath $ out / $ { final . python . sitePackages } /PyQt6/Qt6/lib
2023-10-26 12:09:28 +09:00
'' ;
2023-10-23 23:56:13 +09:00
propagatedBuildInputs = old . propagatedBuildInputs ++ [
pkgs . libxkbcommon
pkgs . gtk3
pkgs . speechd
pkgs . gst
pkgs . gst_all_1 . gst-plugins-base
pkgs . gst_all_1 . gstreamer
pkgs . postgresql . lib
pkgs . unixODBC
pkgs . pcsclite
2023-10-26 12:09:28 +09:00
pkgs . xorg . libxcb
pkgs . xorg . xcbutil
pkgs . xorg . xcbutilcursor
pkgs . xorg . xcbutilerrors
pkgs . xorg . xcbutilimage
pkgs . xorg . xcbutilkeysyms
pkgs . xorg . xcbutilrenderutil
pkgs . xorg . xcbutilwm
pkgs . libdrm
pkgs . pulseaudio
2023-10-23 23:56:13 +09:00
] ;
} ) ;
2024-04-14 20:27:42 +02:00
pyside6-essentials = prev . pyside6-essentials . overridePythonAttrs ( old : lib . optionalAttrs stdenv . isLinux {
2023-10-26 15:22:38 +09:00
autoPatchelfIgnoreMissingDeps = [ " l i b m y s q l c l i e n t . s o . 2 1 " " l i b m i m e r a p i . s o " " l i b Q t 6 * " ] ;
preFixup = ''
2024-04-14 20:27:42 +02:00
addAutoPatchelfSearchPath $ out / $ { final . python . sitePackages } /PySide6
addAutoPatchelfSearchPath $ { final . shiboken6 } / $ { final . python . sitePackages } /shiboken6
2023-10-24 00:06:44 +09:00
'' ;
2023-10-26 15:22:38 +09:00
postInstall = ''
2024-04-14 20:27:42 +02:00
rm - r $ out / $ { final . python . sitePackages } /PySide6/__pycache__
2023-10-26 15:22:38 +09:00
'' ;
2024-01-11 10:01:14 -05:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
2023-10-24 00:06:44 +09:00
pkgs . libxkbcommon
pkgs . gtk3
pkgs . speechd
pkgs . gst
pkgs . gst_all_1 . gst-plugins-base
pkgs . gst_all_1 . gstreamer
pkgs . postgresql . lib
pkgs . unixODBC
pkgs . pcsclite
2023-10-26 15:22:38 +09:00
pkgs . xorg . libxcb
pkgs . xorg . xcbutil
pkgs . xorg . xcbutilcursor
pkgs . xorg . xcbutilerrors
pkgs . xorg . xcbutilimage
pkgs . xorg . xcbutilkeysyms
pkgs . xorg . xcbutilrenderutil
pkgs . xorg . xcbutilwm
pkgs . libdrm
pkgs . pulseaudio
2024-04-14 20:27:42 +02:00
final . shiboken6
2023-10-24 00:06:44 +09:00
] ;
} ) ;
2024-04-14 20:27:42 +02:00
pyside6-addons = prev . pyside6-addons . overridePythonAttrs ( old : lib . optionalAttrs stdenv . isLinux {
2023-10-26 15:22:38 +09:00
autoPatchelfIgnoreMissingDeps = [
" l i b m y s q l c l i e n t . s o . 2 1 "
" l i b m i m e r a p i . s o "
" l i b Q t 6 Q u i c k 3 D S p a t i a l A u d i o . s o . 6 "
" l i b Q t 6 Q u i c k 3 D H e l p e r s I m p l . s o . 6 "
] ;
preFixup = ''
2024-04-14 20:27:42 +02:00
addAutoPatchelfSearchPath $ { final . shiboken6 } / $ { final . python . sitePackages } /shiboken6
addAutoPatchelfSearchPath $ { final . pyside6-essentials } / $ { final . python . sitePackages } /PySide6
2023-10-24 00:06:44 +09:00
'' ;
2024-01-11 10:01:14 -05:00
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
2023-10-26 15:22:38 +09:00
pkgs . nss
pkgs . xorg . libXtst
pkgs . alsa-lib
pkgs . xorg . libxshmfence
pkgs . xorg . libxkbfile
2023-10-24 00:06:44 +09:00
] ;
postInstall = ''
2024-04-14 20:27:42 +02:00
rm - r $ out / $ { final . python . sitePackages } /PySide6/__pycache__
2023-10-24 00:06:44 +09:00
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
pytest-datadir = prev . pytest-datadir . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postInstall = ''
rm - f $ out/LICENSE
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
pytest = prev . pytest . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2022-01-21 12:46:20 +12:00
# Fixes https://github.com/pytest-dev/pytest/issues/7891
postPatch = old . postPatch or " " + ''
2022-05-10 15:25:58 +09:30
# sometimes setup.cfg doesn't exist
if [ - f setup . cfg ] ; then
sed - i ' / \ [ metadata \ ] /aversion = $ { old . version } ' setup . cfg
fi
2022-01-21 12:46:20 +12:00
'' ;
2023-10-23 12:23:59 -04:00
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [
2024-04-14 20:27:42 +02:00
final . toml
2023-10-23 12:23:59 -04:00
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
pytest-django = prev . pytest-django . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
2024-05-03 13:59:32 -05:00
# sometimes setup.py doesn't exist
if [ - f setup . py ] ; then
substituteInPlace setup . py - - replace " ' p y t e s t > = 3 . 6 ' , " " "
substituteInPlace setup . py - - replace " ' p y t e s t > = 3 . 6 ' " " "
fi
2020-10-06 15:39:37 +02:00
'' ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
pytest-randomly = prev . pytest-randomly . overrideAttrs ( old : {
2022-01-21 12:46:20 +12:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . importlib-metadata
2022-01-21 12:46:20 +12:00
] ;
} ) ;
2024-04-14 20:27:42 +02:00
pytest-mypy = prev . pytest-mypy . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 50 .3 . 0 ' ' setuptools' \
- - replace ' wheel ~ = 0 .36 . 0 ' ' wheel' \
- - replace ' setuptools-scm [ toml ] ~ = 5 .0 . 0 ' ' setuptools-scm [ toml ] ' \
'' ;
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [
2024-04-14 20:27:42 +02:00
final . toml
2023-10-23 12:23:59 -04:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
pytest-runner = prev . pytest-runner or prev . pytestrunner ;
2022-01-21 12:46:20 +12:00
2024-04-14 20:27:42 +02:00
pytest-pylint = prev . pytest-pylint . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2024-04-14 20:27:42 +02:00
buildInputs = [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
# pytest-splinter seems to put a .marker file in an empty directory
# presumably so it's tracked by and can be installed with MANIFEST.in, see
# https://github.com/pytest-dev/pytest-splinter/commit/a48eeef662f66ff9d3772af618748e73211a186b
#
# This directory then gets used as an empty initial profile directory and is
# zipped up. But if the .marker file is in the Nix store, it has the
# creation date of 1970, and Zip doesn't work with such old files, so it
# fails at runtime!
#
# We fix this here by just removing the file after the installation
#
# The error you get without this is:
#
# E ValueError: ZIP does not support timestamps before 1980
# /nix/store/55b9ip7xkpimaccw9pa0vacy5q94f5xa-python3-3.7.6/lib/python3.7/zipfile.py:357: ValueError
2024-04-14 20:27:42 +02:00
pytest-splinter = prev . pytest-splinter . overrideAttrs ( old : {
2022-01-21 12:46:20 +12:00
postInstall = old . postInstall or " " + ''
2024-04-14 20:27:42 +02:00
rm $ out / $ { prev . python . sitePackages } /pytest_splinter/profiles/firefox/.marker
2020-10-06 15:39:37 +02:00
'' ;
2022-01-21 12:46:20 +12:00
} ) ;
2024-04-14 20:27:42 +02:00
python-jose = prev . python-jose . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2024-04-14 20:27:42 +02:00
buildInputs = [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
python-magic = prev . python-magic . overridePythonAttrs (
2022-02-11 12:48:05 +01:00
old : {
postPatch = ''
substituteInPlace magic/loader.py \
- - replace " ' l i b m a g i c . s o . 1 ' " " ' ${ lib . getLib pkgs . file } / l i b / l i b m a g i c . s o . 1 ' "
'' ;
pythonImportsCheck = old . pythonImportsCheck or [ ] ++ [ " m a g i c " ] ;
}
) ;
2024-04-14 20:27:42 +02:00
python-olm = prev . python-olm . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = old . buildInputs or [ ] ++ [ pkgs . olm ] ;
}
) ;
2024-04-14 20:27:42 +02:00
python-pam = prev . python-pam . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2023-04-26 13:08:44 +02:00
postPatch = ''
substituteInPlace src/pam/__internals.py \
- - replace ' find_library ( " p a m " ) ' ' " ${ pkgs . pam } / l i b / l i b p a m . s o " ' \
- - replace ' find_library ( " p a m _ m i s c " ) ' ' " ${ pkgs . pam } / l i b / l i b p a m _ m i s c . s o " '
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
python-snappy = prev . python-snappy . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . snappy ] ;
}
) ;
2024-04-14 20:27:42 +02:00
python-twitter = prev . python-twitter . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-05-07 07:25:44 -06:00
} ) ;
2024-04-14 20:27:42 +02:00
pythran = prev . pythran . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2024-04-14 20:27:42 +02:00
ffmpeg-python = prev . ffmpeg-python . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
python-prctl = prev . python-prctl . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . libcap
2021-02-04 21:03:13 +01:00
] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
pyudev = prev . pyudev . overridePythonAttrs ( _old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
substituteInPlace src/pyudev/_ctypeslib/utils.py \
2022-01-21 15:08:33 +12:00
- - replace " f i n d _ l i b r a r y ( n a m e ) " " ' ${ lib . getLib pkgs . systemd } / l i b / l i b u d e v . s o ' "
2021-04-19 21:48:55 -03:00
'' ;
2022-01-21 12:46:20 +12:00
} ) ;
2024-04-14 20:27:42 +02:00
pyusb = prev . pyusb . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
libusb = $ { pkgs . libusb1 . out } /lib/libusb-1.0 $ { pkgs . stdenv . hostPlatform . extensions . sharedLibrary }
test - f $ libusb || { echo " E R R O R : $ l i b u s b d o e s n ' t e x i s t , p l e a s e u p d a t e / f i x t h i s b u i l d e x p r e s s i o n . " ; exit 1 ; }
sed - i - e " s | f i n d _ l i b r a r y = N o n e | f i n d _ l i b r a r y = l a m b d a _ : \" $ l i b u s b \" | " usb/backend/libusb1.py
'' ;
}
) ;
2021-04-19 21:48:55 -03:00
2024-04-14 20:27:42 +02:00
pywavelets = prev . pywavelets . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
HDF5_DIR = " ${ pkgs . hdf5 } " ;
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . hdf5 ] ;
}
) ;
2022-01-19 09:42:17 +03:00
2024-04-14 20:27:42 +02:00
pyzmq = prev . pyzmq . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . zeromq ] ;
2024-05-02 09:12:59 -04:00
# setting dontUseCmakeConfigure is necessary because:
#
# 1. pyzmq uses scikit-build-core as of pyzmq version 26.0.0
# 2. scikit-build-core requires the *Python* cmake package to find the cmake binary
# 3. since scikit-build-core's is in nativeBuildInputs and python
# cmake depends on pkgs.cmake that puts cmake in pyzmq's
# nativeBuildInputs
# 4. point 3 causes the pyzmq build it use vanilla cmake configure
# instead of cmake via scikit-build-core
#
# what a heaping mess
dontUseCmakeConfigure = lib . versionAtLeast old . version " 2 6 . 0 . 0 " ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-04-12 21:00:43 +02:00
2024-04-14 20:27:42 +02:00
recommonmark = prev . recommonmark . overridePythonAttrs (
2023-02-05 19:33:40 +08:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . commonmark ] ;
2023-02-05 19:33:40 +08:00
}
) ;
2024-04-14 20:27:42 +02:00
rich = prev . rich . overridePythonAttrs (
2023-02-03 16:08:02 +13:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . commonmark ] ;
2023-02-03 16:08:02 +13:00
}
) ;
2024-04-14 20:27:42 +02:00
rockset = prev . rockset . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
cp ./setup_rockset.py ./setup.py
'' ;
}
) ;
2020-01-12 20:29:23 +00:00
2024-04-14 20:27:42 +02:00
scaleapi = prev . scaleapi . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
substituteInPlace setup . py - - replace " i n s t a l l _ r e q u i r e s = [ ' r e q u e s t s > = 2 . 4 . 2 ' , ' e n u m 3 4 ' ] " " i n s t a l l _ r e q u i r e s = [ ' r e q u e s t s > = 2 . 4 . 2 ' ] " || true
'' ;
}
) ;
2020-01-23 13:21:13 +00:00
2024-04-14 20:27:42 +02:00
panel = prev . panel . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . nodejs ] ;
}
) ;
2020-08-27 18:22:57 +07:00
2022-01-21 12:46:20 +12:00
# Pybind11 is an undeclared dependency of scipy that we need to pick from nixpkgs
# Make it not fail with infinite recursion
2024-04-14 20:27:42 +02:00
pybind11 = prev . pybind11 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
cmakeFlags = ( old . cmakeFlags or [ ] ) ++ [
" - D P Y B I N D 1 1 _ T E S T = o f f "
] ;
doCheck = false ; # Circular test dependency
2023-01-21 16:38:30 +01:00
# Link include and share so it can be used by packages that use pybind11 through cmake
postInstall = ''
2024-04-14 20:27:42 +02:00
ln - s $ out / $ { final . python . sitePackages } /pybind11 / { include , share } $ out /
2023-01-21 16:38:30 +01:00
'' ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-08-25 18:11:19 +02:00
2024-04-14 20:27:42 +02:00
rapidfuzz = prev . rapidfuzz . overridePythonAttrs (
2023-10-23 12:23:59 -04:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
dontUseCmakeConfigure = true ;
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' scikit-build ~ = 0 .17 . 0 ' ' scikit-build' \
- - replace ' Cython = = 3 .0 . 0 b2' ' Cython'
'' ;
}
) ;
2024-05-02 12:10:53 -04:00
rasterio = prev . rasterio . overridePythonAttrs ( old : {
2024-03-09 12:10:18 -05:00
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [ gdal ] ;
2022-12-13 15:45:52 +13:00
} ) ;
2024-04-14 20:27:42 +02:00
referencing = prev . referencing . overridePythonAttrs ( old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-07-08 00:21:50 +03:00
postPatch = old . postPatch or " " + ''
sed - i " / T o p i c : : F i l e F o r m a t s : : J S O N / d " pyproject . toml
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
reportlab = prev . reportlab . overridePythonAttrs ( old : {
2023-11-14 07:40:56 +01:00
# They loop through LFS standard paths instead of just using pkg-config.
postPatch = ''
sed - i ' s | " / u s r / i n c l u d e / f r e e t y p e 2 " | " ${ pkgs . lib . getDev pkgs . freetype } " | ' setup . py
'' ;
2024-01-03 14:42:27 -05:00
buildInputs = old . buildInputs or [ ] ++ [ pkgs . freetype ] ;
2023-11-14 07:40:56 +01:00
} ) ;
2024-04-14 20:27:42 +02:00
rfc3986-validator = prev . rfc3986-validator . overridePythonAttrs ( old : {
2023-02-03 15:57:55 +13:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . pytest-runner
2023-02-03 15:57:55 +13:00
] ;
} ) ;
2024-04-14 20:27:42 +02:00
rlp = prev . rlp . overridePythonAttrs {
2022-01-21 12:46:20 +12:00
preConfigure = ''
substituteInPlace setup . py - - replace \ ' setuptools-markdown \ ' " "
'' ;
2020-08-17 03:34:58 +02:00
} ;
2022-01-21 12:46:20 +12:00
2024-04-14 20:27:42 +02:00
rmfuse = prev . rmfuse . overridePythonAttrs ( old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . setuptools ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2023-07-08 00:21:50 +03:00
rpds-py =
let
getCargoHash = version : {
" 0 . 8 . 8 " = " s h a 2 5 6 - j g 9 o o s 4 w q e w I H e 3 1 c 3 D i x I p 6 f s s k 7 4 2 k q t 4 t a W y O q 4 U = " ;
2023-07-10 07:56:24 -04:00
" 0 . 8 . 1 0 " = " s h a 2 5 6 - D 4 p b E i p V n 1 r 5 r r X + w D X i 9 7 n D Z J y B l k d q h m b J S g Q G T L U = " ;
2023-07-20 06:38:25 -04:00
" 0 . 8 . 1 1 " = " s h a 2 5 6 - Q Z N m / b 9 s / q r 3 G H w e 9 w G 7 U 9 / A a Q w S P H s Q 0 F 2 S F Q d g P N o = " ;
" 0 . 8 . 1 2 " = " s h a 2 5 6 - w y w B y t n f L B n B H 2 y Y i 2 e L Q j A S D m F N 9 V q P A B w M u S U x N 0 Q = " ;
" 0 . 9 . 2 " = " s h a 2 5 6 - 2 L i Q + b e F j 9 + k y k O b P N t q c g + F + 8 w B D z v W c a u w D L H a 7 Y o = " ;
2023-08-29 15:41:44 -07:00
" 0 . 1 0 . 0 " = " s h a 2 5 6 - F X j k 1 Y / E o l 4 d 1 x v w z 0 S 4 2 O y c Z V 0 c S H M 3 6 H + z j E m N P C Q = " ;
2023-09-05 13:37:17 +08:00
" 0 . 1 0 . 2 " = " s h a 2 5 6 - X 0 B u s t a 5 y 1 T o L c F 6 / 5 Z i a t P 8 m / n x F s V G W / b a 0 M S 4 h h g = " ;
2023-09-20 14:41:51 +07:00
" 0 . 1 0 . 3 " = " s h a 2 5 6 - i W y 6 B H V s K s Z B 0 S V r h 3 C V h r y a a v k 4 g A Q V v R d u 9 x B i D R g = " ;
2023-10-08 18:14:55 +07:00
" 0 . 1 0 . 4 " = " s h a 2 5 6 - J O z c 6 r B 6 5 o N h Q q j u D N e S g R h v X g 2 f Q D f 5 o g o Y z n a B j 5 Y = " ;
2023-10-23 15:10:16 +08:00
" 0 . 1 0 . 5 " = " s h a 2 5 6 - W B 1 P a J o d 7 R o m v m e + l c T R 6 l h 9 C A b g + 6 7 p t B j 8 3 8 b 3 K F c = " ;
" 0 . 1 0 . 6 " = " s h a 2 5 6 - 8 b X C T r Z E r d E 7 J h u o u d U / 4 d D n d C M w v j y 2 a + 2 I Y 0 D W D z g = " ;
2023-11-12 16:05:12 +01:00
" 0 . 1 1 . 0 " = " s h a 2 5 6 - 4 q / m + 8 U K A H 7 q 7 J r 9 5 v v p U / m e 0 p z v Y T i v c F A + u n f O e Q 8 = " ;
" 0 . 1 2 . 0 " = " s h a 2 5 6 - j d r 0 x N 3 P d / b C o K f L L F N G X H J + G 1 O R A f t 6 / W 7 V S 3 P b d H s = " ;
2023-11-17 17:00:12 +00:00
" 0 . 1 3 . 0 " = " s h a 2 5 6 - b H f x i B S N 7 / S b Z i y Y R j 0 1 p h w r p y H 7 F a 3 x V a A 3 c e W Z Y C E = " ;
2023-11-24 19:15:10 +02:00
" 0 . 1 3 . 1 " = " s h a 2 5 6 - Q 6 T N W C J Y l H n k a 4 N + Q 2 O c q S e 1 h 0 6 6 X 9 C Z K 9 p U F x x U g r I = " ;
2023-11-30 12:04:03 -08:00
" 0 . 1 3 . 2 " = " s h a 2 5 6 - j a L S r l 0 o T 3 F o / F 0 F f L v A 2 w D J k / F c 3 d 7 m B q w R q y W A O s g = " ;
2024-01-04 15:49:51 +08:00
" 0 . 1 4 . 0 " = " s h a 2 5 6 - C X E m C x n t k B I 0 6 J M B E 4 D 5 F D 9 G o W q q 9 9 d 1 x H B G / K O U R L 4 = " ;
" 0 . 1 4 . 1 " = " s h a 2 5 6 - 5 C K H + b b U 0 D G I w 6 v 1 / A s n G x s D 7 T i d J 5 5 l Q H Q u V S g b Y T o = " ;
" 0 . 1 4 . 2 " = " s h a 2 5 6 - b W F U u o i / I g I r C / g 9 T w D A i M v p P K e 6 + r / x d L f 2 G Z I h M y E = " ;
" 0 . 1 5 . 0 " = " s h a 2 5 6 - j F p R X c L B Z J 2 Z F i V 3 T D N 4 q r A i 2 I c J E K c P n O l U 6 t x X q o U = " ;
" 0 . 1 5 . 1 " = " s h a 2 5 6 - O A k K m S H h K w L k x 7 7 I 7 l S m J y j c h I t 1 k A g G I S f I W i q P k M 8 = " ;
" 0 . 1 5 . 2 " = " s h a 2 5 6 - 4 h k J 3 9 j N 2 V 7 4 / e J / M Q m L A x 8 s 0 D n Q T f s d N 1 b U 4 F v f i q 4 = " ;
" 0 . 1 6 . 0 " = " s h a 2 5 6 - I 1 F 9 B S + 0 p Q 7 k u f c K 5 d x f H j 0 L r V R 8 r 8 x M 6 k 8 m t f 7 e m Z 4 = " ;
" 0 . 1 6 . 1 " = " s h a 2 5 6 - a S X L P k R G r v y p 5 m L D n G 2 D 8 Z P g G 9 a 3 f X + g 1 K V i s N t R a d c = " ;
2024-01-08 12:35:39 +01:00
" 0 . 1 6 . 2 " = " s h a 2 5 6 - a P m i / 5 U A k e P f 4 n C 2 z R j X Y + v Z s A s i R Z q T H y Z Z m z F H c q E = " ;
2024-01-14 20:21:38 +01:00
" 0 . 1 7 . 1 " = " s h a 2 5 6 - s F u t r K L a 2 I S x t U N 7 h m w 2 P 0 2 n l 4 S M 6 H n 4 y j 1 k k X r N W m I = " ;
2024-02-20 05:27:39 +08:00
" 0 . 1 8 . 0 " = " s h a 2 5 6 - w d 1 t e R D h j Q W l K j F I a h U R j 0 i w c f k p y U v q I W X X s c W 7 e e k = " ;
2023-07-08 00:21:50 +03:00
} . ${ version } or (
lib . warn " U n k n o w n r p d s - p y v e r s i o n : ' ${ version } ' . P l e a s e u p d a t e g e t C a r g o H a s h . " lib . fakeHash
) ;
in
2024-04-14 20:27:42 +02:00
prev . rpds-py . overridePythonAttrs ( old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-07-08 00:21:50 +03:00
cargoDeps = pkgs . rustPlatform . fetchCargoTarball {
inherit ( old ) src ;
name = " ${ old . pname } - ${ old . version } " ;
hash = getCargoHash old . version ;
} ;
buildInputs = ( old . buildInputs or [ ] ) ++ lib . optionals stdenv . isDarwin [
pkgs . libiconv
] ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkgs . rustPlatform . cargoSetupHook
pkgs . rustPlatform . maturinBuildHook
] ;
} ) ;
2024-04-14 20:27:42 +02:00
rtree = prev . rtree . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
propagatedNativeBuildInputs = ( old . propagatedNativeBuildInputs or [ ] ) ++ [ pkgs . libspatialindex ] ;
postPatch = ''
substituteInPlace rtree/finder.py - - replace \
" f i n d _ l i b r a r y ( ' s p a t i a l i n d e x _ c ' ) " \
" ' ${ pkgs . libspatialindex } / l i b / l i b s p a t i a l i n d e x _ c ${ pkgs . stdenv . hostPlatform . extensions . sharedLibrary } ' "
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
ruamel-yaml = prev . ruamel-yaml . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ final . ruamel-yaml-clib ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2023-11-06 19:05:39 +00:00
ruff =
let
# generated with
# curl https://api.github.com/repos/astral-sh/ruff/releases | \
2024-01-06 11:04:14 -06:00
# jq -r '.[].tag_name' | tr '\n' '\0' | xargs -0 sh -c '
# for version in "$@"; do
# nix_prefetch=$(nix-prefetch-github astral-sh ruff --rev "$version") || exit;
# echo "\"${version#v}\" = \"$(echo "$nix_prefetch" | jq -r ".sha256 // .hash")\";"
# done' _
2023-11-06 19:05:39 +00:00
getRepoHash = version : {
2024-04-26 02:02:05 +02:00
" 0 . 4 . 2 " = " s h a 2 5 6 - A n A J i 0 s r z w x U / 2 2 U y + O j a S B d A E j C X H 9 9 J 7 V D v I 0 3 H D U = " ;
2024-04-22 12:10:08 +02:00
" 0 . 4 . 1 " = " s h a 2 5 6 - V T F w u N o q h 0 R L k 0 A H T P W E w r j a 0 / a E r m U l z 8 2 M n C c 5 8 j A = " ;
" 0 . 4 . 0 " = " s h a 2 5 6 - 9 X F 7 a H 3 c K 8 t / U q P 5 V 6 E n B i Z A n g N 8 E L y M A Y k e 8 o x w y L o = " ;
2024-04-13 03:59:43 +02:00
" 0 . 3 . 7 " = " s h a 2 5 6 - P S 4 Y J p V u t + K t E g S l T V t o V d l u 6 F V i p P I z s l 0 1 / I o 5 N 6 4 = " ;
2024-04-12 04:44:37 +02:00
" 0 . 3 . 6 " = " s h a 2 5 6 - X g p e y p 5 O A u B Q g Y Y V I a G t e Y 0 N A e P E Y J T Z D U x M h 0 a 3 + / g = " ;
2024-04-06 12:11:06 +02:00
" 0 . 3 . 5 " = " s h a 2 5 6 - s G m N r k Z v 0 3 y z E m 9 f M 0 0 H / B Z n V r 9 1 5 L W 3 q G W j c i 1 Q A C c = " ;
2024-03-24 15:28:32 +01:00
" 0 . 3 . 4 " = " s h a 2 5 6 - P 0 k / 0 t W b h Y 2 H a x I 4 Q T h x p H D 4 8 J U j t F / d 3 i U 4 M I F h d H I = " ;
2024-03-18 15:39:59 +01:00
" 0 . 3 . 3 " = " s h a 2 5 6 - u E r h X 0 G y J 1 P 5 Y F p Q k w w i 7 o K v L k K 7 l z i A z z / 3 a t 7 p f A 0 = " ;
2024-03-12 15:40:59 +01:00
" 0 . 3 . 2 " = " s h a 2 5 6 - 2 P t 2 H u D B 9 J L D 9 E 1 q 0 J H 7 j y V o c 0 I I 5 u V L 1 l 8 p A o d + 9 V 4 = " ;
" 0 . 3 . 1 " = " s h a 2 5 6 - M u v V p M B E Q S O z 6 v S E h w 7 f m v A w g U u / 7 h r b t P 8 / M s I L 5 7 c = " ;
2024-03-01 19:08:59 +01:00
" 0 . 3 . 0 " = " s h a 2 5 6 - U 7 7 B w g b t 2 T 8 x k a m r W O n O p N R F + 8 s k L W h X 8 J q g P q o w c Q w = " ;
2024-02-20 10:54:47 +01:00
" 0 . 2 . 2 " = " s h a 2 5 6 - w C j P l K l w 0 I A h 5 o H 4 W 7 D U w 3 K B x R 4 b t 9 H o 7 n c R L 5 T b D / 0 = " ;
" 0 . 2 . 1 " = " s h a 2 5 6 - V c D D G i 6 f P G Z 7 5 + J 7 a O S r 7 S 6 G t 5 b p r 0 v M 2 S k / U t l m f 4 k = " ;
2024-01-14 15:12:07 +01:00
" 0 . 2 . 0 " = " s h a 2 5 6 - x i v Z H f Q c d l p 2 c c p Z i K b + Z 7 0 E j 8 V q u q y / 5 A + M L p k E f 2 E = " ;
2024-01-14 15:12:07 +01:00
" 0 . 1 . 1 5 " = " s h a 2 5 6 - D z d z M O 9 P E w f 4 H m p G 8 S x R J T m d r m k X u Q 8 R s I c h v s K s t H 8 = " ;
" 0 . 1 . 1 4 " = " s h a 2 5 6 - U T X C 0 w b i H / P u u 8 g O X s D / y L M p r e 3 I J P a T 7 3 Z / 0 r G S t Y U = " ;
" 0 . 1 . 1 3 " = " s h a 2 5 6 - c H / V w 0 4 Q Q 3 U 7 E 1 Z C w o z j h P c n 0 K V l j P 9 7 6 / p 3 o k r B p E U = " ;
2024-01-12 00:36:47 -05:00
" 0 . 1 . 1 2 " = " s h a 2 5 6 - P h m g / W p u i U h A M Z w u t / i 6 b i y n Y X T T a I O x R T I y J 8 N N v C s = " ;
2024-01-06 11:04:14 -06:00
" 0 . 1 . 1 1 " = " s h a 2 5 6 - y K b 7 4 G A D e A L a i 4 q Z / + d R 6 u / Q z K Q F 5 4 0 4 + Y J K S Y U / o F U = " ;
" 0 . 1 . 1 0 " = " s h a 2 5 6 - u F b q L 4 h F V p H 1 2 g S C U m i b + Q 2 4 c A p W K t G a 8 m R m K F U T Q o k = " ;
" 0 . 1 . 9 " = " s h a 2 5 6 - D t z z h 4 e r s T L b A s G 0 6 d 8 d J a 1 r F g s r u i c U 0 b X l 5 I A U Z M g = " ;
2024-05-02 07:25:41 -04:00
" 0 . 1 . 8 " = " s h a 2 5 6 - z f 2 2 8 0 a S m G s t c g x o U / I W t d t d W E x v d K L B N h 4 C n 5 t C 1 v U = " ;
2023-12-11 16:02:21 +08:00
" 0 . 1 . 7 " = " s h a 2 5 6 - A l 2 5 6 / 8 A / e f L r f 9 7 x C w E o c w g s 3 n g P n E A m k f c L W d l k T w = " ;
" 0 . 1 . 6 " = " s h a 2 5 6 - E X 1 t X e 8 K l w j r o h z g z K D e J P 0 P j f K w 8 + l n Q 7 e g 9 P A U A f Q = " ;
2024-05-02 07:25:41 -04:00
" 0 . 1 . 5 " = " s h a 2 5 6 - g 5 2 c I w 0 a f / w Q S u A 4 Q h C 2 d C j c D G i k i r s w B D A t w f 8 D r v o = " ;
" 0 . 1 . 4 " = " s h a 2 5 6 - v d h y z F U i m c 9 g B s L p k 7 W K w Q Q 0 Y t G J g 3 u s + 6 J C F n X S M r I = " ;
" 0 . 1 . 3 " = " s h a 2 5 6 - A H n E v D z u Q d 6 W + n 9 w X h M t 6 T J w o H 1 r Z E Y 5 U X b h F G w l 8 + g = " ;
" 0 . 1 . 2 " = " s h a 2 5 6 - h m j s r 7 Z 5 k 0 t X 1 e 6 I B Y W u f n Q 4 l 7 q e b y q k R T u U L m o H q v M = " ;
" 0 . 1 . 1 " = " s h a 2 5 6 - s B W B 8 s 9 Q K e d a c t L f S D P q 5 t C d l E L k T G B 0 j D Q H 1 S 8 H q 4 k = " ;
" 0 . 1 . 0 " = " s h a 2 5 6 - w 4 x F I Y m v K 8 n C e C I M 3 S x S 2 O d A K 3 L m V 3 5 h 0 Q k X h + t Y P 7 w = " ;
2023-11-06 19:05:39 +00:00
" 0 . 0 . 2 9 2 " = " 4 D 7 p 5 Z M d y e m D B a W c C O 6 2 b h u P P c I y p e g q P 0 Y Z e X + G J R Q = " ;
" 0 . 0 . 2 9 1 " = " f A u k X L 0 i n A P d D p f / / 4 y H Y I Q I K j 3 I i f X 9 O b A M 7 V s k D F I = " ;
" 0 . 0 . 2 9 0 " = " w 2 R q T 0 n + + g g e N o E c r Z S A F 0 0 5 6 c t D B K G k V + G A s c Q c w O c = " ;
" 0 . 0 . 2 8 9 " = " D B Y E 3 U k A 3 0 b F q o T C g E 7 S B s 2 5 w J 6 b P v Y 6 3 e 3 1 L E P B K 7 c = " ;
" 0 . 0 . 2 8 8 " = " r D z x G I D U I x K 5 n 8 u T 0 v S F G r p 4 w O m 4 9 K t Y 7 x K R o L Z h E F 8 = " ;
" 0 . 0 . 2 8 7 " = " T 7 P u h Q n b 7 A e 9 m Y d a x D B l t J W x 5 O D T s c v E P 3 L c S E c S u L o = " ;
" 0 . 0 . 2 8 6 " = " 5 b M f O j u 1 u J V 4 + a 4 U T z a a n p z U 6 P j C S K 9 H H M d h v K V a N c g = " ;
" 0 . 0 . 2 8 5 " = " n 5 F j z n g d V S H H n B p V G F X z P l U A E M x 9 6 J q j Y q g K w y m T M z A = " ;
" 0 . 0 . 2 8 4 " = " M A l I e p o d G Q L 2 t H R I P X s H L g 4 r D Y g j f q 1 o p a X I k j N N W 1 I = " ;
" 0 . 0 . 2 8 3 " = " W q v T n / N G y Z q 9 c J 4 1 7 K P O V E E s h D I T x s 6 X d h w Z b C X P k 2 o = " ;
" 0 . 0 . 2 8 2 " = " C Q s g R T p Z T B j 0 7 / 9 S Y k r Q X t b 5 F O g u C t f 5 L C l i 6 5 v 2 0 Y A = " ;
" 0 . 0 . 2 8 1 " = " r I N 2 G a N r H O 6 s + 6 f M U N 1 a 4 H 5 8 r y o T r 8 E M j k X 3 4 Y C C K a U = " ;
" 0 . 0 . 2 8 0 " = " P p / y u r R P U H q r C D 3 V 9 3 z 5 E G M Y f 4 I y L F Q O L 9 d 2 s N e 3 T K s = " ;
" 0 . 0 . 2 7 9 " = " 7 f / c a a C b Y t + U a t d 1 2 g A T S J g s 5 N x / X 7 Y Z h X E E S l 5 O t W E = " ;
" 0 . 0 . 2 7 8 " = " C M 5 o V 9 q 9 X Y h a U V 1 7 3 V o F Z l 6 d D A L a n 4 L k l 5 P r v Z N 8 1 c 4 = " ;
" 0 . 0 . 2 7 7 " = " o F S M s i y 9 a i r i / S w O x A 3 Y O 0 2 p o l v F l 8 Z Z U H k D 7 1 c 5 u n A = " ;
" 0 . 0 . 2 7 6 " = " a b F v j B m a Y 6 S v f E H m / 8 P 9 2 s 3 N s 3 j s w L H r W 2 R d Z c 6 I S 6 4 = " ;
" 0 . 0 . 2 7 5 " = " H s o y c u g H z g u d Y 3 A i x v 5 I N l O L T j L M z P + g K M M K I r e i O D s = " ;
" 0 . 0 . 2 7 4 " = " 0 J a e L v c 6 p w v t 9 a 7 w A b a h 6 s V g m H f 6 G P a r w d k i W 3 j Q P a Q = " ;
" 0 . 0 . 2 7 3 " = " F Z W C A 4 o E U e 7 h O o d t V y p v q X v 4 R E X C A E g Y 0 s 6 w Q S K D W u I = " ;
" 0 . 0 . 2 7 2 " = " B 4 w Z T K C 1 Z 6 O x X Q H r G 9 Q 9 V j Y 6 Z n A 3 F O o M M N f r o e + 1 A 7 I = " ;
" 0 . 0 . 2 7 1 " = " P Y z W L E u h U 2 D 6 S q 1 J E o y A k l 4 n f a M H a S 7 G 6 S L N K a o A J p E = " ;
" 0 . 0 . 2 7 0 " = " r r u N N P / V k v M Q e x Q + V / A S x l 5 f l H t 0 0 Y o m M A V z W + e W p 2 0 = " ;
2024-01-14 15:12:07 +01:00
} . ${ version } or (
lib . warn " U n k n o w n r u f f v e r s i o n : ' ${ version } ' . P l e a s e u p d a t e g e t R e p o H a s h . " lib . fakeHash
) ;
2024-01-14 15:12:07 +01:00
getCargoHash = version : {
2024-04-26 02:02:05 +02:00
" 0 . 4 . 2 " = " s h a 2 5 6 - K p B 5 x H P u k 5 q b 2 y D H f e 9 U 9 5 q N M g W 0 P H X 9 R J c O O k K R E s Y = " ;
2024-04-22 12:10:08 +02:00
" 0 . 4 . 1 " = " s h a 2 5 6 - H 2 U L x 1 U X k R m C y C 7 f k y 3 9 4 Q 8 z 3 H Z a N b w F 7 I q A i d Y 6 / A c = " ;
" 0 . 4 . 0 " = " s h a 2 5 6 - F R D n T v + 3 p n / e V / T J + f d H i W I t t c K Z 8 V D g F 3 E L j x q Z p 1 4 = " ;
2024-04-13 03:59:43 +02:00
" 0 . 3 . 7 " = " s h a 2 5 6 - T 5 l Y o W V 9 H d w N 2 2 A D i 6 c e 6 6 L M 8 X E O u q H x / o c T P h n l 1 H k = " ;
2024-04-12 04:44:37 +02:00
" 0 . 3 . 6 " = " s h a 2 5 6 - O c Z R r A R G V c P U a t D z m W V L H j p T a J b L d 0 X j A y N X M z N B x P 8 = " ;
2024-04-06 12:11:06 +02:00
" 0 . 3 . 5 " = " s h a 2 5 6 - c k K G 2 k N x U t / m J q 4 D B k + E 2 a e e 6 x x + / S 5 0 z 2 C x f q n i 6 i o = " ;
2024-03-24 15:28:32 +01:00
" 0 . 3 . 4 " = " s h a 2 5 6 - t r C l 2 I B P h 3 3 v Z 1 4 P G L x x I t b 1 S 0 / 6 U X n F 1 G M F N w v l n Z A = " ;
2024-03-18 15:39:59 +01:00
" 0 . 3 . 3 " = " s h a 2 5 6 - O Y 7 K k I 6 D j i G l c / b V 1 / 1 L x 4 A d x u G n J x L + L L j 1 g n V 7 I b s = " ;
2024-03-12 15:40:59 +01:00
" 0 . 3 . 2 " = " s h a 2 5 6 - 3 Z 1 r r 7 0 g o i Y p H n 6 k n O 2 K g j X w O M w D 3 E h Y 3 P w s d G q K N h M = " ;
" 0 . 3 . 1 " = " s h a 2 5 6 - D P y n b 9 T 4 M 5 H f 3 Y f T A R y b J s v p v g Q u u L Z + d G S G 6 v 5 Y J Y E = " ;
2024-03-01 19:08:59 +01:00
" 0 . 3 . 0 " = " s h a 2 5 6 - t y M w 1 I o 8 F p y O W W w k Q u 8 H K 1 n E m O n s / a K m 2 G t L I 8 B 7 N B c = " ;
2024-02-20 10:54:47 +01:00
" 0 . 2 . 2 " = " s h a 2 5 6 - L g K i U W d 7 m W V u Z D s n M + 1 K V S 5 T r z e 4 F u n h 2 w 8 c I L z s R Y 8 = " ;
" 0 . 2 . 1 " = " s h a 2 5 6 - a t u Z w 8 T M L / C u j T s X G L d S o a h P 1 y 0 4 q d x j c m i N V L y 0 f n s = " ;
2024-01-14 15:12:07 +01:00
" 0 . 2 . 0 " = " s h a 2 5 6 - z l a t D y C W Z r 4 i F Y 0 f V C z h Q m U G J x K M Q v Z d 6 H A t 0 P F l M w Y = " ;
" 0 . 1 . 1 5 " = " s h a 2 5 6 - M 6 q G G / J n i E d N O 2 Q c w 7 u 5 2 J U J a h u c g i Z c j W O a q 5 0 E 6 N s = " ;
} . ${ version } or (
lib . warn " U n k n o w n r u f f v e r s i o n : ' ${ version } ' . P l e a s e u p d a t e g e t C a r g o H a s h . " null
2024-02-20 05:27:39 +08:00
) ;
2024-01-14 15:12:07 +01:00
2024-04-14 20:27:42 +02:00
sha256 = getRepoHash prev . ruff . version ;
2023-11-06 19:05:39 +00:00
in
2024-04-14 20:27:42 +02:00
prev . ruff . overridePythonAttrs ( old :
2024-02-20 05:27:39 +08:00
let
src = pkgs . fetchFromGitHub {
owner = " a s t r a l - s h " ;
repo = " r u f f " ;
rev = " v ${ old . version } " ;
inherit sha256 ;
} ;
2024-01-14 15:12:07 +01:00
2024-04-14 20:27:42 +02:00
cargoDeps = let hash = getCargoHash prev . ruff . version ; in
2024-02-20 05:27:39 +08:00
if hash = = null then
pkgs . rustPlatform . importCargoLock
{
lockFile = " ${ src . out } / C a r g o . l o c k " ;
} else
pkgs . rustPlatform . fetchCargoTarball {
name = " r u f f - ${ old . version } - c a r g o - d e p s " ;
inherit src hash ;
} ;
in
lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
inherit src cargoDeps ;
2024-01-14 15:12:07 +01:00
2024-02-20 05:27:39 +08:00
buildInputs = ( old . buildInputs or [ ] ) ++ lib . optionals stdenv . isDarwin [
pkgs . darwin . apple_sdk . frameworks . Security
pkgs . darwin . apple_sdk . frameworks . CoreServices
pkgs . libiconv
] ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkgs . rustPlatform . cargoSetupHook
pkgs . rustPlatform . maturinBuildHook
] ;
} ) ;
2023-11-06 19:05:39 +00:00
2024-04-14 20:27:42 +02:00
scipy = prev . scipy . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old :
if old . format != " w h e e l " then {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++
[ pkgs . gfortran ] ++
2024-04-14 20:27:42 +02:00
lib . optionals ( lib . versionAtLeast prev . scipy . version " 1 . 7 . 0 " ) [ final . pythran ] ++
lib . optionals ( lib . versionAtLeast prev . scipy . version " 1 . 9 . 0 " ) [ final . meson-python pkg-config ] ;
2023-03-15 17:32:28 +13:00
dontUseMesonConfigure = true ;
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . pybind11 ] ;
2022-01-21 12:46:20 +12:00
setupPyBuildFlags = [ " - - f c o m p i l e r = ' g n u 9 5 ' " ] ;
enableParallelBuilding = true ;
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . numpy . blas ] ;
2022-01-21 12:46:20 +12:00
preConfigure = ''
export NPY_NUM_BUILD_JOBS = $ NIX_BUILD_CORES
2024-04-14 20:27:42 +02:00
'' + l i b . o p t i o n a l S t r i n g ( l i b . v e r s i o n O l d e r p r e v . s c i p y . v e r s i o n " 1 . 1 1 . 1 " ) ''
2024-01-04 16:38:17 -05:00
sed - i ' 0 , /from numpy.distutils.core/s // import setuptools ; from numpy . distutils . core / ' setup . py
2022-01-21 12:46:20 +12:00
'' ;
2024-04-14 20:27:42 +02:00
preBuild = lib . optional ( lib . versionOlder prev . scipy . version " 1 . 9 . 0 " ) ''
ln - s $ { final . numpy . cfg } site . cfg
2022-01-21 12:46:20 +12:00
'' ;
2023-10-23 12:23:59 -04:00
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' wheel < 0 .38 . 0 ' ' wheel' \
- - replace ' pybind11 >= 2 .4 .3 , < 2 .11 . 0 ' ' pybind11' \
- - replace ' pythran >= 0 .9 .12 , < 0 .13 . 0 ' ' pythran' \
- - replace ' setuptools <= 51 .0 . 0 ' ' setuptools'
sed - i pyproject . toml - e ' s/numpy = = [ 0 -9 ] \ + \ . [ 0 -9 ] \ + \ . [ 0 -9 ] \ + ; /numpy ; /g '
'' ;
2022-01-21 12:46:20 +12:00
} else old
) ;
2024-04-14 20:27:42 +02:00
scikit-build-core = prev . scikit-build-core . overridePythonAttrs (
2024-05-02 09:12:59 -04:00
old : {
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [
2024-04-14 20:27:42 +02:00
final . pyproject-metadata
final . pathspec
2024-05-02 09:12:59 -04:00
# these are _intentionally_ the *Python* wrappers for cmake and
# ninja, both of which are used by scikit-build-core
2024-04-14 20:27:42 +02:00
final . cmake
final . ninja
2024-05-02 09:12:59 -04:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
scikit-image = prev . scikit-image . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . pythran
final . packaging
final . wheel
final . numpy
2022-01-21 12:46:20 +12:00
] ;
2020-08-17 03:34:58 +02:00
}
2022-01-21 12:46:20 +12:00
) ;
2024-04-14 20:27:42 +02:00
gitlint = prev . gitlint . overridePythonAttrs (
2024-03-09 12:10:18 -05:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
postPatch = old . postPatch or " " + ''
{
echo ' [ tool . hatch . build . targets . wheel ] '
echo ' packages = [ " g i t l i n t - c o r e / g i t l i n t " ] '
} > > pyproject . toml
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
scikit-learn = prev . scikit-learn . overridePythonAttrs (
2024-03-09 12:10:18 -05:00
old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
nativeBuildInputs = old . nativeBuildInputs or [ ] ++ [
2024-04-14 20:27:42 +02:00
final . cython
2022-01-21 12:46:20 +12:00
pkgs . gfortran
] ++ lib . optionals stdenv . cc . isClang [
pkgs . llvmPackages . openmp
2022-01-22 20:01:07 +12:00
] ++ lib . optionals stdenv . isLinux [
pkgs . glibcLocales
2022-01-21 12:46:20 +12:00
] ;
enableParallelBuilding = true ;
2023-10-23 12:23:59 -04:00
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools < 60 . 0 ' ' setuptools'
'' ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
secp256k1 = prev . secp256k1 . overridePythonAttrs ( old : {
2023-12-05 22:59:10 +01:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . pkg-config pkgs . autoconf pkgs . automake pkgs . libtool ] ;
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
doCheck = false ;
# Local setuptools versions like "x.y.post0" confuse an internal check
postPatch = ''
substituteInPlace setup . py \
2024-04-14 20:27:42 +02:00
- - replace ' setuptools_version . ' ' " ${ final . setuptools . version } " . ' \
2022-06-11 02:54:44 +08:00
- - replace ' pytest-runner = = ' ' pytest-runner >= '
2022-01-21 12:46:20 +12:00
'' ;
2021-01-30 12:48:31 +01:00
} ) ;
2020-01-20 15:52:00 +00:00
2023-01-19 10:44:07 +00:00
selenium =
let
2024-04-14 20:27:42 +02:00
v4orLater = lib . versionAtLeast prev . selenium . version " 4 " ;
selenium = prev . selenium . override {
2023-01-19 10:44:07 +00:00
# Selenium >=4 is built with Bazel
preferWheel = v4orLater ;
} ;
in
selenium . overridePythonAttrs ( old : {
# Selenium <4 can be installed from sources, with setuptools
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ ( lib . optionals ( ! v4orLater ) [ final . setuptools ] ) ;
2023-01-19 10:44:07 +00:00
} ) ;
2024-04-14 20:27:42 +02:00
shapely = prev . shapely . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2023-01-30 14:46:52 +13:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . geos ] ;
2023-03-15 17:42:25 +13:00
GEOS_LIBRARY_PATH = " ${ pkgs . geos } / l i b / l i b g e o s _ c ${ stdenv . hostPlatform . extensions . sharedLibrary } " ;
2022-05-12 22:23:05 +12:00
2022-05-29 23:04:06 +08:00
GEOS_LIBC = lib . optionalString ( ! stdenv . isDarwin ) " ${ lib . getLib stdenv . cc . libc } / l i b / l i b c ${ stdenv . hostPlatform . extensions . sharedLibrary } . 6 " ;
2022-05-12 22:23:05 +12:00
# Fix library paths
2023-01-07 06:55:46 -05:00
postPatch = lib . optionalString ( ! ( old . src . isWheel or false ) ) ( old . postPatch or " " + ''
2022-05-13 08:30:51 -04:00
$ { pkgs . python3 . interpreter } $ { ./shapely-rewrite.py } shapely/geos.py
2023-10-23 12:23:59 -04:00
substituteInPlace pyproject . toml - - replace ' setuptools < 6 4 ' ' setuptools'
2022-12-17 15:17:52 -05:00
'' ) ;
2022-01-21 12:46:20 +12:00
}
) ;
2020-10-05 21:45:15 +08:00
2024-04-14 20:27:42 +02:00
jsii = prev . jsii . overridePythonAttrs ( old : lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) {
2023-10-23 12:23:59 -04:00
postPatch = ''
substituteInPlace pyproject . toml \
- - replace ' setuptools ~ = 62 . 2 ' ' setuptools' \
- - replace ' wheel ~ = 0 . 3 7 ' ' wheel'
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
shellcheck-py = prev . shellcheck-py . overridePythonAttrs ( old : {
2020-10-05 21:45:15 +08:00
2022-01-21 12:46:20 +12:00
# Make fetching/installing external binaries no-ops
preConfigure =
let
fakeCommand = " t y p e ( ' F a k e C o m m a n d ' , ( C o m m a n d , ) , { ' i n i t i a l i z e _ o p t i o n s ' : l a m b d a s e l f : N o n e , ' f i n a l i z e _ o p t i o n s ' : l a m b d a s e l f : N o n e , ' r u n ' : l a m b d a s e l f : N o n e } ) " ;
in
''
substituteInPlace setup . py \
- - replace " ' f e t c h _ b i n a r i e s ' : f e t c h _ b i n a r i e s , " " ' f e t c h _ b i n a r i e s ' : ${ fakeCommand } , " \
- - replace " ' i n s t a l l _ s h e l l c h e c k ' : i n s t a l l _ s h e l l c h e c k , " " ' i n s t a l l _ s h e l l c h e c k ' : ${ fakeCommand } , "
'' ;
2021-03-30 11:02:40 +02:00
2022-01-21 12:46:20 +12:00
propagatedUserEnvPkgs = ( old . propagatedUserEnvPkgs or [ ] ) ++ [
pkgs . shellcheck
] ;
2020-10-12 15:58:12 +08:00
2022-01-21 12:46:20 +12:00
} ) ;
2021-01-21 10:43:32 +01:00
2024-04-14 20:27:42 +02:00
soundfile = prev . soundfile . overridePythonAttrs ( _old : {
2022-04-16 23:36:17 -04:00
postPatch = ''
substituteInPlace soundfile . py - - replace " _ f i n d _ l i b r a r y ( ' s n d f i l e ' ) " " ' ${ pkgs . libsndfile . out } / l i b / l i b s n d f i l e ${ stdenv . hostPlatform . extensions . sharedLibrary } ' "
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
sqlmodel = prev . sqlmodel . overridePythonAttrs ( old : {
2023-08-22 14:12:19 +00:00
patchPhase = builtins . concatStringsSep " \n " [
( old . patchPhase or " " )
# sqlmodel's pyproject.toml lists version = "0" that it changes during a build phase
# If this isn't fixed, it gets a vague "ERROR: No matching distribution for sqlmodel..." error
''
substituteInPlace " p y p r o j e c t . t o m l " - - replace ' version = " 0 " ' ' version = " ${ old . version } " '
''
] ;
} ) ;
2024-04-14 20:27:42 +02:00
suds = prev . suds . overridePythonAttrs ( _old : {
2022-09-27 13:29:15 +02:00
# Fix naming convention shenanigans.
# https://github.com/suds-community/suds/blob/a616d96b070ca119a532ff395d4a2a2ba42b257c/setup.py#L648
SUDS_PACKAGE = " s u d s " ;
} ) ;
2024-04-14 20:27:42 +02:00
systemd-python = prev . systemd-python . overridePythonAttrs ( old : {
2023-07-06 21:51:04 -05:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . systemd ] ;
2022-01-21 12:46:20 +12:00
nativeBuildInputs = old . nativeBuildInputs ++ [ pkgs . pkg-config ] ;
} ) ;
2021-01-21 11:59:20 +01:00
2024-04-14 20:27:42 +02:00
tables = prev . tables . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pywavelets ] ;
2022-01-21 12:46:20 +12:00
HDF5_DIR = lib . getDev pkgs . hdf5 ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkgs . hdf5 final . numpy final . numexpr ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-18 15:45:06 +12:00
2024-04-14 20:27:42 +02:00
tempora = prev . tempora . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
# required for the extra "toml" dependency in setuptools_scm[toml]
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . toml
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2021-06-08 19:50:58 +02:00
2024-04-14 20:27:42 +02:00
tensorboard = prev . tensorboard . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . wheel
final . absl-py
2022-01-21 12:46:20 +12:00
] ;
HDF5_DIR = " ${ pkgs . hdf5 } " ;
propagatedBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkgs . hdf5
2024-04-14 20:27:42 +02:00
final . google-auth-oauthlib
final . tensorboard-plugin-wit
final . numpy
final . markdown
final . tensorboard-data-server
final . grpcio
final . protobuf
final . werkzeug
final . absl-py
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2024-05-02 12:10:53 -04:00
tensorflow-io-gcs-filesystem = prev . tensorflow-io-gcs-filesystem . overridePythonAttrs (
2024-03-01 21:58:54 +01:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . libtensorflow
] ;
}
) ;
2024-04-14 20:27:42 +02:00
tensorflow = prev . tensorflow . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postInstall = ''
rm $ out/bin/tensorboard
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
tensorflow-macos = prev . tensorflow-macos . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2024-04-14 20:27:42 +02:00
inherit ( final . tensorflow ) postInstall ;
2022-11-02 20:00:54 +00:00
}
) ;
2024-04-14 20:27:42 +02:00
tensorpack = prev . tensorpack . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postPatch = ''
substituteInPlace setup . cfg - - replace " # w i l l c a l l f i n d _ p a c k a g e s ( ) " " "
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
tinycss2 = prev . tinycss2 . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
# The tokenizers build requires a complex rust setup (cf. nixpkgs override)
#
# Instead of providing a full source build, we use a wheel to keep
# the complexity manageable for now.
2024-04-14 20:27:42 +02:00
tokenizers = prev . tokenizers . override {
2022-01-21 12:46:20 +12:00
preferWheel = true ;
} ;
2024-04-14 20:27:42 +02:00
torch = prev . torch . overridePythonAttrs ( old : {
2023-04-06 16:44:31 -07:00
# torch has an auto-magical way to locate the cuda libraries from site-packages.
autoPatchelfIgnoreMissingDeps = true ;
2024-03-05 14:15:46 +01:00
2023-04-06 16:44:31 -07:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . numpy
2023-04-06 16:44:31 -07:00
] ;
} ) ;
2022-01-21 12:46:20 +12:00
2024-04-14 20:27:42 +02:00
torchvision = prev . torchvision . overridePythonAttrs ( old : {
2023-04-06 17:18:01 -07:00
autoPatchelfIgnoreMissingDeps = true ;
2023-04-06 21:15:00 -07:00
# (no patchelf on darwin, since no elves there.)
preFixup = lib . optionals ( ! stdenv . isDarwin ) ''
2024-04-14 20:27:42 +02:00
addAutoPatchelfSearchPath " ${ final . torch } / ${ final . python . sitePackages } / t o r c h / l i b "
2023-04-06 17:18:01 -07:00
'' ;
2023-04-06 17:19:04 -07:00
2023-04-06 17:18:01 -07:00
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . torch
2023-04-06 17:18:01 -07:00
] ;
} ) ;
2022-01-21 12:46:20 +12:00
2023-04-06 16:27:16 -07:00
# Circular dependency between triton and torch (see https://github.com/openai/triton/issues/1374)
# You can remove this once triton publishes a new stable build and torch takes it.
2024-04-14 20:27:42 +02:00
triton = prev . triton . overridePythonAttrs ( old : {
2024-05-06 01:37:47 +00:00
propagatedBuildInputs = ( builtins . filter ( e : e . pname != " t o r c h " ) old . propagatedBuildInputs ) ++ [
# Used in https://github.com/openai/triton/blob/3f8d91bb17f6e7bc33dc995ae0860db89d351c7b/python/triton/common/build.py#L10
final . setuptools
] ;
2023-04-06 16:27:16 -07:00
pipInstallFlags = [ " - - n o - d e p s " ] ;
} ) ;
2024-04-14 20:27:42 +02:00
typed_ast = prev . typed-ast . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . pytest-runner
2022-01-21 12:46:20 +12:00
] ;
} ) ;
2024-04-14 20:27:42 +02:00
urwidtrees = prev . urwidtrees . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . urwid
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
vose-alias-method = prev . vose-alias-method . overridePythonAttrs (
2023-10-26 12:18:24 +13:00
_old : {
2022-01-21 12:46:20 +12:00
postInstall = ''
rm - f $ out/LICENSE
'' ;
}
) ;
2024-04-14 20:27:42 +02:00
vispy = prev . vispy . overrideAttrs (
2022-01-21 12:46:20 +12:00
old : {
inherit ( pkgs . python3 . pkgs . vispy ) patches ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . setuptools-scm
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
uvloop = prev . uvloop . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ lib . optionals stdenv . isDarwin [
pkgs . darwin . apple_sdk . frameworks . ApplicationServices
pkgs . darwin . apple_sdk . frameworks . CoreServices
] ;
}
) ;
2022-10-06 14:21:37 +02:00
watchfiles =
let
# Watchfiles does not include Cargo.lock in tarball released on PyPi for versions up to 0.17.0
getRepoHash = version : {
2023-10-14 09:24:11 +02:00
" 0 . 2 1 . 0 " = " s h a 2 5 6 - / q N g k P F 5 N 8 j z S V 3 M 0 Y F W v Q n g Z 4 H f 4 W M / G B S 1 L t g F b W M = " ;
2023-08-28 10:34:06 +07:00
" 0 . 2 0 . 0 " = " s h a 2 5 6 - e o K F 6 u B H g M L 6 3 D r D l C 1 z P f D u / m A M o a e v t t w q H L C K h + M = " ;
2023-03-28 00:59:01 -03:00
" 0 . 1 9 . 0 " = " s h a 2 5 6 - N m m e o a I f F M N K C c j H 6 t P n k p f l k N 3 5 b K l T 7 6 M q F 9 W 8 L B c = " ;
2022-12-06 14:30:00 +01:00
" 0 . 1 8 . 1 " = " s h a 2 5 6 - X E h u 6 M 1 h F i 3 / g A K Z c e i 7 K J S r I h h l Z h l v Z v b f y A 6 V L R 4 = " ;
2022-11-07 00:21:56 -08:00
" 0 . 1 8 . 0 " = " s h a 2 5 6 - b i G G n 0 Y A U b S O 1 h C J 4 k U 0 Z W l q l X l / H R r B S 3 i I A 3 m y R I 8 = " ;
2022-10-06 14:21:37 +02:00
" 0 . 1 7 . 0 " = " 1 s w p f 2 6 5 h 9 q q 3 0 c x 5 5 i y 6 j j i r b a 3 w m l 1 6 w z b 6 8 k 5 2 7 y n r x r 7 h v q x " ;
" 0 . 1 6 . 1 " = " 1 s s 6 g z c r 6 j s 2 d 2 s d d g z 1 p 5 2 g y i w p q m g r x m 8 r 6 w i m 7 g n m 4 w v h a v 8 a " ;
" 0 . 1 5 . 0 " = " 1 4 k 3 a v r j 7 v 7 9 4 k k 4 m k 2 x g g n 4 0 a 4 s 0 z g 8 i q 8 w m y y y r f 7 v a 6 h z 2 9 h f " ;
" 0 . 1 4 . 1 " = " 1 p g f b h x r v r 3 d w 4 6 x 9 p i q j 3 y d x g n 4 l k r f p 9 3 1 q 0 c a j i n r p v 4 a c f a y " ;
" 0 . 1 4 " = " 0 l m l 6 7 i l y l y 0 i 6 3 2 p f f d y 1 g d 0 7 4 0 4 v x 9 0 x n k w 8 q 6 w f 6 x p 5 a f m k k a " ;
" 0 . 1 3 " = " 0 r k z 8 y r 0 1 m m x m 2 l c m b n r 9 i 5 c 7 n 3 7 1 m k s i j 7 v 3 w s 0 a q l r h 3 k g w w 0 2 " ;
" 0 . 1 2 " = " 1 6 7 8 8 a 0 d 8 n 1 b b 7 0 5 f 0 k 3 d v a v 2 f m b b l 6 p c i k w p g a r l 1 l 3 f c f f f 8 k l " ;
" 0 . 1 1 " = " 0 v x 5 6 h 9 w f x j 7 x 3 a q 7 j i g n 4 r n l f m 7 x 9 n h j w m s v 8 p 2 2 a c b z b s 1 0 d g v " ;
" 0 . 1 0 " = " 0 y p d y 9 s q 4 2 1 1 d j q h 4 n i 5 a p 9 l 7 w h q 9 h w 0 v h s x j f l 3 a 0 a 4 c z l l d x q p " ;
} . ${ version } ;
2024-04-14 20:27:42 +02:00
sha256 = getRepoHash prev . watchfiles . version ;
2024-02-05 04:44:31 +01:00
getCargoHash = version : {
" 0 . 2 1 . 0 " = " s h a 2 5 6 - K D m 1 n G e g 4 o D c b o p e d P f z a l K 2 X O 1 c 1 Z Q U Z u 6 x h f R d Q x 4 = " ;
" 0 . 2 0 . 0 " = " s h a 2 5 6 - C h U s 7 Y J E 1 Z E I O N h U U b V A W / y D Y q q U R / k / k 1 0 C e 7 j w 8 X o = " ;
} . ${ version } or (
lib . warn " U n k n o w n w a t c h f i l e s v e r s i o n : ' ${ version } ' . P l e a s e u p d a t e g e t C a r g o H a s h . " null
2024-02-20 05:27:39 +08:00
) ;
2022-10-06 14:21:37 +02:00
in
2024-04-14 20:27:42 +02:00
prev . watchfiles . overridePythonAttrs ( old :
2024-02-20 05:27:39 +08:00
let
src = pkgs . fetchFromGitHub {
owner = " s a m u e l c o l v i n " ;
repo = " w a t c h f i l e s " ;
rev = " v ${ old . version } " ;
inherit sha256 ;
} ;
2024-02-05 04:44:31 +01:00
2024-04-14 20:27:42 +02:00
cargoDeps = let hash = getCargoHash prev . watchfiles . version ; in
2024-02-20 05:27:39 +08:00
if hash = = null then
pkgs . rustPlatform . importCargoLock
{
lockFile = " ${ src . out } / C a r g o . l o c k " ;
} else
pkgs . rustPlatform . fetchCargoTarball {
name = " w a t c h f i l e s - ${ old . version } - c a r g o - d e p s " ;
inherit src hash ;
} ;
2024-02-05 04:44:31 +01:00
2024-02-20 05:27:39 +08:00
in
2024-03-25 15:47:39 -07:00
lib . optionalAttrs ( ! old . src . isWheel or false ) {
2024-02-20 05:27:39 +08:00
inherit src cargoDeps ;
patchPhase = builtins . concatStringsSep " \n " [
( old . patchPhase or " " )
''
substituteInPlace " C a r g o . l o c k " - - replace ' version = " 0 . 0 . 0 " ' ' version = " ${ old . version } " '
substituteInPlace " C a r g o . t o m l " - - replace ' version = " 0 . 0 . 0 " ' ' version = " ${ old . version } " '
''
] ;
buildInputs = ( old . buildInputs or [ ] ) ++ lib . optionals stdenv . isDarwin [
pkgs . darwin . apple_sdk . frameworks . Security
pkgs . darwin . apple_sdk . frameworks . CoreServices
pkgs . libiconv
] ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkgs . rustPlatform . cargoSetupHook
pkgs . rustPlatform . maturinBuildHook
] ;
} ) ;
2022-10-06 14:21:37 +02:00
2024-04-14 20:27:42 +02:00
weasyprint = prev . weasyprint . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
inherit ( pkgs . python3 . pkgs . weasyprint ) patches ;
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ final . pytest-runner ] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
web3 = prev . web3 . overridePythonAttrs {
2022-01-21 12:46:20 +12:00
preConfigure = ''
substituteInPlace setup . py - - replace \ ' setuptools-markdown \ ' " "
'' ;
} ;
2024-04-14 20:27:42 +02:00
weblate-language-data = prev . weblate-language-data . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . translate-toolkit
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
zipp = if prev . zipp = = null then null else
prev . zipp . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . toml
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2024-04-14 20:27:42 +02:00
psutil = prev . psutil . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-02-18 18:14:04 +07:00
# Fix for v5.9.8
# See https://github.com/conda-forge/psutil-feedstock/pull/71/files/8a53fbac242e9cb6c7fe543fdcab554c6c12aecf#r1460167074
NIX_CFLAGS_COMPILE = " - D k I O M a i n P o r t D e f a u l t = 0 " ;
2023-10-25 08:53:12 -04:00
buildInputs = old . buildInputs or [ ]
++ lib . optionals ( stdenv . isDarwin && stdenv . isx86_64 ) [ pkgs . darwin . apple_sdk . frameworks . CoreFoundation ]
++ lib . optionals stdenv . isDarwin [ pkgs . darwin . apple_sdk . frameworks . IOKit ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
sentencepiece = prev . sentencepiece . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
dontUseCmakeConfigure = true ;
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [
pkg-config
pkgs . cmake
pkgs . gperftools
] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [
pkgs . sentencepiece
] ;
}
) ;
2024-04-14 20:27:42 +02:00
sentence-transformers = prev . sentence-transformers . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs =
( old . buildInputs or [ ] )
2024-04-14 20:27:42 +02:00
++ [ final . typing-extensions ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-06-08 20:09:03 +02:00
2024-04-14 20:27:42 +02:00
supervisor = prev . supervisor . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [
2024-04-14 20:27:42 +02:00
final . meld3
final . setuptools
2022-01-21 12:46:20 +12:00
] ;
}
) ;
2021-06-28 21:43:53 -05:00
2024-04-14 20:27:42 +02:00
cytoolz = prev . cytoolz . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . toolz ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2022-01-18 11:19:43 +12:00
2022-01-21 12:46:20 +12:00
# For some reason the toml dependency of tqdm declared here:
# https://github.com/tqdm/tqdm/blob/67130a23646ae672836b971e1086b6ae4c77d930/pyproject.toml#L2
# is not translated correctly to a nix dependency.
2024-04-14 20:27:42 +02:00
tqdm = prev . tqdm . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = [ prev . toml ] ++ ( old . buildInputs or [ ] ) ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-07-01 11:19:49 +02:00
2024-04-14 20:27:42 +02:00
watchdog = prev . watchdog . overrideAttrs (
2022-01-21 12:46:20 +12:00
old : {
buildInputs = ( old . buildInputs or [ ] )
2022-01-21 15:08:33 +12:00
++ lib . optional pkgs . stdenv . isDarwin pkgs . darwin . apple_sdk . frameworks . CoreServices ;
2022-01-21 12:46:20 +12:00
}
) ;
2021-07-01 11:19:49 +02:00
2022-01-21 12:46:20 +12:00
# pyee cannot find `vcversioner` and other "setup requirements", so it tries to
# download them from the internet, which only works when nix sandboxing is disabled.
# Additionally, since pyee uses vcversioner to specify its version, we need to do this
# manually specify its version.
2024-04-14 20:27:42 +02:00
pyee = prev . pyee . overrideAttrs (
2022-01-21 12:46:20 +12:00
old : {
postPatch = old . postPatch or " " + ''
sed - i setup . py \
- e ' /setup_requires / , / ] , /d ' \
- e ' s/vcversioner = { } , /version = " ${ old . version } " , / '
'' ;
}
) ;
2021-07-01 11:19:49 +02:00
2024-04-14 20:27:42 +02:00
minimal-snowplow-tracker = prev . minimal-snowplow-tracker . overridePythonAttrs
2023-03-06 15:48:09 -05:00
(
old : {
2024-04-14 20:27:42 +02:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ prev . setuptools ] ;
2023-03-06 15:48:09 -05:00
}
) ;
2022-01-21 12:46:20 +12:00
# nixpkgs has setuptools_scm 4.1.2
# but newrelic has a seemingly unnecessary version constraint for <4
# So we patch that out
2024-04-14 20:27:42 +02:00
newrelic = prev . newrelic . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
postPatch = old . postPatch or " " + ''
substituteInPlace setup . py - - replace ' " s e t u p t o o l s _ s c m > = 3 . 2 , < 4 " ' ' " s e t u p t o o l s _ s c m " '
'' ;
}
) ;
2021-07-01 11:19:49 +02:00
2024-04-14 20:27:42 +02:00
wxpython = prev . wxpython . overridePythonAttrs ( old :
2022-01-21 12:46:20 +12:00
let
2024-04-14 20:27:42 +02:00
localPython = final . python . withPackages ( ps : with ps ; [
2022-01-21 12:46:20 +12:00
setuptools
numpy
six
] ) ;
in
{
DOXYGEN = " ${ pkgs . doxygen } / b i n / d o x y g e n " ;
nativeBuildInputs = with pkgs ; [
which
doxygen
gtk3
pkg-config
autoPatchelfHook
] ++ ( old . nativeBuildInputs or [ ] ) ;
buildInputs = with pkgs ; [
gtk3
webkitgtk
ncurses
SDL2
xorg . libXinerama
xorg . libSM
xorg . libXxf86vm
xorg . libXtst
xorg . xorgproto
gst_all_1 . gstreamer
gst_all_1 . gst-plugins-base
libGLU
libGL
libglvnd
mesa
2023-07-06 21:51:04 -05:00
] ++ ( old . buildInputs or [ ] ) ;
2022-01-21 12:46:20 +12:00
buildPhase = ''
$ { localPython . interpreter } build . py - v build_wx
$ { localPython . interpreter } build . py - v dox etg - - nodoc sip
$ { localPython . interpreter } build . py - v build_py
'' ;
2022-01-12 17:33:36 +13:00
2022-01-21 12:46:20 +12:00
installPhase = ''
$ { localPython . interpreter } setup . py install - - skip-build - - prefix = $ out
'' ;
} ) ;
2021-12-25 18:36:39 -08:00
2024-04-14 20:27:42 +02:00
marisa-trie = prev . marisa-trie . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . pytest-runner ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
ua-parser = prev . ua-parser . overridePythonAttrs (
2022-01-21 12:46:20 +12:00
old : {
2024-04-14 20:27:42 +02:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ final . pyyaml ] ;
2022-01-21 12:46:20 +12:00
}
) ;
2024-04-14 20:27:42 +02:00
pygraphviz = prev . pygraphviz . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
nativeBuildInputs = ( old . nativeBuildInputs or [ ] ) ++ [ pkg-config ] ;
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . graphviz ] ;
} ) ;
2021-08-16 20:22:10 -04:00
2024-04-14 20:27:42 +02:00
pysqlite = prev . pysqlite . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++ [ pkgs . sqlite ] ;
patchPhase = ''
substituteInPlace " s e t u p . c f g " \
- - replace " / u s r / l o c a l / i n c l u d e " " ${ pkgs . sqlite . dev } / i n c l u d e " \
- - replace " / u s r / l o c a l / l i b " " ${ pkgs . sqlite . out } / l i b "
$ { lib . optionalString ( ! stdenv . isDarwin ) '' e x p o r t L D S H A R E D = " $C C - p t h r e a d - s h a r e d " '' }
'' ;
} ) ;
2022-01-18 11:19:43 +12:00
2024-04-14 20:27:42 +02:00
selinux = prev . selinux . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . setuptools-scm ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2021-08-27 10:45:24 +12:00
2024-04-14 20:27:42 +02:00
setuptools-scm = prev . setuptools-scm . overridePythonAttrs ( _old : {
2023-03-24 12:35:59 +13:00
setupHook = pkgs . writeText " s e t u p t o o l s - s c m - s e t u p - h o o k . s h " ''
poetry2nix-setuptools-scm-hook ( ) {
if [ - z " ' ' ${ dontPretendSetuptoolsSCMVersion- } " ] ; then
export SETUPTOOLS_SCM_PRETEND_VERSION = " $ v e r s i o n "
fi
}
preBuildHooks + = ( poetry2nix-setuptools-scm-hook )
'' ;
} ) ;
2024-04-14 20:27:42 +02:00
uwsgi = prev . uwsgi . overridePythonAttrs
2022-01-25 22:28:49 +00:00
( old :
{
buildInputs = ( old . buildInputs or [ ] ) ++ [ pkgs . ncurses ] ;
} // lib . optionalAttrs ( lib . versionAtLeast old . version " 2 . 0 . 1 9 " && lib . versionOlder old . version " 2 . 0 . 2 0 " ) {
sourceRoot = " . " ;
} ) ;
2021-12-05 17:34:54 +01:00
2024-04-14 20:27:42 +02:00
wcwidth = prev . wcwidth . overridePythonAttrs ( old : {
2022-01-21 12:46:20 +12:00
propagatedBuildInputs = ( old . propagatedBuildInputs or [ ] ) ++
2024-04-14 20:27:42 +02:00
lib . optional final . isPy27 ( final . backports-functools-lru-cache or final . backports_functools_lru_cache )
2022-01-21 12:46:20 +12:00
;
} ) ;
2022-01-12 17:34:00 +13:00
2024-04-14 20:27:42 +02:00
wtforms = prev . wtforms . overridePythonAttrs ( old : {
buildInputs = ( old . buildInputs or [ ] ) ++ [ final . Babel ] ;
2022-01-21 12:46:20 +12:00
} ) ;
2022-01-18 15:45:06 +12:00
2022-12-19 14:49:02 -05:00
nbconvert =
let
2024-04-14 20:27:42 +02:00
patchExporters = lib . optionalString ( lib . versionAtLeast final . nbconvert . version " 6 . 5 . 0 " ) ''
2022-12-17 09:17:50 -05:00
substituteInPlace \
./nbconvert/exporters/templateexporter.py \
- - replace \
' root_dirs . extend ( jupyter_path ( ) ) ' \
' root_dirs . extend ( jupyter_path ( ) + [ os . path . join ( " @ o u t @ " , " s h a r e " , " j u p y t e r " ) ] ) ' \
- - subst-var out
2022-12-19 14:49:02 -05:00
'' ;
in
2024-04-14 20:27:42 +02:00
prev . nbconvert . overridePythonAttrs ( old : {
2023-01-07 06:55:46 -05:00
postPatch = lib . optionalString ( ! ( old . src . isWheel or false ) ) (
2024-04-14 20:27:42 +02:00
patchExporters + lib . optionalString ( lib . versionAtLeast final . nbconvert . version " 7 . 0 " ) ''
2022-12-19 14:49:02 -05:00
substituteInPlace \
./hatch_build.py \
- - replace \
2024-04-14 20:27:42 +02:00
' if final . target_name not in [ " w h e e l " , " s d i s t " ] : ' \
2022-12-19 14:49:02 -05:00
' if True:'
''
) ;
2023-01-07 06:55:46 -05:00
postInstall = lib . optionalString ( old . src . isWheel or false ) ''
2024-04-14 20:27:42 +02:00
pushd $ out / $ { final . python . sitePackages }
2022-12-19 14:49:02 -05:00
$ { patchExporters }
popd
'' ;
} ) ;
2022-12-09 15:58:01 -05:00
2024-04-14 20:27:42 +02:00
meson-python = prev . meson-python . overridePythonAttrs ( _old : {
2023-03-15 17:32:28 +13:00
dontUseMesonConfigure = true ;
} ) ;
2024-04-14 20:27:42 +02:00
mkdocs = prev . mkdocs . overridePythonAttrs ( old : {
propagatedBuildInputs = old . propagatedBuildInputs or [ ] ++ [ final . babel ] ;
2022-12-09 15:58:01 -05:00
} ) ;
2022-12-20 09:31:32 -05:00
2024-04-14 20:27:42 +02:00
mkdocs-material = prev . mkdocs-material . overridePythonAttrs ( old : {
2023-11-26 19:14:04 +00:00
postPatch = old . postPatch or " " + ''
sed - i ' s / " F r a m e w o r k : : M k D o c s " , // ' pyproject . toml
'' ;
} ) ;
2022-12-20 09:31:32 -05:00
# patch mkdocstrings to fix jinja2 imports
mkdocstrings =
let
2024-04-14 20:27:42 +02:00
patchJinja2Imports = final . pkgs . fetchpatch {
2022-12-20 09:31:32 -05:00
name = " f i x - j i n j a 2 - i m p o r t s . p a t c h " ;
url = " h t t p s : / / g i t h u b . c o m / m k d o c s t r i n g s / m k d o c s t r i n g s / c o m m i t / b 3 7 7 2 2 7 1 6 b 1 e 0 e d 6 3 9 3 e c 7 1 3 0 8 d f b 0 f 8 5 e 1 4 2 f 3 b . p a t c h " ;
hash = " s h a 2 5 6 - D D 1 S j E v s 5 H B l S R L r q P 3 j h F / y o e W k F 7 F 3 V X C D 1 g y t 5 F c = " ;
} ;
in
2024-04-14 20:27:42 +02:00
prev . mkdocstrings . overridePythonAttrs (
2022-12-20 09:31:32 -05:00
old : lib . optionalAttrs
( lib . versionAtLeast old . version " 0 . 1 7 " && lib . versionOlder old . version " 0 . 1 8 " )
{
2023-01-07 06:55:46 -05:00
patches = old . patches or [ ] ++ lib . optionals ( ! ( old . src . isWheel or false ) ) [ patchJinja2Imports ] ;
2022-12-20 09:31:32 -05:00
# strip the first two levels ("a/src/") when patching since we're in site-packages
# just above mkdocstrings
2023-01-07 06:55:46 -05:00
postInstall = lib . optionalString ( old . src . isWheel or false ) ''
2024-04-14 20:27:42 +02:00
pushd " $ o u t / ${ final . python . sitePackages } "
2022-12-20 09:31:32 -05:00
patch - p2 < " ${ patchJinja2Imports } "
popd
'' ;
}
) ;
2023-02-03 14:49:13 +13:00
2024-04-14 20:27:42 +02:00
flake8-mutable = prev . flake8-mutable . overridePythonAttrs
( old : { buildInputs = old . buildInputs or [ ] ++ [ final . pytest-runner ] ; } ) ;
pydantic = prev . pydantic . overridePythonAttrs
2023-05-01 16:57:26 +02:00
( old : { buildInputs = old . buildInputs or [ ] ++ [ pkgs . libxcrypt ] ; } ) ;
2024-03-25 15:47:39 -07:00
vllm = prev . vllm . overridePythonAttrs ( old : {
autoPatchelfIgnoreMissingDeps = true ;
2024-05-06 01:37:47 +00:00
# Filter out vllm-nccl-cu12 because vllm-nccl-cu12 will try to download NCCL 2.18.1 from the internet to the ~/.config/vllm/nccl/cu12 directory, which is not allowed in Nix.
# Set VLLM_NCCL_SO_PATH at runtime to specify the nccl so instead.
# See https://github.com/vllm-project/vllm/issues/4224
propagatedBuildInputs = builtins . filter ( i : i . pname != " v l l m - n c c l - c u 1 2 " ) old . propagatedBuildInputs ;
2024-03-25 15:47:39 -07:00
} // lib . optionalAttrs ( ! ( old . src . isWheel or false ) ) rec {
CUDA_HOME = pkgs . symlinkJoin {
name = " v l l m - c u d a - h o m e " ;
paths = [
pkgs . cudaPackages . libcusparse
pkgs . cudaPackages . libnvjitlink
pkgs . cudaPackages . libcublas
pkgs . cudaPackages . libcusolver
pkgs . cudaPackages . cuda_nvcc
pkgs . cudaPackages . cuda_cccl
pkgs . cudaPackages . cuda_cudart
] ;
} ;
nativeBuildInputs = old . nativeBuildInputs ++ [
pkgs . which
] ;
LD_LIBRARY_PATH = " ${ CUDA_HOME } / l i b " ;
} ) ;
xformers = prev . xformers . overridePythonAttrs ( _attrs : {
autoPatchelfIgnoreMissingDeps = true ;
} ) ;
2024-04-14 20:27:42 +02:00
y-py = prev . y-py . override {
2023-02-03 14:49:13 +13:00
preferWheel = true ;
} ;
2022-01-21 12:46:20 +12:00
}
)
2024-03-05 14:15:46 +01:00
# The following are dependencies of torch >= 2.0.0.
# torch doesn't officially support system CUDA, unless you build it yourself.
2024-05-05 09:02:31 -04:00
( self : super : lib . genAttrs
2024-05-05 09:03:43 -04:00
( lib . concatMap
( pkg : [ " n v i d i a - ${ pkg } - c u 1 1 " " n v i d i a - ${ pkg } - c u 1 2 " ] )
[
" c u b l a s "
" c u d a - c u p t i "
" c u d a - c u r a n d "
" c u d a - n v r t c "
" c u d a - r u n t i m e "
" c u d n n "
" c u f f t "
" c u r a n d "
" c u s o l v e r "
" c u s p a r s e "
" n c c l "
" n v j i t l i n k "
" n v t x "
] )
2024-05-05 08:59:11 -04:00
( name : super . ${ name } . overridePythonAttrs ( _ : {
2024-03-05 14:15:46 +01:00
# 1. Remove __init__.py because all the cuda packages include it
# 2. Symlink the cuda libraries to the lib directory so autopatchelf can find them
postFixup = ''
rm - rf $ out / $ { self . python . sitePackages } /nvidia / { __pycache__ , __init__ . py }
ln - sfn $ out / $ { self . python . sitePackages } /nvidia /* / l i b / l i b * . s o * $ o u t / l i b
'' ;
} ) ) )
2022-01-21 12:46:20 +12:00
]