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

freeswitch: Add support for mod_opusfile #89556

Merged
merged 1 commit into from Jun 6, 2020

Conversation

dasJ
Copy link
Member

@dasJ dasJ commented Jun 5, 2020

Also switch to callPackage, add the webm module (untested), fix the
include path to libopus, and fix the av module.

Motivation for this change
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.

@@ -114,7 +112,8 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

NIX_CFLAGS_COMPILE = "-Wno-error";
NIX_CFLAGS_COMPILE = "-Wno-error"
+ lib.optionalString (lib.elem libopus buildInputs) " -I${lib.getDev libopus}/include/opus";
Copy link
Contributor

@misuzu misuzu Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required? It's building just fine without this hack.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's when building with the opusfile module. opusfile uses libopusenc which wants to use libopus by #include <opus.h>. However, the nixpkgs libopus has the header in the opus subdirectory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried building your branch with this patch and had no issues:

> git diff
diff --git a/pkgs/servers/sip/freeswitch/default.nix b/pkgs/servers/sip/freeswitch/default.nix
index a9834ff7bf0..43cd054f270 100644
--- a/pkgs/servers/sip/freeswitch/default.nix
+++ b/pkgs/servers/sip/freeswitch/default.nix
@@ -63,6 +63,7 @@ defaultModules = mods: with mods; [
   formats.png
   formats.sndfile
   formats.tone_stream
+  formats.opusfile

   languages.lua

@@ -112,8 +113,8 @@ stdenv.mkDerivation rec {

   enableParallelBuilding = true;

-  NIX_CFLAGS_COMPILE = "-Wno-error"
-    + lib.optionalString (lib.elem libopus buildInputs) " -I${lib.getDev libopus}/include/opus";
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+  #   + lib.optionalString (lib.elem libopus buildInputs) " -I${lib.getDev libopus}/include/opus";

   hardeningDisable = [ "format" ];
> ldd /nix/store/a7a28kgya16c32van9lsy82kc6ix0npl-freeswitch-1.10.3/lib/freeswitch/mod/mod_opusfile.so                                                                                                                                   misuzu@serara 21:55:21
        linux-vdso.so.1 (0x00007ffc57b92000)
        libm.so.6 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/libm.so.6 (0x00007f1b9eccb000)
        libfreeswitch.so.1 => /nix/store/a7a28kgya16c32van9lsy82kc6ix0npl-freeswitch-1.10.3/lib/libfreeswitch.so.1 (0x00007f1b9e81b000)
        libpq.so.5 => /nix/store/9jp0bxh8da5x1nv222yp6qwx2kd9ydis-postgresql-11.7-lib/lib/libpq.so.5 (0x00007f1b9e7d1000)
        libpthread.so.0 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/libpthread.so.0 (0x00007f1b9e7ae000)
        libsqlite3.so.0 => /nix/store/xyzx9y4wyv76r8q0rj4v9rk50kv9bgxr-sqlite-3.31.1/lib/libsqlite3.so.0 (0x00007f1b9e68c000)
        libcurl.so.4 => /nix/store/y5a5ca9a42nivq54h82vgn1n524nm1hb-curl-7.70.0/lib/libcurl.so.4 (0x00007f1b9e5fd000)
        libpcre.so.1 => /nix/store/ji8l89zank5wrkqagagpykbgzqabqmz4-pcre-8.44/lib/libpcre.so.1 (0x00007f1b9e58b000)
        libspeex.so.1 => /nix/store/l6b4594fvcqzppy13xhyv9ryp15qys06-speex-1.2.0/lib/libspeex.so.1 (0x00007f1b9e570000)
        libspeexdsp.so.1 => /nix/store/8bxd8p24ib4d1imxw2a1qyx1qanvrpgd-speexdsp-1.2.0/lib/libspeexdsp.so.1 (0x00007f1b9e55e000)
        libedit.so.0 => /nix/store/g00kvml87wma3g3cgx02xb7ggkhdi4ca-libedit-20191231-3.1/lib/libedit.so.0 (0x00007f1b9e522000)
        libdl.so.2 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/libdl.so.2 (0x00007f1b9e51d000)
        libcrypt.so.1 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/libcrypt.so.1 (0x00007f1b9e4e3000)
        librt.so.1 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/librt.so.1 (0x00007f1b9e4d9000)
        libz.so.1 => /nix/store/ml4ipdnvc7pr07dr6i35831f7ffxny0k-zlib-1.2.11/lib/libz.so.1 (0x00007f1b9e4bc000)
        libstdc++.so.6 => /nix/store/a6z7ighixg7gb6krf9k60ylgmahij63x-gcc-9.3.0-lib/lib/../lib64/libstdc++.so.6 (0x00007f1b9e2db000)
        libopusfile.so.0 => /nix/store/9ppldjwqahs9qc3jqjrg74cpcs76d0yr-opusfile-0.11/lib/libopusfile.so.0 (0x00007f1b9e2cb000)
        libopusenc.so.0 => /nix/store/5m42il75ga9hgacyb44y3pm1lg18g3vw-libopusenc-0.2.1/lib/libopusenc.so.0 (0x00007f1b9e2bd000)
        libssl.so.1.1 => /nix/store/qnjnjw8q9wzyk2dhx715cmh6ysi72zq1-openssl-1.1.1g/lib/libssl.so.1.1 (0x00007f1b9e227000)
        libcrypto.so.1.1 => /nix/store/qnjnjw8q9wzyk2dhx715cmh6ysi72zq1-openssl-1.1.1g/lib/libcrypto.so.1.1 (0x00007f1b9df3a000)
        libc.so.6 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/libc.so.6 (0x00007f1b9dd7b000)
        /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib64/ld-linux-x86-64.so.2 (0x00007f1b9ee14000)
        libgcc_s.so.1 => /nix/store/a6z7ighixg7gb6krf9k60ylgmahij63x-gcc-9.3.0-lib/lib/../lib64/libgcc_s.so.1 (0x00007f1b9dd5f000)
        libnghttp2.so.14 => /nix/store/k8bvpif710gvidqm160bf6ywiiyjy6ky-nghttp2-1.40.0-lib/lib/libnghttp2.so.14 (0x00007f1b9dd36000)
        libssh2.so.1 => /nix/store/7lfkc47n07g7xrhwrz8chhdhm4mdzbnq-libssh2-1.9.0/lib/libssh2.so.1 (0x00007f1b9dcf6000)
        libgssapi_krb5.so.2 => /nix/store/50gghjlsn94j2bi8ckzj9bg4csb84hg4-libkrb5-1.18/lib/libgssapi_krb5.so.2 (0x00007f1b9dca3000)
        libkrb5.so.3 => /nix/store/50gghjlsn94j2bi8ckzj9bg4csb84hg4-libkrb5-1.18/lib/libkrb5.so.3 (0x00007f1b9dbc7000)
        libk5crypto.so.3 => /nix/store/50gghjlsn94j2bi8ckzj9bg4csb84hg4-libkrb5-1.18/lib/libk5crypto.so.3 (0x00007f1b9db97000)
        libcom_err.so.3 => /nix/store/50gghjlsn94j2bi8ckzj9bg4csb84hg4-libkrb5-1.18/lib/libcom_err.so.3 (0x00007f1b9db91000)
        libfftw3f.so.3 => /nix/store/jll8z4xnm9vzp0nl7pmabk3vl3fk9nwi-fftw-single-3.3.8/lib/libfftw3f.so.3 (0x00007f1b9d9f3000)
        libncursesw.so.6 => /nix/store/hc00jxav45p2simp6qz44z5djyv1m1fy-ncurses-6.2/lib/libncursesw.so.6 (0x00007f1b9d97f000)
        libogg.so.0 => /nix/store/jpk4crqkkid5b744xbn7n104fyn2s138-libogg-1.3.4/lib/libogg.so.0 (0x00007f1b9d972000)
        libopus.so.0 => /nix/store/5pm192x7swvpdpnj588sq9j60v0crmm1-libopus-1.3.1/lib/libopus.so.0 (0x00007f1b9d913000)
        libkrb5support.so.0 => /nix/store/50gghjlsn94j2bi8ckzj9bg4csb84hg4-libkrb5-1.18/lib/libkrb5support.so.0 (0x00007f1b9d904000)
        libkeyutils.so.1 => /nix/store/cs35zh08x2z95h7qmw86sqjwpyhpb97y-keyutils-1.6.1-lib/lib/libkeyutils.so.1 (0x00007f1b9d8fd000)
        libresolv.so.2 => /nix/store/jx19wa4xlh9n4324xdl9rjnykd19mmq3-glibc-2.30/lib/libresolv.so.2 (0x00007f1b9d8e2000)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, you are right. I force-pushed that change away

Also switch to callPackage, add the webm module (untested), and
fix the av module.
@Lassulus Lassulus merged commit 4b891a5 into NixOS:master Jun 6, 2020
@dasJ dasJ deleted the freeswitch-formats branch June 6, 2020 10:56
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