anchor.diff:      runHook preConfigure
   
       ./genMakefiles ${{
  -      x86_64-darwin = "macosx";
  +      x86_64-darwin = "macosx-catalina";
         i686-linux = "linux";
         x86_64-linux = "linux-64bit";
         aarch64-linux = "linux-64bit";
  
positive.code: 
    nativeBuildInputs = lib.optional stdenv.isDarwin darwin.cctools;
  
    enableParallelBuilding = true;
  
    meta = with lib; {
  
negative.code: { stdenv, fetchurl, lib, darwin, openssl }:
  
  # Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD
  stdenv.mkDerivation rec {
    pname = "live555";
    version = "2022.01.21";
  
    src = fetchurl { # the upstream doesn't provide a stable URL
      urls = [
        "mirror://sourceforge/slackbuildsdirectlinks/live.${version}.tar.gz"
        "https://download.videolan.org/contrib/live555/live.${version}.tar.gz"
      ];
      sha256 = "03m9wgw06vs93nbd55yq8qjpm92mcg9j7cih8j6blfnv8b0pj9bn";
    };
  
    postPatch = ''
      sed 's,/bin/rm,rm,g' -i genMakefiles
      substituteInPlace config.macosx-catalina \
        --replace '/usr/lib/libssl.46.dylib' "${openssl.out}/lib/libssl.dylib" \
        --replace '/usr/lib/libcrypto.44.dylib' "${openssl.out}/lib/libcrypto.dylib"
      sed \
        -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \
        -i config.linux
  