<commit_before>{
lib, stdenv
, makeWrapper
, makeDesktopItem
, fetchurl
, jdk11
, jdk8
}:

let
  generic = { version, sha256, platform ? "", jdk, ... }@attrs:
  let
    desktopItem = makeDesktopItem {
      categories = "Network;Development;WebDevelopment;Java;";
      desktopName = "Charles";
      exec = "charles %F";
      genericName  = "Web Debugging Proxy";
      icon = "charles-proxy";
      mimeType = "application/x-charles-savedsession;application/x-charles-savedsession+xml;application/x-charles-savedsession+json;application/har+json;application/vnd.tcpdump.pcap;application/x-charles-trace";
      name = "Charles";
      startupNotify = "true";
    };

  in stdenv.mkDerivation {
      pname = "charles";
      inherit version;

      src = fetchurl {
        url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}${platform}.tar.gz";
        inherit sha256;
      };
      nativeBuildInputs = [ makeWrapper ];

      installPhase = ''
        makeWrapper ${jdk}/bin/java $out/bin/charles \
          --add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"

        for fn in lib/*.jar; do
          install -D -m644 $fn $out/share/java/$(basename $fn)
        done

        mkdir -p $out/share/applications
        ln -s ${desktopItem}/share/applications/* $out/share/applications/

        mkdir -p $out/share/icons
        cp -r icon $out/share/icons/hicolor
      '';

      meta = with lib; {
        description = "Web Debugging Proxy";
        homepage = "https://www.charlesproxy.com/";
        maintainers = [ maintainers.kalbasit ];
        license = lib.licenses.unfree;
        platforms = lib.platforms.linux ++ lib.platforms.darwin;
      };
    };

in {
  charles4 = (generic {
    version = "4.6.1";
    sha256 = "1kl83jjj5wjhdpj34gcj04vf1asxlqlfx9zi91ln4v90swlaaclv";
    platform = "_amd64";
    jdk = jdk11;
  });
  charles3 = (generic {
    version = "3.12.3";
    sha256 = "13zk82ny1w5zd9qcs9qkq0kdb22ni5byzajyshpxdfm4zv6p32ss";
    jdk = jdk8.jre;
  });
}
<commit_msg>charles: 4.6.1 -> 4.6.2 (#129863)<commit_after>{ lib
, stdenv
, makeWrapper
, makeDesktopItem
, fetchurl
, jdk11
, jdk8
}:

let
  generic = { version, sha256, platform ? "", jdk, ... }@attrs:
  let
    desktopItem = makeDesktopItem {
      categories = "Network;Development;WebDevelopment;Java;";
      desktopName = "Charles";
      exec = "charles %F";
      genericName  = "Web Debugging Proxy";
      icon = "charles-proxy";
      mimeType = "application/x-charles-savedsession;application/x-charles-savedsession+xml;application/x-charles-savedsession+json;application/har+json;application/vnd.tcpdump.pcap;application/x-charles-trace";
      name = "Charles";
      startupNotify = "true";
    };

  in stdenv.mkDerivation {
      pname = "charles";
      inherit version;

      src = fetchurl {
        url = "https://www.charlesproxy.com/assets/release/${version}/charles-proxy-${version}${platform}.tar.gz";
        inherit sha256;
      };
      nativeBuildInputs = [ makeWrapper ];

      installPhase = ''
        makeWrapper ${jdk}/bin/java $out/bin/charles \
          --add-flags "-Xmx1024M -Dcharles.config='~/.charles.config' -jar $out/share/java/charles.jar"

        for fn in lib/*.jar; do
          install -D -m644 $fn $out/share/java/$(basename $fn)
        done

        mkdir -p $out/share/applications
        ln -s ${desktopItem}/share/applications/* $out/share/applications/

        mkdir -p $out/share/icons
        cp -r icon $out/share/icons/hicolor
      '';

      meta = with lib; {
        description = "Web Debugging Proxy";
        homepage = "https://www.charlesproxy.com/";
        maintainers = with maintainers; [ kalbasit ];
        license = licenses.unfree;
        platforms = platforms.unix;
      };
    };

in {
  charles4 = (generic {
    version = "4.6.2";
    sha256 = "0r5rann7cq665ih0pa66k52081gylk85ashrwq1khbv2jf80yy52";
    platform = "_amd64";
    jdk = jdk11;
  });
  charles3 = (generic {
    version = "3.12.3";
    sha256 = "13zk82ny1w5zd9qcs9qkq0kdb22ni5byzajyshpxdfm4zv6p32ss";
    jdk = jdk8.jre;
  });
}
{'fraction_non_alphanumeric': 0.1417892452375211, 'fraction_numerical': 0.036894140342416205, 'mean_word_length': 2.5975715524718126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '971556', 'n_tokens_mistral': 1548, 'n_tokens_neox': 1448, 'n_words': 246}