tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
linphone: 3.12.0 -> unstable-2020-03-06
Jaakko Luttinen
5 years ago
8b2abbbc
1e515920
+228
-37
3 changed files
expand all
collapse all
unified
split
pkgs
applications
networking
instant-messengers
linphone
default.nix
fix_minizip_linking.patch
top-level
all-packages.nix
+214
-36
pkgs/applications/networking/instant-messengers/linphone/default.nix
···
1
1
-
{ stdenv, intltool, pkgconfig, readline, openldap, cyrus_sasl, libupnp
2
2
-
, zlib, libxml2, gtk2, libnotify, speex, ffmpeg, libX11, libsoup, udev
3
3
-
, ortp, mediastreamer, sqlite, belle-sip, libosip, libexosip, bzrtp
4
4
-
, mediastreamer-openh264, bctoolbox, makeWrapper, fetchFromGitHub, cmake
5
5
-
, libmatroska, bcunit, doxygen, gdk-pixbuf, glib, cairo, pango, mbedtls
6
6
-
, python, graphviz, belcard, bcg729
7
7
-
, withGui ? true
1
1
+
{ bcg729
2
2
+
, bctoolbox
3
3
+
, bcunit
4
4
+
, belcard
5
5
+
, belle-sip
6
6
+
, belr
7
7
+
, bzrtp
8
8
+
, cairo
9
9
+
, cmake
10
10
+
, cyrus_sasl
11
11
+
, fetchFromGitLab
12
12
+
, fetchurl
13
13
+
, ffmpeg
14
14
+
, gdk-pixbuf
15
15
+
, glib
16
16
+
, gnused
17
17
+
, graphviz
18
18
+
, gtk2
19
19
+
, intltool
20
20
+
, lib
21
21
+
, libexosip
22
22
+
, liblinphone
23
23
+
, libmatroska
24
24
+
, libnotify
25
25
+
, libosip
26
26
+
, libsoup
27
27
+
, libupnp
28
28
+
, libX11
29
29
+
, libxml2
30
30
+
, makeWrapper
31
31
+
, mbedtls
32
32
+
, mediastreamer
33
33
+
, mediastreamer-openh264
34
34
+
, mkDerivation
35
35
+
, openldap
36
36
+
, ortp
37
37
+
, pango
38
38
+
, pkgconfig
39
39
+
, python
40
40
+
, qtbase
41
41
+
, qtgraphicaleffects
42
42
+
, qtquickcontrols2
43
43
+
, qttranslations
44
44
+
, readline
45
45
+
, speex
46
46
+
, sqlite
47
47
+
, stdenv
48
48
+
, udev
49
49
+
, zlib
50
50
+
# For Minizip 2.2.7:
51
51
+
, fetchFromGitHub
52
52
+
, libbsd
8
53
}:
54
54
+
let
55
55
+
# Linphone Desktop requires Minizip 2.2.7. Nixpkgs contains a very old version
56
56
+
# from the time when it was part of zlib. The most recent release of Minizip
57
57
+
# is currently 2.9.2 but Linphone Desktop didn't work with that. So, even if
58
58
+
# we added most recent Minizip version to nixpkgs, probably Minizip 2.2.7 is
59
59
+
# only needed here and we shouldn't add this semi-old version to
60
60
+
# all-packages.nix. Therefore, just define it here locally.
61
61
+
minizip2 = stdenv.mkDerivation rec {
62
62
+
pname = "minizip";
63
63
+
version = "2.2.7";
9
64
10
10
-
stdenv.mkDerivation rec {
11
11
-
pname = "linphone";
12
12
-
version = "3.12.0";
65
65
+
disabled = stdenv.isAarch32;
66
66
+
67
67
+
src = fetchFromGitHub {
68
68
+
owner = "nmoinvaz";
69
69
+
repo = pname;
70
70
+
rev = version;
71
71
+
sha256 = "1a88v1gjlflsd17mlrgxh420rpa38q0d17yh9q8j1zzqfrd1azch";
72
72
+
};
73
73
+
74
74
+
nativeBuildInputs = [ cmake pkgconfig ];
75
75
+
76
76
+
cmakeFlags = [
77
77
+
"-DBUILD_SHARED_LIBS=YES"
78
78
+
];
79
79
+
80
80
+
buildInputs = [
81
81
+
zlib
82
82
+
libbsd # required in 2.2.7 but not in 2.9.2?
83
83
+
];
13
84
14
14
-
src = fetchFromGitHub {
15
15
-
owner = "BelledonneCommunications";
85
85
+
meta = with stdenv.lib; {
86
86
+
description = "Compression library implementing the deflate compression method found in gzip and PKZIP";
87
87
+
homepage = "https://github.com/nmoinvaz/minizip";
88
88
+
license = licenses.zlib;
89
89
+
platforms = platforms.unix;
90
90
+
};
91
91
+
};
92
92
+
in
93
93
+
mkDerivation rec {
94
94
+
pname = "linphone-desktop";
95
95
+
# Latest release is 4.1.1 old and doesn't build with the latest releases of
96
96
+
# some of the dependencies so let's use the latest commit.
97
97
+
version = "unstable-2020-03-06";
98
98
+
99
99
+
src = fetchFromGitLab {
100
100
+
domain = "gitlab.linphone.org";
101
101
+
owner = "public";
102
102
+
group = "BC";
16
103
repo = pname;
17
17
-
rev = version;
18
18
-
sha256 = "0az2ywrpx11sqfb4s4r2v726avcjf4k15bvrqj7xvhz7hdndmh0j";
104
104
+
rev = "971997e162558d37051f89c9c34bbc240135f704";
105
105
+
sha256 = "02ji4r8bpcm2kyisn9d3054m026l33g2574i1ag1cmb2dz2p8i1c";
19
106
};
20
107
21
21
-
cmakeFlags = stdenv.lib.optional withGui [ "-DENABLE_GTK_UI=ON" ];
108
108
+
# Without this patch, the build fails with:
109
109
+
#
110
110
+
# No rule to make target
111
111
+
# 'minizip_OUTPUT/nix/store/...linphone-desktop.../lib/libminizip.so',
112
112
+
#
113
113
+
# So, the makefile tries to use a full absolute path to the library but does
114
114
+
# it incorrectly. As we have installed Minizip properly, it's sufficient to
115
115
+
# just use "minizip" and the library is found automatically. If this patched
116
116
+
# target_link_libraries line was removed entirely, the build would fail at the
117
117
+
# very end when linking minizip.
118
118
+
patches = [
119
119
+
./fix_minizip_linking.patch
120
120
+
];
22
121
122
122
+
# See: https://gitlab.linphone.org/BC/public/linphone-desktop/issues/21
23
123
postPatch = ''
24
24
-
touch coreapi/liblinphone_gitversion.h
124
124
+
substituteInPlace src/app/AppController.cpp \
125
125
+
--replace "LINPHONE_QT_GIT_VERSION" "\"${version}\""
25
126
'';
26
127
128
128
+
# TODO: After linphone-desktop and liblinphone split into separate packages,
129
129
+
# there might be some build inputs here that aren't needed for
130
130
+
# linphone-desktop.
27
131
buildInputs = [
28
28
-
readline openldap cyrus_sasl libupnp zlib libxml2 gtk2 libnotify speex ffmpeg libX11
29
29
-
mbedtls libsoup udev ortp mediastreamer sqlite belle-sip libosip libexosip
30
30
-
bctoolbox libmatroska gdk-pixbuf glib cairo pango bzrtp belcard bcg729
132
132
+
bcg729
133
133
+
bctoolbox
134
134
+
belcard
135
135
+
belle-sip
136
136
+
belr
137
137
+
bzrtp
138
138
+
cairo
139
139
+
cyrus_sasl
140
140
+
ffmpeg
141
141
+
gdk-pixbuf
142
142
+
glib
143
143
+
gtk2
144
144
+
libX11
145
145
+
libexosip
146
146
+
liblinphone
147
147
+
libmatroska
148
148
+
libnotify
149
149
+
libosip
150
150
+
libsoup
151
151
+
libupnp
152
152
+
libxml2
153
153
+
mbedtls
154
154
+
mediastreamer
155
155
+
mediastreamer-openh264
156
156
+
minizip2
157
157
+
openldap
158
158
+
ortp
159
159
+
pango
160
160
+
qtbase
161
161
+
qtgraphicaleffects
162
162
+
qtquickcontrols2
163
163
+
qttranslations
164
164
+
readline
165
165
+
speex
166
166
+
sqlite
167
167
+
udev
168
168
+
zlib
31
169
];
32
170
33
171
nativeBuildInputs = [
34
34
-
intltool pkgconfig makeWrapper cmake bcunit doxygen graphviz
35
35
-
(python.withPackages (ps: [ ps.pystache ps.six ]))
172
172
+
bcunit
173
173
+
cmake
174
174
+
gnused
175
175
+
graphviz
176
176
+
intltool
177
177
+
makeWrapper
178
178
+
pkgconfig
36
179
];
37
180
38
38
-
NIX_CFLAGS_COMPILE = [
39
39
-
"-Wno-error"
40
40
-
"-I${glib.dev}/include/glib-2.0"
41
41
-
"-I${glib.out}/lib/glib-2.0/include"
42
42
-
"-I${gtk2.dev}/include/gtk-2.0/"
43
43
-
"-I${cairo.dev}/include/cairo"
44
44
-
"-I${pango.dev}/include/pango-1.0"
45
45
-
"-I${gtk2}/lib/gtk-2.0/include"
46
46
-
"-DLIBLINPHONE_GIT_VERSION=\"v${version}\""
181
181
+
cmakeFlags = [
182
182
+
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
183
183
+
"-DMINIZIP_INCLUDE_DIRS=${minizip2}/include"
184
184
+
"-DMINIZIP_LIBRARIES=minizip"
47
185
];
48
186
49
49
-
postInstall = ''
50
50
-
for i in $(cd $out/bin && ls); do
51
51
-
wrapProgram $out/bin/$i --set MEDIASTREAMER_PLUGINS_DIR ${mediastreamer-openh264}/lib/mediastreamer/plugins
52
52
-
done
187
187
+
# The default install phase fails because the paths are somehow messed up in
188
188
+
# the makefiles. The errors were like:
189
189
+
#
190
190
+
# CMake Error at cmake_builder/linphone_package/cmake_install.cmake:49 (file):
191
191
+
# file INSTALL cannot find
192
192
+
# "/build/linphone-desktop-.../build/linphone-sdk/desktop//nix/store/.../bin":
193
193
+
# No such file or directory.
194
194
+
#
195
195
+
# If someone is able to figure out how to fix that, great. For now, just
196
196
+
# trying to pick all the relevant files to the output.
197
197
+
#
198
198
+
# Also, the exec path in linphone.desktop file remains invalid, pointing to
199
199
+
# the build directory, after the whole nix build process. So, let's use sed to
200
200
+
# manually fix that path.
201
201
+
#
202
202
+
# In order to find mediastreamer plugins, mediastreamer package was patched to
203
203
+
# support an environment variable pointing to the plugin directory. Set that
204
204
+
# environment variable by wrapping the Linphone executable.
205
205
+
#
206
206
+
# Also, some grammar files needed to be copied too from some dependencies. I
207
207
+
# suppose if one define a dependency in such a way that its share directory is
208
208
+
# found, then this copying would be unnecessary. These missing grammar files
209
209
+
# were discovered when linphone crashed at startup and it was run with
210
210
+
# --verbose flag. Instead of actually copying these files, create symlinks.
211
211
+
#
212
212
+
# It is quite likely that there are some other files still missing and
213
213
+
# Linphone will randomly crash when it tries to access those files. Then,
214
214
+
# those just need to be copied manually below.
215
215
+
installPhase = ''
216
216
+
mkdir -p $out/bin
217
217
+
cp linphone $out/bin/
218
218
+
wrapProgram $out/bin/linphone \
219
219
+
--set MEDIASTREAMER_PLUGINS_DIR \
220
220
+
${mediastreamer-openh264}/lib/mediastreamer/plugins
221
221
+
mkdir -p $out/share/applications
222
222
+
sed -i "s@/build/.*/OUTPUT/bin@$out/bin@" linphone.desktop
223
223
+
cp linphone.desktop $out/share/applications/
224
224
+
cp -r ../assets/icons $out/share/
225
225
+
mkdir -p $out/share/belr/grammars
226
226
+
ln -s ${belcard}/share/belr/grammars/* $out/share/belr/grammars/
227
227
+
ln -s ${liblinphone}/share/belr/grammars/* $out/share/belr/grammars/
228
228
+
mkdir -p $out/share/linphone
229
229
+
ln -s ${liblinphone}/share/linphone/* $out/share/linphone/
53
230
'';
54
231
55
55
-
meta = with stdenv.lib; {
232
232
+
meta = with lib; {
56
233
homepage = https://www.linphone.org/;
57
234
description = "Open source SIP phone for voice/video calls and instant messaging";
58
58
-
license = licenses.gpl2Plus;
235
235
+
license = licenses.gpl3;
59
236
platforms = platforms.linux;
237
237
+
maintainers = with maintainers; [ jluttine ];
60
238
};
61
239
}
+13
pkgs/applications/networking/instant-messengers/linphone/fix_minizip_linking.patch
···
1
1
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2
2
+
index 3ee77441..18ea5c27 100644
3
3
+
--- a/CMakeLists.txt
4
4
+
+++ b/CMakeLists.txt
5
5
+
@@ -517,7 +517,7 @@ else()
6
6
+
target_link_libraries(${TARGET_NAME} "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.dylib")
7
7
+
execute_process(COMMAND install_name_tool -id "@executable_path/../Frameworks/libminizip.dylib" "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.dylib")
8
8
+
elseif(NOT WIN32)
9
9
+
- target_link_libraries(${TARGET_NAME} "${MINIZIP_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}/libminizip.so")
10
10
+
+ target_link_libraries(${TARGET_NAME} "minizip")
11
11
+
endif()
12
12
+
endif()#If (LinphoneCxx_FOUND AND Minizip_FOUND)
13
13
+
endif()#If (LinphoneCxx_FOUND)
+1
-1
pkgs/top-level/all-packages.nix
···
20566
20566
20567
20567
links2 = callPackage ../applications/networking/browsers/links2 { };
20568
20568
20569
20569
-
linphone = callPackage ../applications/networking/instant-messengers/linphone { };
20569
20569
+
linphone = libsForQt5.callPackage ../applications/networking/instant-messengers/linphone { };
20570
20570
20571
20571
linuxsampler = callPackage ../applications/audio/linuxsampler { };
20572
20572