10 , mediastreamer-openh264
19 # How to update Linphone? (The Qt desktop app)
21 # Belledonne Communications (BC), the company making Linphone, has split the
22 # project into several sub-projects that they maintain, plus some third-party
23 # dependencies that they also extend with commits of their own, specific to
24 # Linphone and not (yet?) upstreamed.
26 # All of this is organised in a Software Development Kit (SDK) meta-repository
27 # with git submodules to pin all those repositories into a coherent whole.
29 # The Linphone Qt desktop app uses this SDK as submodule as well.
31 # So, in order to update the desktop app to a new release, one has to follow
32 # the submodule chain and update the corresponding derivations here, in nixpkgs,
33 # with the corresponding version number (or commit hash)
36 pname = "linphone-desktop";
39 src = fetchFromGitLab {
40 domain = "gitlab.linphone.org";
45 hash = "sha256-Pu2tGKe3C1uR4lzXkC5sJFu8iJBqF76UfWJXYjPwBkc=";
49 ./do-not-build-linphone-sdk.patch
50 ./remove-bc_compute_full_version-usage.patch
51 ./no-store-path-in-autostart.patch
52 ./reset-output-dirs.patch
55 # See: https://gitlab.linphone.org/BC/public/linphone-desktop/issues/21
57 echo "project(linphoneqt VERSION ${version})" >linphone-app/linphoneqt_version.cmake
58 substituteInPlace linphone-app/src/app/AppController.cpp \
59 --replace "APPLICATION_SEMVER" "\"${version}\""
60 substituteInPlace CMakeLists.txt \
64 # TODO: After linphone-desktop and liblinphone split into separate packages,
65 # there might be some build inputs here that aren't needed for
75 mediastreamer-openh264
89 "-DMINIZIP_INCLUDE_DIRS=${minizip-ng}/include"
90 "-DMINIZIP_LIBRARIES=minizip"
92 # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
93 "-DCMAKE_SKIP_BUILD_RPATH=ON"
95 # Requires EQt5Keychain
96 "-DENABLE_QT_KEYCHAIN=OFF"
98 "-DCMAKE_INSTALL_BINDIR=bin"
99 "-DCMAKE_INSTALL_INCLUDEDIR=include"
100 "-DCMAKE_INSTALL_LIBDIR=lib"
104 mkdir -p $out/share/linphone
105 mkdir -p $out/share/sounds/linphone
108 # In order to find mediastreamer plugins, mediastreamer package was patched to
109 # support an environment variable pointing to the plugin directory. Set that
110 # environment variable by wrapping the Linphone executable.
112 # Also, some grammar files needed to be copied too from some dependencies. I
113 # suppose if one define a dependency in such a way that its share directory is
114 # found, then this copying would be unnecessary. These missing grammar files
115 # were discovered when linphone crashed at startup and it was run with
116 # --verbose flag. Instead of actually copying these files, create symlinks.
118 # It is quite likely that there are some other files still missing and
119 # Linphone will randomly crash when it tries to access those files. Then,
120 # those just need to be copied manually below.
122 mkdir -p $out/lib/mediastreamer/plugins
123 ln -s ${mediastreamer-openh264}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/
124 ln -s ${mediastreamer}/lib/mediastreamer/plugins/* $out/lib/mediastreamer/plugins/
126 mkdir -p $out/share/belr/grammars
127 ln -s ${liblinphone}/share/belr/grammars/* $out/share/belr/grammars/
128 ln -s ${belle-sip}/share/belr/grammars/* $out/share/belr/grammars/
130 wrapProgram $out/bin/linphone \
131 --set MEDIASTREAMER_PLUGINS_DIR $out/lib/mediastreamer/plugins
135 homepage = "https://www.linphone.org/";
136 description = "Open source SIP phone for voice/video calls and instant messaging";
137 mainProgram = "linphone";
138 license = licenses.gpl3Plus;
139 platforms = platforms.linux;
140 maintainers = with maintainers; [ jluttine ];