diff options
author | Robert Scott <code@humanleg.org.uk> | 2024-01-24 22:22:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-24 22:22:52 +0000 |
commit | 94cbab5a90fde5a004e69792035907d3d98c88a8 (patch) | |
tree | b5add41c282b346d8ebe42febe85dba5e29b876e | |
parent | c7a0ce9ef46dd66de970876436ef6ebe4a8ca299 (diff) | |
parent | 5f3f093c013877f5f85ebb1a1d53aaeeb93f6f63 (diff) |
Merge pull request #280963 from atorres1985-contrib/live555
Live555 updates
-rw-r--r-- | pkgs/by-name/li/live555/package.nix | 95 | ||||
-rw-r--r-- | pkgs/development/libraries/live555/default.nix | 75 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
3 files changed, 95 insertions, 77 deletions
diff --git a/pkgs/by-name/li/live555/package.nix b/pkgs/by-name/li/live555/package.nix new file mode 100644 index 0000000000000..b08ed44f48542 --- /dev/null +++ b/pkgs/by-name/li/live555/package.nix @@ -0,0 +1,95 @@ +{ lib +, darwin +, fetchurl +, fetchpatch +, openssl +, stdenv +, vlc +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "live555"; + version = "2023.11.30"; + + 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" + ]; + hash = "sha256-xue+9YtdAM2XkzAY6dU2PZ3n6bvPwlULIHqBqc8wuSU="; + }; + + 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 + ]; + + strictDeps = true; + + # Since NIX_CFLAGS_COMPILE does not differentiate C and C++ toolchains, we + # set CXXFLAGS directly + env.CXXFLAGS = "-std=c++20"; + + postPatch = '' + substituteInPlace config.macosx-catalina \ + --replace '/usr/lib/libssl.46.dylib' "${lib.getLib openssl}/lib/libssl.dylib" \ + --replace '/usr/lib/libcrypto.44.dylib' "${lib.getLib openssl}/lib/libcrypto.dylib" + sed -i -e 's|/bin/rm|rm|g' genMakefiles + sed -i \ + -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ + config.linux + '' + # condition from icu/base.nix + + lib.optionalString (stdenv.hostPlatform.libc == "glibc" + || stdenv.hostPlatform.libc == "musl") '' + substituteInPlace liveMedia/include/Locale.hh \ + --replace '<xlocale.h>' '<locale.h>' + ''; + + configurePhase = let + platform = if stdenv.isLinux + then "linux" + else if stdenv.isDarwin + then "macosx-catalina" + else throw "Unsupported platform: ${stdenv.hostPlatform.system}"; + in '' + runHook preConfigure + + ./genMakefiles ${platform} + + runHook postConfigure + ''; + + makeFlags = [ + "PREFIX=${placeholder "out"}" + ]; + + enableParallelBuilding = true; + + passthru.tests = { + # Downstream dependency + inherit vlc; + }; + + meta = { + homepage = "http://www.live555.com/liveMedia/"; + 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; + }; +}) diff --git a/pkgs/development/libraries/live555/default.nix b/pkgs/development/libraries/live555/default.nix deleted file mode 100644 index 369e9ff825f7f..0000000000000 --- a/pkgs/development/libraries/live555/default.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ lib -, stdenv -, fetchurl -, darwin -, openssl - -# major and only downstream dependency -, vlc -}: - -stdenv.mkDerivation rec { - pname = "live555"; - version = "2023.05.10"; - - src = fetchurl { - urls = [ - "http://www.live555.com/liveMedia/public/live.${version}.tar.gz" - "https://download.videolan.org/contrib/live555/live.${version}.tar.gz" - "mirror://sourceforge/slackbuildsdirectlinks/live.${version}.tar.gz" - ]; - sha256 = "sha256-6ph9x4UYELkkJVIE9r25ycc5NOYbPcgAy9LRZebvGFY="; - }; - - nativeBuildInputs = lib.optional stdenv.isDarwin darwin.cctools; - - buildInputs = [ openssl ]; - - postPatch = '' - substituteInPlace config.macosx-catalina \ - --replace '/usr/lib/libssl.46.dylib' "${lib.getLib openssl}/lib/libssl.dylib" \ - --replace '/usr/lib/libcrypto.44.dylib' "${lib.getLib openssl}/lib/libcrypto.dylib" - sed -i -e 's|/bin/rm|rm|g' genMakefiles - sed -i \ - -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \ - config.linux - '' # condition from icu/base.nix - + lib.optionalString (stdenv.hostPlatform.libc == "glibc" || stdenv.hostPlatform.libc == "musl") '' - substituteInPlace liveMedia/include/Locale.hh \ - --replace '<xlocale.h>' '<locale.h>' - ''; - - configurePhase = '' - runHook preConfigure - - ./genMakefiles ${ - if stdenv.isLinux then - "linux" - else if stdenv.isDarwin then - "macosx-catalina" - else - throw "Unsupported platform ${stdenv.hostPlatform.system}"} - - runHook postConfigure - ''; - - makeFlags = [ - "DESTDIR=${placeholder "out"}" - "PREFIX=" - ]; - - enableParallelBuilding = true; - - passthru.tests = { - inherit vlc; - }; - - meta = with lib; { - homepage = "http://www.live555.com/liveMedia/"; - 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 = licenses.lgpl21Plus; - maintainers = with maintainers; [ AndersonTorres ]; - platforms = platforms.unix; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d32261e4b6994..f5f1abc1c5c13 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23825,8 +23825,6 @@ with pkgs; litehtml = callPackage ../development/libraries/litehtml { }; - live555 = callPackage ../development/libraries/live555 { }; - llhttp = callPackage ../development/libraries/llhttp { }; log4cpp = callPackage ../development/libraries/log4cpp { }; |