diff options
author | Anderson Torres <torres.anderson.85@protonmail.com> | 2024-01-14 12:59:32 -0300 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2024-01-23 22:53:58 -0300 |
commit | 11e9dd4d26fd4ae723e02e018e79d5b94b33ba27 (patch) | |
tree | f0675b99dde193ad262bed6207f0fda357a48724 /pkgs/by-name/li | |
parent | 8a05729f0b84488239da0deeb8a3759f74e20e37 (diff) | |
download | nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.tar nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.tar.gz nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.tar.bz2 nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.tar.lz nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.tar.xz nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.tar.zst nixlib-11e9dd4d26fd4ae723e02e018e79d5b94b33ba27.zip |
live555: refactor
- finalAttrs design pattern - new download stream - strictDeps - get rid of nested with
Diffstat (limited to 'pkgs/by-name/li')
-rw-r--r-- | pkgs/by-name/li/live555/package.nix | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/pkgs/by-name/li/live555/package.nix b/pkgs/by-name/li/live555/package.nix index 369e9ff825f7..7ce51b21d62e 100644 --- a/pkgs/by-name/li/live555/package.nix +++ b/pkgs/by-name/li/live555/package.nix @@ -1,29 +1,34 @@ { lib -, stdenv -, fetchurl , darwin +, fetchurl , openssl - -# major and only downstream dependency +, stdenv , vlc }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { 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" + "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" ]; - sha256 = "sha256-6ph9x4UYELkkJVIE9r25ycc5NOYbPcgAy9LRZebvGFY="; + hash = "sha256-6ph9x4UYELkkJVIE9r25ycc5NOYbPcgAy9LRZebvGFY="; }; - nativeBuildInputs = lib.optional stdenv.isDarwin darwin.cctools; + nativeBuildInputs = lib.optionals stdenv.isDarwin [ + darwin.cctools + ]; + + buildInputs = [ + openssl + ]; - buildInputs = [ openssl ]; + strictDeps = true; postPatch = '' substituteInPlace config.macosx-catalina \ @@ -33,43 +38,45 @@ stdenv.mkDerivation rec { 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") '' + '' + # 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 = '' + 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 ${ - if stdenv.isLinux then - "linux" - else if stdenv.isDarwin then - "macosx-catalina" - else - throw "Unsupported platform ${stdenv.hostPlatform.system}"} + ./genMakefiles ${platform} runHook postConfigure ''; makeFlags = [ - "DESTDIR=${placeholder "out"}" - "PREFIX=" + "PREFIX=${placeholder "out"}" ]; enableParallelBuilding = true; passthru.tests = { + # Downstream dependency inherit vlc; }; - meta = with lib; { + 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 = licenses.lgpl21Plus; - maintainers = with maintainers; [ AndersonTorres ]; - platforms = platforms.unix; + license = with lib.licenses; [ lgpl21Plus ]; + maintainers = with lib.maintainers; [ AndersonTorres ]; + platforms = lib.platforms.unix; }; -} +}) |