diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/linphone')
3 files changed, 379 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/default.nix new file mode 100644 index 000000000000..f0846fc63f7e --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/default.nix @@ -0,0 +1,187 @@ +{ bcg729 +, bctoolbox +, bcunit +, belcard +, belle-sip +, belr +, bzrtp +, cairo +, cmake +, cyrus_sasl +, fetchFromGitLab +, fetchurl +, ffmpeg_3 +, gdk-pixbuf +, glib +, gnused +, graphviz +, gtk2 +, intltool +, lib +, libexosip +, liblinphone +, libmatroska +, libnotify +, libosip +, libsoup +, libupnp +, libX11 +, libxml2 +, makeWrapper +, mbedtls +, mediastreamer +, mediastreamer-openh264 +, minizip2 +, mkDerivation +, openldap +, ortp +, pango +, pkg-config +, python +, qtbase +, qtgraphicaleffects +, qtquickcontrols2 +, qttranslations +, readline +, speex +, sqlite + +, udev +, zlib +}: + +mkDerivation rec { + pname = "linphone-desktop"; + version = "4.2.5"; + + src = fetchFromGitLab { + domain = "gitlab.linphone.org"; + owner = "public"; + group = "BC"; + repo = pname; + rev = version; + sha256 = "1gq4l9p21rbrcksa7fbkzn9fzbbynqmn6ni6lhnvzk359sb1xvbz"; + }; + + patches = [ + ./do-not-build-linphone-sdk.patch + ./remove-bc_compute_full_version-usage.patch + ]; + + # See: https://gitlab.linphone.org/BC/public/linphone-desktop/issues/21 + postPatch = '' + echo "project(linphoneqt VERSION ${version})" >linphone-app/linphoneqt_version.cmake + substituteInPlace linphone-app/src/app/AppController.cpp \ + --replace "LINPHONE_QT_GIT_VERSION" "\"${version}\"" + ''; + + # TODO: After linphone-desktop and liblinphone split into separate packages, + # there might be some build inputs here that aren't needed for + # linphone-desktop. + buildInputs = [ + bcg729 + bctoolbox + belcard + belle-sip + belr + bzrtp + cairo + cyrus_sasl + ffmpeg_3 + gdk-pixbuf + glib + gtk2 + libX11 + libexosip + liblinphone + libmatroska + libnotify + libosip + libsoup + libupnp + libxml2 + mbedtls + mediastreamer + mediastreamer-openh264 + minizip2 + openldap + ortp + pango + qtbase + qtgraphicaleffects + qtquickcontrols2 + qttranslations + readline + speex + sqlite + udev + zlib + ]; + + nativeBuildInputs = [ + bcunit + cmake + gnused + graphviz + intltool + makeWrapper + pkg-config + ]; + + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=RelWithDebInfo" + "-DMINIZIP_INCLUDE_DIRS=${minizip2}/include" + "-DMINIZIP_LIBRARIES=minizip" + ]; + + # The default install phase fails because the paths are somehow messed up in + # the makefiles. The errors were like: + # + # CMake Error at cmake_builder/linphone_package/cmake_install.cmake:49 (file): + # file INSTALL cannot find + # "/build/linphone-desktop-.../build/linphone-sdk/desktop//nix/store/.../bin": + # No such file or directory. + # + # If someone is able to figure out how to fix that, great. For now, just + # trying to pick all the relevant files to the output. + # + # Also, the exec path in linphone.desktop file remains invalid, pointing to + # the build directory, after the whole nix build process. So, let's use sed to + # manually fix that path. + # + # In order to find mediastreamer plugins, mediastreamer package was patched to + # support an environment variable pointing to the plugin directory. Set that + # environment variable by wrapping the Linphone executable. + # + # Also, some grammar files needed to be copied too from some dependencies. I + # suppose if one define a dependency in such a way that its share directory is + # found, then this copying would be unnecessary. These missing grammar files + # were discovered when linphone crashed at startup and it was run with + # --verbose flag. Instead of actually copying these files, create symlinks. + # + # It is quite likely that there are some other files still missing and + # Linphone will randomly crash when it tries to access those files. Then, + # those just need to be copied manually below. + installPhase = '' + mkdir -p $out/bin + cp linphone-app/linphone $out/bin/ + wrapProgram $out/bin/linphone \ + --set MEDIASTREAMER_PLUGINS_DIR \ + ${mediastreamer-openh264}/lib/mediastreamer/plugins + mkdir -p $out/share/applications + cp linphone-app/linphone.desktop $out/share/applications/ + cp -r ../linphone-app/assets/icons $out/share/ + mkdir -p $out/share/belr/grammars + ln -s ${liblinphone}/share/belr/grammars/* $out/share/belr/grammars/ + mkdir -p $out/share/linphone + ln -s ${liblinphone}/share/linphone/* $out/share/linphone/ + ''; + + meta = with lib; { + homepage = "https://www.linphone.org/"; + description = "Open source SIP phone for voice/video calls and instant messaging"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ jluttine ]; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch b/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch new file mode 100644 index 000000000000..fe774a479fac --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/do-not-build-linphone-sdk.patch @@ -0,0 +1,118 @@ +From 08b8b1811a1ad079fa713d19a8cc6bf2dc782bb7 Mon Sep 17 00:00:00 2001 +From: David P <megver83@parabola.nu> +Date: Thu, 26 Nov 2020 15:56:30 -0300 +Subject: [PATCH 1/2] do not build linphone-sdk + +Signed-off-by: David P <megver83@parabola.nu> +--- + CMakeLists.txt | 61 +------------------ + .../cmake_builder/additional_steps.cmake | 9 --- + 2 files changed, 3 insertions(+), 67 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f7eb05f2..5921ee5b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -118,7 +118,6 @@ list(APPEND APP_OPTIONS "-DENABLE_RELATIVE_PREFIX=${ENABLE_RELATIVE_PREFIX}") + + list(APPEND APP_OPTIONS "-DLINPHONE_OUTPUT_DIR=${LINPHONE_OUTPUT_DIR}") + +-include(ExternalProject) + set(PROJECT_BUILD_COMMAND "") + if(CMAKE_BUILD_PARALLEL_LEVEL) + list(APPEND APP_OPTIONS "-DCMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL}") +@@ -136,29 +135,8 @@ if(UNIX AND NOT APPLE) + set(CMAKE_INSTALL_RPATH "$ORIGIN:$ORIGIN/lib64:$ORIGIN/../lib64:$ORIGIN/lib:$ORIGIN/../lib:${LINPHONE_OUTPUT_DIR}/${CMAKE_INSTALL_LIBDIR}") + list(APPEND APP_OPTIONS "-DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}") + endif() +-ExternalProject_Add(sdk PREFIX "${CMAKE_BINARY_DIR}/sdk" +- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-sdk" +- INSTALL_DIR "${LINPHONE_OUTPUT_DIR}" +- STAMP_DIR "${SDK_BUILD_DIR}/stamp" +- BINARY_DIR "${SDK_BUILD_DIR}" +- STEP_TARGETS build +- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} +- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +- LIST_SEPARATOR | # Use the alternate list separator +- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +- #BUILD_ALWAYS NO #${DO_BUILD} +-) +-ExternalProject_Add_Step(sdk force_build +- COMMENT "Forcing build for 'desktop'" +- DEPENDEES configure +- DEPENDERS build +- ALWAYS 1 +-) + include(FindPkgConfig) + +-set(APP_DEPENDS sdk) +- +- + find_package(Qt5 5.12 COMPONENTS Core REQUIRED) + + if ( NOT Qt5_FOUND ) +@@ -173,39 +151,6 @@ find_package(Mediastreamer2 CONFIG QUIET) + find_package(ortp CONFIG QUIET) + + +-if(NOT (LinphoneCxx_FOUND) OR NOT (Linphone_FOUND) OR NOT (bctoolbox_FOUND) OR NOT (belcard_FOUND) OR NOT (Mediastreamer2_FOUND) OR NOT (ortp_FOUND) OR FORCE_APP_EXTERNAL_PROJECTS) +- message("Projects are set as External projects. You can start building them by using for example : cmake --build . --target install") +- ExternalProject_Add(linphone-qt PREFIX "${CMAKE_BINARY_DIR}/linphone-app" +- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" +- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" +- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" +- DEPENDS ${APP_DEPENDS} +- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} +- INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step will not be done by external project" +- LIST_SEPARATOR | # Use the alternate list separator +- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +- # ${APP_OPTIONS} +- BUILD_ALWAYS ON +- ) +- install(CODE "message(STATUS Running install)") +- set(AUTO_REGENERATION auto_regeneration) +- add_custom_target(${AUTO_REGENERATION} ALL +- COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} +- DEPENDS linphone-qt) +-else() +- message("Adding Linphone Desktop in an IDE-friendly state") +- set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") +- add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) +- add_dependencies(app-library ${APP_DEPENDS}) +-endif() +-ExternalProject_Add(linphone-qt-only PREFIX "${CMAKE_BINARY_DIR}/linphone-app" +- SOURCE_DIR "${CMAKE_SOURCE_DIR}/linphone-app" +- INSTALL_DIR "${APPLICATION_OUTPUT_DIR}" +- BINARY_DIR "${CMAKE_BINARY_DIR}/linphone-app" +- BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --config $<CONFIG> ${PROJECT_BUILD_COMMAND} +-# INSTALL_COMMAND ${CMAKE_COMMAND} -E echo "Install step is already done at build time." +- LIST_SEPARATOR | # Use the alternate list separator +- CMAKE_ARGS ${APP_OPTIONS} ${USER_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=${PREFIX_PATH} +- EXCLUDE_FROM_ALL ON +- BUILD_ALWAYS ON +-) ++message("Adding Linphone Desktop in an IDE-friendly state") ++set(CMAKE_INSTALL_PREFIX "${APPLICATION_OUTPUT_DIR}") ++add_subdirectory(${CMAKE_SOURCE_DIR}/linphone-app) +diff --git a/linphone-app/cmake_builder/additional_steps.cmake b/linphone-app/cmake_builder/additional_steps.cmake +index 7f7fd573..a69a04e8 100644 +--- a/linphone-app/cmake_builder/additional_steps.cmake ++++ b/linphone-app/cmake_builder/additional_steps.cmake +@@ -54,14 +54,5 @@ if (ENABLE_PACKAGING) + linphone_builder_apply_flags() + linphone_builder_set_ep_directories(linphone_package) + linphone_builder_expand_external_project_vars() +- ExternalProject_Add(TARGET_linphone_package +- DEPENDS TARGET_linphone_builder +- TMP_DIR ${ep_tmp} +- BINARY_DIR ${ep_build} +- SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/linphone_package" +- DOWNLOAD_COMMAND "" +- CMAKE_GENERATOR ${CMAKE_GENERATOR} +- CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_DESKTOP_DIR=${CMAKE_CURRENT_LIST_DIR}/.. -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DLINPHONE_BUILDER_SIGNING_IDENTITY=${LINPHONE_BUILDER_SIGNING_IDENTITY} +- ) + endif () + endif () +-- +2.29.2 + diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch b/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch new file mode 100644 index 000000000000..547652d3af7f --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/linphone/remove-bc_compute_full_version-usage.patch @@ -0,0 +1,74 @@ +From 6fc23da651d54979e73776fcda38614e290d65dc Mon Sep 17 00:00:00 2001 +From: David P <megver83@parabola.nu> +Date: Fri, 23 Oct 2020 16:44:17 -0300 +Subject: [PATCH 2/2] remove bc_compute_full_version usage + +--- + linphone-app/CMakeLists.txt | 11 +---------- + linphone-app/build/CMakeLists.txt | 5 ----- + .../cmake_builder/linphone_package/CMakeLists.txt | 10 +--------- + 3 files changed, 2 insertions(+), 24 deletions(-) + +diff --git a/linphone-app/CMakeLists.txt b/linphone-app/CMakeLists.txt +index 3bc9420a..27b418ee 100644 +--- a/linphone-app/CMakeLists.txt ++++ b/linphone-app/CMakeLists.txt +@@ -21,17 +21,8 @@ + ################################################################################ + cmake_minimum_required(VERSION 3.1) + ++include(linphoneqt_version.cmake) + find_package(bctoolbox CONFIG) +-set(FULL_VERSION ) +-bc_compute_full_version(FULL_VERSION) +-set(version_major ) +-set(version_minor ) +-set(version_patch ) +-set(identifiers ) +-set(metadata ) +-bc_parse_full_version("${FULL_VERSION}" version_major version_minor version_patch identifiers metadata) +- +-project(linphoneqt VERSION "${version_major}.${version_minor}.${version_patch}") + + if(ENABLE_BUILD_VERBOSE) + #message("CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}") +diff --git a/linphone-app/build/CMakeLists.txt b/linphone-app/build/CMakeLists.txt +index 8ef03faa..97d94bd6 100644 +--- a/linphone-app/build/CMakeLists.txt ++++ b/linphone-app/build/CMakeLists.txt +@@ -46,11 +46,6 @@ set(CPACK_SOURCE_IGNORE_FILES + "libmng.spec" + ) + +-bc_compute_full_version(PROJECT_VERSION_BUILD) +-if(PROJECT_VERSION_BUILD) +- set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION_BUILD}") +-endif() +- + message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}") + + set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) +diff --git a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt +index baea03cf..08ffc1b5 100644 +--- a/linphone-app/cmake_builder/linphone_package/CMakeLists.txt ++++ b/linphone-app/cmake_builder/linphone_package/CMakeLists.txt +@@ -38,15 +38,7 @@ set(LINPHONE_QML_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../ui") + # ============================================================================== + # Build package version. + # ============================================================================== +-bc_compute_full_version(APP_PROJECT_VERSION) +-if (GIT_EXECUTABLE AND NOT(APP_PROJECT_VERSION)) +- execute_process( +- COMMAND ${GIT_EXECUTABLE} describe --always +- OUTPUT_VARIABLE APP_PROJECT_VERSION +- OUTPUT_STRIP_TRAILING_WHITESPACE +- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../.." +- ) +-elseif (NOT(APP_PROJECT_VERSION)) ++if (NOT(APP_PROJECT_VERSION)) + set(APP_PROJECT_VERSION "0.0.0") + endif () + string(REGEX REPLACE "([0-9.]+)-?.*" "\\1" LINPHONE_VERSION "${APP_PROJECT_VERSION}") +-- +2.29.2 + |