-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfixes.nix
215 lines (189 loc) · 6.25 KB
/
fixes.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
final: prev:
let
inherit (final) pythonOlder fetchPypi buildPythonPackage;
inherit (final.stdenv) isDarwin;
inherit (final.pkgs) fetchFromGitHub lib;
in
rec {
sqlalchemy_1 =
let
version = "1.4.48";
in
prev.sqlalchemy.overridePythonAttrs (_: {
inherit version;
src = prev.fetchPypi {
inherit version;
pname = "SQLAlchemy";
hash = "sha256-tHvChwltmJoIOM6W99jpZpFKJNqHftQadTHUS1XNuN8=";
};
passthru.replaceSqlalchemy = old: {
propagatedBuildInputs = prev.lib.remove prev.sqlalchemy old.propagatedBuildInputs or [ ] ++ [ sqlalchemy_1 ];
};
disabledTestPaths = [ ];
disabledTests = prev.lib.optionals prev.stdenv.isDarwin [
"MemUsageWBackendTest"
"MemUsageTest"
];
});
python-binance = prev.python-binance.overridePythonAttrs (old: {
postPatch = ''
sed -i -E 's#raise.*#version = "${old.version}"#g' ./setup.py
'';
propagatedBuildInputs = old.propagatedBuildInputs ++ [ prev.pycryptodome ];
});
prometheus-fastapi-instrumentator =
if isDarwin then
prev.prometheus-fastapi-instrumentator.overridePythonAttrs
(_: {
doCheck = false;
meta.platforms = prev.lib.platforms.all;
}) else prev.prometheus-fastapi-instrumentator;
emoji_1 = prev.buildPythonPackage rec {
pname = "emoji";
version = "1.7.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = prev.pkgs.fetchFromGitHub {
owner = "carpedm20";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-vKQ51RP7uy57vP3dOnHZRSp/Wz+YDzeLUR8JnIELE/I=";
};
nativeCheckInputs = [
prev.pytestCheckHook
];
disabledTests = [
"test_emojize_name_only"
];
pythonImportsCheck = [
"emoji"
];
meta = with prev.pkgs.lib; {
description = "Emoji for Python";
homepage = "https://github.com/carpedm20/emoji/";
changelog = "https://github.com/carpedm20/emoji/blob/v${version}/CHANGES.md";
license = licenses.bsd3;
maintainers = with maintainers; [ joachifm ];
};
};
pypdfium2 = prev.pypdfium2.overridePythonAttrs (_:
let
headers = final.pkgs.fetchgit {
url = "https://pdfium.googlesource.com/pdfium";
# The latest revision on the chromium/${pdfiumVersion} branch
rev = "f6da7d235728aeaff6586d2190badfb4290a9979";
hash = "sha256-Es/IDQPLQGOFhoAY93zduc+eKGpA7qMnLw7TjZpWHvc=";
};
inherit (final.pkgs) pdfium-binaries;
pdfiumVersion = "${pdfium-binaries.version}";
in
{
preBuild =
let
pdfiumLib = final.pkgs.lib.makeLibraryPath [ pdfium-binaries ];
inputVersionFile = (final.pkgs.formats.json { }).generate "version.json" {
version = final.pkgs.lib.strings.toInt pdfiumVersion;
source = "generated";
flags = [ ];
run_lds = [ pdfiumLib ];
guard_symbols = false;
};
bindingsDir = "data/bindings";
headersDir = "${bindingsDir}/headers";
versionFile = "${bindingsDir}/version.json";
in
''
# Preseed the headers and version file
mkdir -p ${bindingsDir}
cp -r ${headers}/public ${headersDir}
install -m 644 ${inputVersionFile} ${versionFile}
# Make generated bindings consider pdfium derivation path when loading dynamic libraries
substituteInPlace setupsrc/pypdfium2_setup/emplace.py \
--replace-fail 'build_pdfium_bindings(pdfium_ver, flags=flags, guard_symbols=True, run_lds=[])' \
'build_pdfium_bindings(pdfium_ver, flags=flags, guard_symbols=True, run_lds=["${pdfiumLib}"])'
# Short circuit the version pull from the internet
substituteInPlace setupsrc/pypdfium2_setup/packaging_base.py \
--replace-fail 'PdfiumVer.to_full(build)._asdict()' \
'{"major": 133, "minor": 0, "build": ${pdfiumVersion}, "patch": 1}'
'';
});
certbot-dns-cloudflare-latest = buildPythonPackage
rec {
pname = "certbot-dns-cloudflare";
version = "3.1.0";
pyproject = true;
src = fetchPypi {
pname = "certbot_dns_cloudflare";
inherit version;
hash = "sha256-oktsloLV/CwzYLJ+y19NKfMYjOgAm3miTBnkfK6jzgM=";
};
build-system = with final; [
setuptools
wheel
];
dependencies = with final; [
acme
certbot
(buildPythonPackage rec {
pname = "cloudflare";
version = "2.19.4";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-O2AAoBojfCO8z99tICVupREex0qCaunnT58OW7WyOD8=";
};
build-system = [
setuptools
wheel
];
dependencies = [
anyio
distro
httpx
jsonlines
pydantic
pyyaml
requests
sniffio
typing-extensions
];
pythonImportsCheck = [
"CloudFlare"
];
meta = {
description = "The official Python library for the cloudflare API";
homepage = "https://pypi.org/project/cloudflare/2.19.4/";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ jpetrucciani ];
};
})
];
optional-dependencies = with final; {
docs = [
sphinx
sphinx-rtd-theme
];
test = [
pytest
];
};
pythonImportsCheck = [
"certbot_dns_cloudflare"
];
meta = {
description = "Cloudflare DNS Authenticator plugin for Certbot";
homepage = "https://pypi.org/project/certbot-dns-cloudflare/#history";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ jpetrucciani ];
};
};
anybadge = let version = "1.16.0"; in prev.anybadge.overridePythonAttrs (_: {
postPatch = ''
substituteInPlace ./setup.py \
--replace 'version=get_version()' 'version="${version}"'
substituteInPlace ./anybadge/__init__.py \
--replace '"0.0.0"' '"${version}"'
'';
nativeCheckInputs = with final; [ sh ];
});
}