Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 14 commits into from Mar 28, 2020
Merged

Conversation

jluttine
Copy link
Member

@jluttine jluttine commented Mar 19, 2020

Motivation for this change

Update Linphone as it has seen significant upgrades since 3.12.0.

IIUC, it has split into some library packages, so some nontrivial work needed.

Anyway, this is still work in progress, I'm trying to figure out how to fix the upgrade. I just wanted to open a draft pull request already so people know that this is being worked on (and they can help if they want).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@jluttine
Copy link
Member Author

jluttine commented Mar 20, 2020

I'm having some problems compiling bctoolbox:

nix-build '<nixpkgs>' -A bctoolbox

Gives the following output:

these derivations will be built:
  /nix/store/y4zn2vsin7sryvxhxg84skppas9rryd2-bctoolbox-4.3.1.drv
building '/nix/store/y4zn2vsin7sryvxhxg84skppas9rryd2-bctoolbox-4.3.1.drv'...
unpacking sources
unpacking source archive /nix/store/cnl3gl9iharblvxqzr7y88xnxzcz3wzf-bctoolbox-4.3.1.tar.gz
source root is bctoolbox-4.3.1
setting SOURCE_DATE_EPOCH to timestamp 1580377471 of file bctoolbox-4.3.1/tester/port.c
patching sources
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/share/doc/ -DCMAKE_INSTALL_INFODIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=last -DCMAKE_STRIP=/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/strip -DCMAKE_RANLIB=/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ranlib -DCMAKE_AR=/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1 -DENABLE_STATIC=NO
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/gcc
-- Check for working C compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/g++
-- Check for working CXX compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting install rpath to /nix/store/rvm6jcq282y53wz83m83lcy3x3anmx7m-bctoolbox-4.3.1/lib
-- Looking for mbedtls_ssl_init
-- Looking for mbedtls_ssl_init - found
-- Looking for mbedtls_ssl_get_dtls_srtp_protection_profile
-- Looking for mbedtls_ssl_get_dtls_srtp_protection_profile - not found
-- Found MbedTLS: /nix/store/xw3mqvbsmf6xmc4czc1p25bgfpx22603-mbedtls-2.16.3/include
-- Using mbedTLS
-- Could NOT find Decaf (missing: Decaf_DIR)
-- DTLS SRTP not available
-- Looking for CU_get_suite
-- Looking for CU_get_suite - found
-- Looking for CU_curses_run_tests
-- Looking for CU_curses_run_tests - not found
-- Looking for CU_set_trace_handler
-- Looking for CU_set_trace_handler - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for dladdr in dl
-- Looking for dladdr in dl - found
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTING
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY


