nixpkgs/pkgs/by-name/li/live555/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

105 lines
2.8 KiB
Nix
Raw Normal View History

2024-04-19 21:02:15 +00:00
{
lib,
darwin,
fetchpatch,
fetchurl,
openssl,
stdenv,
vlc,
2022-01-26 11:25:26 +00:00
}:
2015-10-26 13:39:30 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "live555";
2024-04-29 02:25:41 +00:00
version = "2024.04.19";
2015-10-26 13:39:30 +00:00
2022-01-26 11:25:26 +00:00
src = fetchurl {
urls = [
"http://www.live555.com/liveMedia/public/live.${finalAttrs.version}.tar.gz"
"https://src.rrz.uni-hamburg.de/files/src/live555/live.${finalAttrs.version}.tar.gz"
"https://download.videolan.org/contrib/live555/live.${finalAttrs.version}.tar.gz"
"mirror://sourceforge/slackbuildsdirectlinks/live.${finalAttrs.version}.tar.gz"
];
2024-04-29 02:25:41 +00:00
hash = "sha256-5sLr/sZ3LB83CEJx5OUjarx/Dh/ESJ+YaXY0QCAN3MI=";
2015-10-26 13:39:30 +00:00
};
patches = [
(fetchpatch {
name = "cflags-when-darwin.patch";
url = "https://github.com/rgaufman/live555/commit/16701af5486bb3a2d25a28edaab07789c8a9ce57.patch?full_index=1";
hash = "sha256-IDSdByBu/EBLsUTBe538rWsDwH61RJfAEhvT68Nb9rU=";
})
];
nativeBuildInputs = lib.optionals stdenv.isDarwin [
darwin.cctools
];
buildInputs = [
openssl
];
2022-01-26 11:25:26 +00:00
strictDeps = true;
2022-01-26 11:25:26 +00:00
# Since NIX_CFLAGS_COMPILE does not differentiate C and C++ toolchains, we
# set CXXFLAGS directly
env.CXXFLAGS = "-std=c++20";
2018-04-24 20:06:15 +00:00
postPatch = ''
2022-01-19 21:19:05 +00:00
substituteInPlace config.macosx-catalina \
treewide: use lib.getLib for OpenSSL libraries At some point, I'd like to make another attempt at 71f1f4884b5 ("openssl: stop static binaries referencing libs"), which was reverted in 195c7da07df. One problem with my previous attempt is that I moved OpenSSL's libraries to a lib output, but many dependent packages were hardcoding the out output as the location of the libraries. This patch fixes every such case I could find in the tree. It won't have any effect immediately, but will mean these packages will automatically use an OpenSSL lib output if it is reintroduced in future. This patch should cause very few rebuilds, because it shouldn't make any change at all to most packages I'm touching. The few rebuilds that are introduced come from when I've changed a package builder not to use variable names like openssl.out in scripts / substitution patterns, which would be confusing since they don't hardcode the output any more. I started by making the following global replacements: ${pkgs.openssl.out}/lib -> ${lib.getLib pkgs.openssl}/lib ${openssl.out}/lib -> ${lib.getLib openssl}/lib Then I removed the ".out" suffix when part of the argument to lib.makeLibraryPath, since that function uses lib.getLib internally. Then I fixed up cases where openssl was part of the -L flag to the compiler/linker, since that unambigously is referring to libraries. Then I manually investigated and fixed the following packages: - pycurl - citrix-workspace - ppp - wraith - unbound - gambit - acl2 I'm reasonably confindent in my fixes for all of them. For acl2, since the openssl library paths are manually provided above anyway, I don't think openssl is required separately as a build input at all. Removing it doesn't make a difference to the output size, the file list, or the closure. I've tested evaluation with the OfBorg meta checks, to protect against introducing evaluation failures.
2022-03-25 15:33:21 +00:00
--replace '/usr/lib/libssl.46.dylib' "${lib.getLib openssl}/lib/libssl.dylib" \
--replace '/usr/lib/libcrypto.44.dylib' "${lib.getLib openssl}/lib/libcrypto.dylib"
2022-01-26 11:25:26 +00:00
sed -i -e 's|/bin/rm|rm|g' genMakefiles
sed -i \
2018-04-24 20:06:15 +00:00
-e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \
2022-01-26 11:25:26 +00:00
config.linux
''
# condition from icu/base.nix
2024-04-29 02:25:41 +00:00
+ lib.optionalString (lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" ]) ''
2017-11-07 06:27:32 +00:00
substituteInPlace liveMedia/include/Locale.hh \
--replace '<xlocale.h>' '<locale.h>'
'';
2015-10-26 13:39:30 +00:00
configurePhase = let
2024-04-19 21:02:15 +00:00
platform =
if stdenv.isLinux then
"linux"
else if stdenv.isDarwin then
"macosx-catalina"
else
throw "Unsupported platform: ${stdenv.hostPlatform.system}";
in ''
2018-10-22 13:06:11 +00:00
runHook preConfigure
./genMakefiles ${platform}
2018-10-22 13:06:11 +00:00
runHook postConfigure
2015-10-26 13:39:30 +00:00
'';
2022-06-16 17:54:55 +00:00
makeFlags = [
"PREFIX=${placeholder "out"}"
2024-04-29 20:36:21 +00:00
"C_COMPILER=$(CC)"
"CPLUSPLUS_COMPILER=$(CXX)"
"LIBRARY_LINK=$(AR) cr "
"LINK=$(CXX) -o "
2022-06-16 17:54:55 +00:00
];
2015-10-26 13:39:30 +00:00
2024-04-29 20:36:21 +00:00
# required for whitespaces in makeFlags
__structuredAttrs = true;
2018-10-22 13:06:11 +00:00
enableParallelBuilding = true;
2022-01-27 18:23:23 +00:00
passthru.tests = {
# Downstream dependency
2022-01-27 18:23:23 +00:00
inherit vlc;
};
meta = {
homepage = "http://www.live555.com/liveMedia/";
2022-01-26 11:25:26 +00:00
description = "Set of C++ libraries for multimedia streaming, using open standard protocols (RTP/RTCP, RTSP, SIP)";
changelog = "http://www.live555.com/liveMedia/public/changelog.txt";
license = with lib.licenses; [ lgpl21Plus ];
maintainers = with lib.maintainers; [ AndersonTorres ];
platforms = lib.platforms.unix;
2015-10-26 13:39:30 +00:00
};
})