Skip to content

Commit 0e2a766

Browse files
committed
Add Blink package
Closes #605
1 parent 6d537c6 commit 0e2a766

File tree

3 files changed

+251
-0
lines changed

3 files changed

+251
-0
lines changed

pkgs/by-name/blink/package.nix

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
{ lib
2+
, stdenv
3+
, fetchFromGitHub
4+
, replaceVars
5+
6+
, ccrtp
7+
, cmake
8+
, python3Packages
9+
, x11vnc
10+
, libvncserver
11+
, pjsip
12+
, pkg-config
13+
}:
14+
15+
let
16+
# AG Projects dependencies required for Blink
17+
python3-application = python3Packages.buildPythonApplication rec {
18+
pname = "python3-application";
19+
version = "3.0.7";
20+
pyproject = true;
21+
22+
src = fetchFromGitHub {
23+
owner = "AGProjects";
24+
repo = "python3-application";
25+
rev = "refs/tags/release-${version}";
26+
hash = "sha256-gGq1V+4GrjUgp6XteWAko4YRZuCWGArvImp8isUOoMU=";
27+
};
28+
29+
build-system = with python3Packages; [
30+
setuptools
31+
];
32+
33+
dependencies = with python3Packages; [
34+
zope-interface
35+
];
36+
37+
pythonImportsCheck = [ "application" ];
38+
};
39+
40+
python3-sipsimple = python3Packages.buildPythonApplication rec {
41+
pname = "python3-sipsimple";
42+
version = "5.3.3";
43+
pyproject = true;
44+
45+
src = fetchFromGitHub {
46+
owner = "AGProjects";
47+
repo = "python3-sipsimple";
48+
rev = "refs/tags/${version}";
49+
hash = "sha256-SiJo6YoYy4OiVVVKhfy0U1z4iz5aYPHu2P6JuJjXyEI=";
50+
};
51+
52+
patches = [
53+
(replaceVars ./sipsimple-setup-ext.patch {
54+
pjsipIncludeDir = "${pjsip}/include/";
55+
zrtpcppIncludeDir = "${zrtpcpp}/include/";
56+
pjsipLibDir = "${pjsip}/include/";
57+
zrtpcppLibDir = "${zrtpcpp}/include/";
58+
})
59+
];
60+
61+
# # Don't build pjsip, use package from nixpkgs
62+
# postPatch = ''
63+
# substituteInPlace "setup.py" \
64+
# --replace-fail \
65+
# "'build_ext': PJSIP_build_ext" \
66+
# ""
67+
# '';
68+
69+
70+
# Debian Build-Depends
71+
# dh-python,
72+
# python3-all-dev,
73+
# cython3,
74+
# libasound2-dev,
75+
# python3-dateutil,
76+
# python3-dnspython,
77+
# libssl-dev,
78+
# libv4l-dev,
79+
# libavcodec-dev,
80+
# libavformat-dev,
81+
# libopencore-amrnb-dev,
82+
# libopencore-amrwb-dev,
83+
# libavutil-dev,
84+
# libswscale-dev,
85+
# libx264-dev,
86+
# libvpx-dev,
87+
# libopus-dev,
88+
# libsqlite3-dev,
89+
# pkg-config,
90+
# uuid-dev
91+
build-system = with python3Packages; [
92+
cython
93+
setuptools
94+
];
95+
96+
dependencies = with python3Packages; [
97+
];
98+
99+
buildInputs = [
100+
pjsip
101+
zrtpcpp
102+
];
103+
};
104+
105+
python3-otr = python3Packages.buildPythonApplication rec {
106+
pname = "python3-otr";
107+
version = "2.0.2";
108+
pyproject = true;
109+
110+
src = fetchFromGitHub {
111+
owner = "AGProjects";
112+
repo = "python3-otr";
113+
rev = "refs/tags/${version}";
114+
hash = "sha256-Zt5nCkt9qdw5MJWrLJoMpi3ZhlCBDPAiAvoT1rBnWo0=";
115+
};
116+
117+
build-system = with python3Packages; [
118+
setuptools
119+
];
120+
121+
dependencies = with python3Packages; [
122+
cryptography
123+
gmpy2
124+
python3-application
125+
zope-interface
126+
];
127+
128+
# FIXME:
129+
# nativeCheckInputs = with python3Packages; [
130+
# unittestCheckHook
131+
# ];
132+
133+
pythonImportsCheck = [ "otr" ];
134+
};
135+
136+
# Other third-party dependencies
137+
zrtpcpp = stdenv.mkDerivation rec {
138+
pname = "zrtpcpp";
139+
version = "4.7.0";
140+
141+
src = fetchFromGitHub {
142+
owner = "wernerd";
143+
repo = "ZRTPCPP";
144+
tag = version;
145+
hash = "sha256-HgtJzVwriTJogN99ox3xd+Hhza+/KieOWXNf3eZwc4U=";
146+
};
147+
148+
patches = [
149+
./zrtpcpp-include-stdbool.patch
150+
];
151+
152+
nativeBuildInputs = [
153+
pkg-config
154+
cmake
155+
];
156+
157+
buildInputs = [
158+
ccrtp
159+
];
160+
161+
cmakeFlags = [ ];
162+
163+
doCheck = true;
164+
};
165+
166+
in
167+
python3Packages.buildPythonApplication rec {
168+
pname = "blink-qt";
169+
version = "6.0.4";
170+
pyproject = true;
171+
172+
src = fetchFromGitHub {
173+
owner = "AGProjects";
174+
repo = "blink-qt";
175+
rev = "refs/tags/${version}";
176+
hash = "sha256-QESg9yo5oddYqSKuFLSMI2Oju3FCq97+j0uJDK85Yy8=";
177+
};
178+
179+
# TODO: try to set language_level instead of using cython_0
180+
# postPatch = ''
181+
# substituteInPlace "setup.py" \
182+
# --replace-fail \
183+
# 'libraries=["vncclient"])]),' \
184+
# 'libraries=["vncclient"])], language_level = "2"),'
185+
# '';
186+
187+
build-system = with python3Packages; [
188+
cython_0
189+
setuptools
190+
];
191+
192+
dependencies = with python3Packages; [
193+
pyqt6
194+
pyqt6.dev
195+
pyqt6-sip
196+
python3-application
197+
python3-eventlib
198+
python3-otr
199+
python3-sipsimple
200+
];
201+
202+
buildInputs = [
203+
# x11vnc
204+
libvncserver.dev
205+
];
206+
207+
208+
passthru = {
209+
# FIXME: remove
210+
inherit python3-sipsimple zrtpcpp;
211+
};
212+
213+
meta = with lib; {
214+
homepage = "";
215+
description = "";
216+
license = licenses.bsd2;
217+
maintainers = with maintainers; [ ];
218+
mainProgram = "";
219+
};
220+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/setup.py b/setup.py
2+
index 755fe188..f77a81ef 100755
3+
--- a/setup.py
4+
+++ b/setup.py
5+
@@ -54,12 +54,12 @@ setup(
6+
},
7+
8+
ext_modules=[
9+
- Extension(name="sipsimple.core._core", sources=["sipsimple/core/_core.pyx", "sipsimple/core/_core.pxd"] + glob.glob(os.path.join("sipsimple", "core", "_core.*.pxi"))),
10+
+ Extension(name="sipsimple.core._core", sources=["sipsimple/core/_core.pyx", "sipsimple/core/_core.pxd"] + glob.glob(os.path.join("sipsimple", "core", "_core.*.pxi")), include_dirs=["@pjsipIncludeDir@", "@zrtpcppIncludeDir@"], library_dirs=["@pjsipLibDir@", "@zrtpcppLibDir@"]),
11+
Extension(name="sipsimple.util._sha1", sources=["sipsimple/util/_sha1.pyx"], depends=["sipsimple/util/_sha1.h"])
12+
],
13+
14+
cmdclass={
15+
- 'build_ext': PJSIP_build_ext
16+
+ # 'build_ext': PJSIP_build_ext
17+
},
18+
19+
provides=['sipsimple']
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/cryptcommon/ZrtpRandom.h b/cryptcommon/ZrtpRandom.h
2+
index ee8640a..48170cb 100644
3+
--- a/cryptcommon/ZrtpRandom.h
4+
+++ b/cryptcommon/ZrtpRandom.h
5+
@@ -27,6 +27,7 @@
6+
#include <string.h>
7+
#if !(defined(_WIN32) || defined(_WIN64))
8+
#include <unistd.h>
9+
+#include <stdbool.h>
10+
#endif
11+
#include <stdint.h>
12+
#include <sys/types.h>

0 commit comments

Comments
 (0)