-- Build files have been written to: /build/bctoolbox-4.3.1/build
cmake: enabled parallel building
building
build flags: -j8 -l8 SHELL=/nix/store/4b6f6apsk9k9649iml240w4by5qxli7h-bash-4.4-p23/bin/bash
Scanning dependencies of target bctoolbox
[ 13%] Building C object src/CMakeFiles/bctoolbox.dir/crypto/crypto.c.o
[ 13%] Building C object src/CMakeFiles/bctoolbox.dir/containers/list.c.o
[ 13%] Building C object src/CMakeFiles/bctoolbox.dir/logging/logging.c.o
[ 21%] Building C object src/CMakeFiles/bctoolbox.dir/utils/port.c.o
[ 26%] Building C object src/CMakeFiles/bctoolbox.dir/vconnect.c.o
[ 30%] Building C object src/CMakeFiles/bctoolbox.dir/vfs.c.o
[ 30%] Building C object src/CMakeFiles/bctoolbox.dir/parser.c.o
[ 34%] Building C object src/CMakeFiles/bctoolbox.dir/crypto/mbedtls.c.o
[ 39%] Building CXX object src/CMakeFiles/bctoolbox.dir/containers/map.cc.o
[ 43%] Building CXX object src/CMakeFiles/bctoolbox.dir/conversion/charconv_encoding.cc.o
[ 47%] Building CXX object src/CMakeFiles/bctoolbox.dir/utils/exception.cc.o
[ 52%] Building CXX object src/CMakeFiles/bctoolbox.dir/utils/regex.cc.o
[ 56%] Building CXX object src/CMakeFiles/bctoolbox.dir/conversion/charconv.cc.o
[ 60%] Building CXX object src/CMakeFiles/bctoolbox.dir/crypto/ecc.cc.o
[ 65%] Linking CXX shared library libbctoolbox.so
[ 65%] Built target bctoolbox
Scanning dependencies of target bctoolbox-tester
[ 69%] Building C object src/CMakeFiles/bctoolbox-tester.dir/tester.c.o
/build/bctoolbox-4.3.1/src/tester.c: In function 'bc_tester_run_tests':
/build/bctoolbox-4.3.1/src/tester.c:836:5: error: implicit declaration of function 'CU_automated_enable_partial_junit'; did you mean 'CU_automated_enable_junit_xml'? [-Werror=implicit-function-declaration]
  836 |     CU_automated_enable_partial_junit(TRUE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     CU_automated_enable_junit_xml
cc1: all warnings being treated as errors
make[2]: *** [src/CMakeFiles/bctoolbox-tester.dir/build.make:63: src/CMakeFiles/bctoolbox-tester.dir/tester.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:138: src/CMakeFiles/bctoolbox-tester.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
builder for '/nix/store/y4zn2vsin7sryvxhxg84skppas9rryd2-bctoolbox-4.3.1.drv' failed with exit code 2
error: build of '/nix/store/y4zn2vsin7sryvxhxg84skppas9rryd2-bctoolbox-4.3.1.drv' failed

The relevant lines:

/build/bctoolbox-4.3.1/src/tester.c: In function 'bc_tester_run_tests':
/build/bctoolbox-4.3.1/src/tester.c:836:5: error: implicit declaration of function 'CU_automated_enable_partial_junit'; did you mean 'CU_automated_enable_junit_xml'? [-Werror=implicit-function-declaration]
  836 |     CU_automated_enable_partial_junit(TRUE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     CU_automated_enable_junit_xml

Somehow the builder doesn't seem to find stuff from bcunit although it's in nativeBuildInputs. Any ideas?

@jluttine
Copy link
Member Author

Do you, the maintainer Raskin @7c6f434c , have any insight on building bctoolbox?

@7c6f434c
Copy link
Member

Not really as I now have to use web-based chat applications, and this is a different version from what I have ever touched… it seems to offer another bcunit function, so it is not like it doesn't find it at all.

The missing function seems to have been added a year after that latest release of bcunit, you could add a package for an unstable version?

@jluttine
Copy link
Member Author

@7c6f434c Thanks, that indeed was the problem! I switched to unstable version of bcunit and now bctoolbox builds fine. 👍

@jluttine
Copy link
Member Author

Ok, I suppose I got all the dependencies updated and added. At least they all build up to liblinphone. Now, just linphone (i.e., linphone-desktop) remains. That's probably quite a beast.. With the current state I'm getting the following error:

these derivations will be built:
  /nix/store/qw7av2y7f0iafmgbjgj9vzqhxkw1qx2j-linphone-desktop-4.1.1.drv
building '/nix/store/qw7av2y7f0iafmgbjgj9vzqhxkw1qx2j-linphone-desktop-4.1.1.drv'...
unpacking sources
unpacking source archive /nix/store/9iw7hd3sh6a76r532xvhlqyjwd1g98mp-linphone-desktop-4.1.1.tar.gz
source root is linphone-desktop-4.1.1
setting SOURCE_DATE_EPOCH to timestamp 1500642153 of file linphone-desktop-4.1.1/ui/views/App/Styles/qmldir
patching sources
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/share/doc/ -DCMAKE_INSTALL_INFODIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=last -DCMAKE_STRIP=/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/strip -DCMAKE_RANLIB=/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ranlib -DCMAKE_AR=/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/g1mb2a3r1pxhhwlkj6y13cx2b7lkv6ji-linphone-desktop-4.1.1 -DCMAKE_BUILD_TYPE=Release
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/gcc
-- Check for working C compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/g++
-- Check for working CXX compiler: /nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test SUGGEST_OVERRIDE
-- Performing Test SUGGEST_OVERRIDE - Success
CMake Error at CMakeLists.txt:99 (find_package):
  By not providing "FindLinphone.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Linphone",
  but CMake did not find one.

  Could not find a package configuration file provided by "Linphone" with any
  of the following names:

    LinphoneConfig.cmake
    linphone-config.cmake

  Add the installation prefix of "Linphone" to CMAKE_PREFIX_PATH or set
  "Linphone_DIR" to a directory containing one of the above files.  If
  "Linphone" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/build/linphone-desktop-4.1.1/build/CMakeFiles/CMakeOutput.log".
builder for '/nix/store/qw7av2y7f0iafmgbjgj9vzqhxkw1qx2j-linphone-desktop-4.1.1.drv' failed with exit code 1
error: build of '/nix/store/qw7av2y7f0iafmgbjgj9vzqhxkw1qx2j-linphone-desktop-4.1.1.drv' failed

Perhaps the default CMake build in nixpkgs doesn't work here and I should use these steps: https://gitlab.linphone.org/BC/public/linphone-desktop#building

Not quite sure how to do it.. Any ideas appreciated! 🙂

@7c6f434c
Copy link
Member

Does liblinphone install the file mentioned in the error message anywhere?

@jluttine
Copy link
Member Author

Ah, true, it's liblinphone, not linphone itself, that should install that file. Yes, it does install it, but I had just forgot to add liblinphone to the build inputs of linphone.. 😳 Thanks again!

@jluttine
Copy link
Member Author

Some progress but got stuck now. The current state of this PR fails with errors I reported upstream: https://gitlab.linphone.org/BC/public/linphone-desktop/issues/21

(Got past the first issue, now stuck on second failure that is shown in the first comment.)

Probably it's just me doing something wrong but can't again figure out what it is..

@7c6f434c
Copy link
Member

Maybe a fresher and unreleased version of liblinphone is needed by linphone-desktop? Didn't check any details.

@jluttine
Copy link
Member Author

Thanks again! Using master branch for liblinphone resulted in a chain reaction that I needed to use the master branch for four other linphone-related packages, but then I got past those errors I had. Yey!

Now I'm just wondering if it's ok to use unstable versions for all these packages (linphone, liblinphone, belr, belle-sip, mediastreamer and ortp) in nixpkgs. It seems to me like the easiest route now. So I guess that's ok. (I'll clean the fixup and squash commits before this is merged.)

Now the build process has some problems with Minizip:

Scanning dependencies of target linphone-qt
make[2]: *** No rule to make target 'minizip_OUTPUT/nix/store/v5njiq0qmjs1l6npv72cw2rbnxasrkd2-linphone-desktop-unstable-2020-03-06/lib/libminizip.so', needed by 'linphone'.  Stop.

That's looks really weird.. I don't even understand why it tries to make minizip because before these lines it has said that minizip found.

Well, if I remove this line from the cmake file, the build process doesn't stop here anymore: https://gitlab.linphone.org/BC/public/linphone-desktop/blob/master/CMakeLists.txt#L520

But then it fails at the very final steps when inking of Minizip to Linphone executable:

[100%] Linking CXX executable linphone
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: CMakeFiles/app-library.dir/src/components/file/FileExtractor.cpp.o: in function `FileExtractor::~FileExtractor()':
/build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:41: undefined reference to `mz_stream_bzip_close'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:42: undefined reference to `mz_stream_bzip_delete'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:46: undefined reference to `mz_stream_posix_close'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:47: undefined reference to `mz_stream_posix_delete'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: CMakeFiles/app-library.dir/src/components/file/FileExtractor.cpp.o: in function `FileExtractor::clean()':
/build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:41: undefined reference to `mz_stream_bzip_close'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:42: undefined reference to `mz_stream_bzip_delete'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:46: undefined reference to `mz_stream_posix_close'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:47: undefined reference to `mz_stream_posix_delete'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: CMakeFiles/app-library.dir/src/components/file/FileExtractor.cpp.o: in function `FileExtractor::extract()':
/build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:41: undefined reference to `mz_stream_bzip_close'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:42: undefined reference to `mz_stream_bzip_delete'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:46: undefined reference to `mz_stream_posix_close'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:47: undefined reference to `mz_stream_posix_delete'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:60: undefined reference to `mz_stream_posix_create'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:65: undefined reference to `mz_stream_posix_open'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:69: undefined reference to `mz_stream_bzip_create'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:72: undefined reference to `mz_stream_bzip_open'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:76: undefined reference to `mz_stream_set_base'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: CMakeFiles/app-library.dir/src/components/file/FileExtractor.cpp.o: in function `FileExtractor::handleExtraction()':
/build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:256: undefined reference to `mz_stream_bzip_read'
/nix/store/m6bb8cbdmb5yirxm8pa9ah9xri4557v7-binutils-2.31.1/bin/ld: /build/linphone-desktop-971997e162558d37051f89c9c34bbc240135f704/src/components/file/FileExtractor.cpp:263: undefined reference to `mz_stream_bzip_get_prop_int64'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/linphone-qt.dir/build.make:239: linphone] Error 1
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/linphone-qt.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
builder for '/nix/store/bzc0afjh58p6miswyfzms0yk41b79id8-linphone-desktop-unstable-2020-03-06.drv' failed with exit code 2

I'm not quite sure why this happens because I have Minizip in buildInputs. I also checked with nm -D that this shared library contains (at least some of) these references the error message complains about. I tried giving CMake flags -DMINIZIP_LIBRARIES=${minizip2}/lib/libminizip.so or -DMINIZIP_LIBRARIES=${minizip2}/lib but it didn't help (not sure if it should be even needed to pass such a flag).

One option could be to let linphone build its own minizip. Hmm..

@7c6f434c
Copy link
Member

I think it is OK to use unstable versions for Linphone, but as I remember one of these packages had an external reverse-dependency in Nixpkgs that should probably still get a stable version. Having two versions with a comment about the latest release of Linphone sounds fine, though.

Re: vendored minizip — well, how long does minizip take to build… on another note, maybe now minizip is too old for some dependency of Linphone?

@jluttine
Copy link
Member Author

Oh, just FYI, I figured out how to patch the cmake file to make minizip linking work. Still some other failures at the very end of the whole build process, but they don't seem overwhelming.

@jluttine
Copy link
Member Author

jluttine commented Mar 23, 2020

Nope, not able to figure this out yet.. nix-build -A linphone fails at installation phase:

Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/applications/linphone.desktop
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/scalable/apps/linphone.svg
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/16x16/apps/linphone.png
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/22x22/apps/linphone.png
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/24x24/apps/linphone.png
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/32x32/apps/linphone.png
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/64x64/apps/linphone.png
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/128x128/apps/linphone.png
-- Installing: /build/linphone-desktop-971997e/build/OUTPUT/share/icons/hicolor/256x256/apps/linphone.png
CMake Error at cmake_builder/linphone_package/cmake_install.cmake:49 (file):
  file INSTALL cannot find
  "/build/linphone-desktop-971997e/build/linphone-sdk/desktop//nix/store/29kw664qqa6v6bpvlhv99ks1yi56s43j-linphone-desktop-unstable-2020-03-06/bin":
  No such file or directory.
Call Stack (most recent call first):
  cmake_install.cmake:80 (include)


make: *** [Makefile:140: install] Error 1

That directory it cannot find is just messed up.. It's a combination of two absolute paths. I haven't been able to figure out yet what flags should I pass to make it work. I tried patching some cmake files too but couldn't make it work. I'm not sure if this phase should install the files under $out/ or is that /build/.../OUTPUT/ ok. Not familiar with cmake at all..

EDIT: I'll continue tomorrow...

@7c6f434c
Copy link
Member

I mean, there is always the Brute Force Way of creating a symlink to /nix as ./nix (not much of a good idea, but can help to check how many other problems are left)

@jluttine
Copy link
Member Author

jluttine commented Mar 24, 2020

I got the install phase working by writing my own install phase which just picks some files and copies them under $out. Then it built but I needed to fix Qt wrapping.

Now, running the compiled linphone produces:

"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' folder."
[20:36:44:171][0x2141eb0][Info]"Starting Linphone (bin: linphone)"
[20:36:44:171][0x2141eb0][Info]"Use locale: en_US"
[20:36:44:194][0x2141eb0][Info]"Running app..."
[20:36:44:194][0x2141eb0][Warning]"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' folder."
[20:36:44:195][0x26f2c80][Info]"Launch async core creation."
[20:36:44:195][0x26f2c80][Warning]"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' folder."
[20:36:44:195][0x26f2c80][Warning]"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' folder."
[20:36:44:195][0x26f2c80][Warning]"The application's location is not correct: You have to put your 'bin/' folder next to 'lib/' folder."
[20:36:44:197][0x2141eb0][Info]"Activated selectors:" ("custom", "en_US", "unix", "linux", "nixos")
[20:36:44:197][0x2141eb0][Info]"Registering types..."
[20:36:44:197][0x2141eb0][Info]"Registering shared types..."
[20:36:44:197][0x2141eb0][Info]"Registering tool types..."
[20:36:44:197][0x2141eb0][Info]"Registering shared tool types..."
[20:36:44:237][0x2141eb0][Info]"Loading main view..."
Aborted (core dumped)

I then tried just creating empty lib directory under $out (there were no lib files nor directories in the build directory or any of its subdirectories recursively). That removes those warnings but still aborts (core dumped) similarly. Need to continue on this later again.. But I don't have many ideas how to debug this as those messages don't give me a lot of information..

(Also, need to fix the path in the resulting linphone.desktop file as it points to the executable under the build directory - I thought nix builder automatically fixes these..)

@ofborg ofborg bot requested a review from 7c6f434c March 24, 2020 20:01
@7c6f434c
Copy link
Member

I am a bit afraid that it wants a link to the library's lib directory.

(Also, if you do the horrible hack of a nix symlink, does this create any lib directory?)

@jluttine
Copy link
Member Author

jluttine commented Mar 27, 2020

I'd still like to make the following change: Add withH264 ? true argument to mediastreamer2. Then, the plugin handling is a bit easier and it's also easy to add more plugins similarly in the future. This PR now removed support for plugins, but I need to add it back. I'm just thinking that I could do it a bit differently than patching mediastreamer to support an environment variable to define path to the plugins and then wrapping relevant files so that this environment variable is defined. In my opinion, adding withH264 ? true argument is cleaner and I guess that's how it's done in many other packages. Any comments before I do that?

@jluttine
Copy link
Member Author

Or actually, maybe I'll implement something similar as withPlugins for roundcube package!

@7c6f434c
Copy link
Member

If disabling H.264 requires a rebuild of the main package, what is the benefit in comparison to just overriding h264 = null?

@jluttine
Copy link
Member Author

jluttine commented Mar 27, 2020

I ended up doing the plugin support similarly as it was before because the plugin directory needs to be set by environment variables and this needs to be set by wrapping the executables that use the library, the library cannot be wrapped.

With these fixup commits, openh264 plugin should be enabled for Linphone. However, I'm not sure how this should affect anything.. Video codecs in preferences still look as follows:

image

H264 is disabled. If I try to enable it, I get pop up asking: "Do you want to download H264 (Provided by CISCO SYSTEM,INC)?" So, I'm not sure if that mediastreamer plugin is even supposed to enable H264 for Linphone or is some other package by Cisco needed anyway.. But then, what is the purpose of the plugin...??

@jluttine jluttine force-pushed the linphone-4.1.1 branch 2 times, most recently from a0ad797 to e788651 Compare March 28, 2020 09:31
@jluttine
Copy link
Member Author

Things done now:

  • Got the plugins working. I just needed to enforce the usage of the environment variable in the mediastreamer patch. Now H264 is enabled in Linphone.
  • Formatted the files with nixpkgs-fmt. Also, sorted lists of arguments.
  • Used fetchFromGitLab.
  • Ran nixpkgs-review pr 82939. All good.

So, I think this is ready.

@7c6f434c
Copy link
Member

Re: Cisco — it is a US story. There are MPEG patents covering H.264, and of course large communication players like Cisco need to be offered an «unlimited and unreported number of devices» license or they will tank the format. Cisco ended up deciding that if they have to pay for that patent license, they can as well provide binaries covered by this license to anyone who asks. These must be downloaded as binary dynamic libraries to be covered under Cisco's license from MPEG-LA, but Cisco also provides the source code under BSD copyright license with (as far as I remember) bit-perfect build reproducibility.

@7c6f434c
Copy link
Member

Hmm, and if someone in US wants to go the Cisco-provided way, it is nontrivial right now, right? Just overriding some inputs to null would probably make the wrapping behave weirdly on non-NixOS.

@jluttine
Copy link
Member Author

Downloading the Cisco file (libopenh264.so) didn't work probably because it tries to install it under nix store. Now, if someone wants to remove the H264 plugin for Linphone, one needs to remove the wrapping done in install phase of linphone. Another option could be that mediastreamer-openh264 input is set to something dummy. Is this something we need to support? Does someone need to disable openh264 or mediastreamer-openh264 packages in nixpkgs while using Linphone?

@7c6f434c
Copy link
Member

No idea, well we can wait for some user from US submitting a patch, I guess.

@7c6f434c 7c6f434c merged commit 05f0934 into NixOS:master Mar 28, 2020
@jluttine
Copy link
Member Author

@7c6f434c Thanks a lot for your help with this PR!! 👌

@7c6f434c
Copy link
Member

I did not do anything and spent no effort beyond proofreading a couple of times just in case, only shared the memories of someone who has touched this — and similar packages — some time ago. Thank you for doing a lot of great (and documented in code comments with impressive attention to details) work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants