linphone: 3.12.0 -> unstable-2020-03-06

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