generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tg-archive.nix
191 lines (184 loc) · 4.66 KB
/
tg-archive.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
{ lib
, fetchFromGitHub
, fetchPypi
, buildPythonPackage
, buildPythonApplication
, fetchpatch
, gtk3
, wrapGAppsHook
, gdk-pixbuf
, gobject-introspection
, gettext
, gst_all_1
, gspell
, isocodes
, intltool
, rustPlatform
, file # libmagic
#, python-telegram-bot # gi
, telethon
, jinja2
, pyyaml # PyYAML
, cryptg
, pillow # Pillow
, feedgen
, python-magic
#, pkg_resources
, setuptools # pkg_resources
, setuptools-rust
}:
let
cryptg = buildPythonPackage rec {
pname = "cryptg";
#version = "0.3.1"; # ERROR: The Cargo.lock file doesn't exist
version = "0.3.1.unstable-2022-05-10";
src = fetchFromGitHub {
owner = "cher-nov";
repo = "cryptg";
rev = "e5a86364e9fd77cadbea94d48e28fded0f2a6e1a";
sha256 = "sha256-0v+GmwjWierq7a4c548hFLuq1dSDo8PvDlii5HK7MWk=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
#inherit src sourceRoot;
name = "${pname}-${version}";
sha256 = "sha256-StTCVh0NBEE6J7fV+sCq2eOmhuRDgyS711qZDwduWm0=";
};
#sourceRoot = "source/bindings/python";
nativeBuildInputs = /*[ setuptools-rust ] ++*/ (with rustPlatform; [
cargoSetupHook
rust.cargo
rust.rustc
]);
buildInputs = [
#importlib-resources
setuptools-rust
];
propagatedBuildInputs = [
#jsonschema
#h_matchers
];
checkInputs = [
];
meta = with lib; {
homepage = "https://github.com/cher-nov/cryptg";
description = "Cryptographic utilities for Telegram";
license = licenses.cc0;
};
};
python-magic = buildPythonPackage rec {
pname = "python-magic";
version = "0.4.26";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-gmLBMAH5BK1bck04teW18X7ARQriSd7zmKYuTjMQilA=";
};
buildInputs = [
#importlib-resources
];
# https://github.com/ahupp/python-magic/blob/master/magic/loader.py#L34
postPatch = ''
sed -i "s|yield 'libmagic.so.1'|yield '${file}/lib/libmagic.so.1'|" magic/loader.py
'';
propagatedBuildInputs = [
#jsonschema
#h_matchers
file # libmagic
];
checkInputs = [
file # libmagic
];
meta = with lib; {
homepage = "http://github.com/ahupp/python-magic";
description = "File type identification using libmagic";
license = licenses.mit;
};
};
in
buildPythonApplication rec {
pname = "tg-archive";
version = "unstable-2022-02-17";
src = fetchFromGitHub {
owner = "knadh";
repo = "tg-archive";
rev = "0eec29ad5977d4aad6def27f285104994ee71f5b";
sha256 = "sha256-2ATO3ZkaY5w4JmoUUgf4Bn/UD7u0zu3W5GUqvCdGIB8=";
};
# relax dependencies
postPatch = ''
sed -i 's/==/>=/' requirements.txt
'';
patches = [
(fetchpatch {
url = "https://github.com/knadh/tg-archive/pull/61.diff";
sha256 = "sha256-XQFW715HbrxFUUYfKhwk7/IQ7Cnbjtqk32Pq7q/tn3M=";
})
(fetchpatch {
url = "https://github.com/knadh/tg-archive/pull/63.diff";
sha256 = "sha256-49ZCrYH5r3ekcv51pJPoHHVfhu1GzEMhfXjvlPBiQn8=";
})
(fetchpatch {
url = "https://github.com/knadh/tg-archive/pull/65.diff";
sha256 = "sha256-y7mGlpLbv1q9h6yFkLLRM9Lya9wuyGLdaAMTXlPmUGM=";
})
(fetchpatch {
url = "https://github.com/knadh/tg-archive/pull/66.diff";
sha256 = "sha256-bQS2nY++VqEabmCy1Bj70VEx4DHMLO/69Q6TvMH6HNw=";
})
];
propagatedBuildInputs = [
#python-telegram-bot # gi
telethon
jinja2
pyyaml # PyYAML
cryptg
pillow # Pillow
feedgen
python-magic
#pkg_resources
setuptools # pkg_resources
];
buildInputs = [
/*
gtk3 # Pango
gobject-introspection # Pango
# optional
gspell
isocodes
chardet
#distutils_extra
# optional: internal video player
gst_all_1.gstreamer
#gst_all_1.gstreamer.dev # gst-inspect
gst_all_1.gst-plugins-base # playbin
(gst_all_1.gst-plugins-good.override { gtkSupport = true; }) # gtksink
gst_all_1.gst-plugins-bad
gst_all_1.gst-plugins-ugly
gst_all_1.gst-libav
*/
];
nativeBuildInputs = [
/*
gettext # msgfmt
wrapGAppsHook
gobject-introspection
#intltool
*/
];
/*
postInstall = ''
cat >>$out/lib/python3.9/site-packages/aeidon/paths.py <<EOF
DATA_DIR = '$out/share/gaupol'
LOCALE_DIR = '$out/share/locale'
EOF
'';
*/
#doCheck = false; # tests are failing: Unable to init server: Could not connect: Connection refused
meta = with lib; {
homepage = "https://github.com/knadh/tg-archive";
description = "export Telegram group chats into static websites to preserve chat history like mailing list archives";
#maintainers = [];
license = licenses.mit;
#platforms = platforms.linux;
};
}