live555: build dynamic, add check (#396471)

authored by

lassulus and committed by
GitHub
9b1b5679 b53c0d27

+36 -8
+36 -8
pkgs/by-name/li/live555/package.nix
··· 1 { 2 - lib, 3 cctools, 4 fetchpatch, 5 fetchurl, 6 openssl, 7 stdenv, 8 - vlc, 9 }: 10 11 stdenv.mkDerivation (finalAttrs: { 12 pname = "live555"; ··· 42 "PREFIX=${placeholder "out"}" 43 "C_COMPILER=$(CC)" 44 "CPLUSPLUS_COMPILER=$(CXX)" 45 - "LIBRARY_LINK=$(AR) cr " 46 "LINK=$(CXX) -o " 47 ]; 48 49 # Since NIX_CFLAGS_COMPILE affects both C and C++ toolchains, we set CXXFLAGS ··· 83 let 84 platform = 85 if stdenv.hostPlatform.isLinux then 86 - "linux" 87 else if stdenv.hostPlatform.isDarwin then 88 "macosx-catalina" 89 else ··· 97 runHook postConfigure 98 ''; 99 100 - passthru.tests = { 101 - # Downstream dependency 102 - inherit vlc; 103 - }; 104 105 meta = { 106 homepage = "http://www.live555.com/liveMedia/";
··· 1 { 2 + buildPackages, 3 cctools, 4 fetchpatch, 5 fetchurl, 6 + lib, 7 + live555, 8 openssl, 9 + runCommand, 10 stdenv, 11 }: 12 + let 13 + isStatic = stdenv.hostPlatform.isStatic; 14 + in 15 16 stdenv.mkDerivation (finalAttrs: { 17 pname = "live555"; ··· 47 "PREFIX=${placeholder "out"}" 48 "C_COMPILER=$(CC)" 49 "CPLUSPLUS_COMPILER=$(CXX)" 50 "LINK=$(CXX) -o " 51 + "LIBRARY_LINK=${if isStatic then "$(AR) cr " else "$(CC) -o "}" 52 ]; 53 54 # Since NIX_CFLAGS_COMPILE affects both C and C++ toolchains, we set CXXFLAGS ··· 88 let 89 platform = 90 if stdenv.hostPlatform.isLinux then 91 + if isStatic then "linux" else "linux-with-shared-libraries" 92 else if stdenv.hostPlatform.isDarwin then 93 "macosx-catalina" 94 else ··· 102 runHook postConfigure 103 ''; 104 105 + doInstallCheck = true; 106 + installCheckPhase = '' 107 + if ! ($out/bin/openRTSP || :) 2>&1 | grep -q "Usage: "; then 108 + echo "Executing example program failed" >&2 109 + exit 1 110 + else 111 + echo "Example program executed successfully" 112 + fi 113 + ''; 114 + 115 + passthru.tests = 116 + let 117 + emulator = stdenv.hostPlatform.emulator buildPackages; 118 + in 119 + { 120 + # The installCheck phase above cannot be ran in cross-compilation scenarios, 121 + # therefore the passthru test 122 + run-test-prog = runCommand "live555-run-test-prog" { } '' 123 + if ! (${emulator} ${live555}/bin/openRTSP || :) 2>&1 | grep -q "Usage: "; then 124 + echo "Executing example program failed" >&2 125 + exit 1 126 + else 127 + echo "Example program executed successfully" 128 + touch $out 129 + fi 130 + ''; 131 + }; 132 133 meta = { 134 homepage = "http://www.live555.com/liveMedia/";