<commit_before>{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk
, coreutils, gnugrep, which, git, python
}:

let

  buildPycharm =
  { name, version, build, src, description, license }:

  stdenv.mkDerivation rec {
    inherit name build src;
    desktopItem = makeDesktopItem {
      name = "pycharm";
      exec = "pycharm";
      comment = "Powerful Python and Django IDE";
      desktopName = "PyCharm";
      genericName = "Powerful Python and Django IDE";
      categories = "Application;Development;";
    };

    buildInputs = [ makeWrapper patchelf p7zip ];

    propagatedUserEnvPkgs = [ python ];

    patchPhase = ''
      interpreter="$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)"
      snappyPath="lib/snappy-java-1.0.5"

      7z x -o"$snappyPath" "$snappyPath.jar"
      if [ "${stdenv.system}" == "x86_64-linux" ]; then
        patchelf --set-interpreter "$interpreter" bin/fsnotifier64
        patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
      else
        patchelf --set-interpreter "$interpreter" bin/fsnotifier
        patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
      fi
      7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
      rm -vr "$snappyPath"
    '';

    installPhase = ''
      mkdir -vp "$out/bin" "$out/$name"
      cp -va . "$out/$name"

      jdk="${jdk}/lib/openjdk"
      makeWrapper "$out/$name/bin/pycharm.sh" "$out/bin/pycharm" \
        --prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
        --prefix LD_RUN_PATH : "${stdenv.gcc.gcc}/lib/" \
        --prefix JDK_HOME : "$jdk" \
        --prefix PYCHARM_JDK : "$jdk"

      cp -a "${desktopItem}"/* "$out"
    '';

    meta = {
      homepage = "https://www.jetbrains.com/pycharm/";
      inherit description;
      inherit license;
      maintainers = [ stdenv.lib.maintainers.jgeerds ];
      platforms = stdenv.lib.platforms.linux;
    };<commit_msg>pycharm: add icon in desktop file<commit_after>{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf, p7zip, jdk
, coreutils, gnugrep, which, git, python
}:

let

  buildPycharm =
  { name, version, build, src, description, license }:

  stdenv.mkDerivation rec {
    inherit name build src;
    desktopItem = makeDesktopItem {
      name = "pycharm";
      exec = "pycharm";
      comment = "Powerful Python and Django IDE";
      desktopName = "PyCharm";
      genericName = "Powerful Python and Django IDE";
      categories = "Application;Development;";
      icon = "pycharm";
    };

    buildInputs = [ makeWrapper patchelf p7zip ];

    propagatedUserEnvPkgs = [ python ];

    patchPhase = ''
      interpreter="$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)"
      snappyPath="lib/snappy-java-1.0.5"

      7z x -o"$snappyPath" "$snappyPath.jar"
      if [ "${stdenv.system}" == "x86_64-linux" ]; then
        patchelf --set-interpreter "$interpreter" bin/fsnotifier64
        patchelf --set-rpath ${stdenv.gcc.gcc}/lib64/ "$snappyPath/org/xerial/snappy/native/Linux/amd64/libsnappyjava.so"
      else
        patchelf --set-interpreter "$interpreter" bin/fsnotifier
        patchelf --set-rpath ${stdenv.gcc.gcc}/lib/ "$snappyPath/org/xerial/snappy/native/Linux/i386/libsnappyjava.so"
      fi
      7z a -tzip "$snappyPath.jar" ./"$snappyPath"/*
      rm -vr "$snappyPath"
    '';

    installPhase = ''
      mkdir -vp "$out/bin" "$out/$name" "$out/share/pixmaps"
      cp -va . "$out/$name"
      ln -s "$out/$name/bin/pycharm.png" "$out/share/pixmaps/"

      jdk="${jdk}/lib/openjdk"
      makeWrapper "$out/$name/bin/pycharm.sh" "$out/bin/pycharm" \
        --prefix PATH : "${jdk}/bin:${coreutils}/bin:${gnugrep}/bin:${which}/bin:${git}/bin" \
        --prefix LD_RUN_PATH : "${stdenv.gcc.gcc}/lib/" \
        --prefix JDK_HOME : "$jdk" \
        --prefix PYCHARM_JDK : "$jdk"

      cp -a "${desktopItem}"/* "$out"
    '';

    meta = with stdenv.lib; {
      homepage = "https://www.jetbrains.com/pycharm/";
      inherit description;
      inherit license;
      maintainers = [ maintainers.jgeerds ];
      platforms = platforms.linux;
    };
{'fraction_non_alphanumeric': 0.1632992631328738, 'fraction_numerical': 0.009983361064891847, 'mean_word_length': 2.6687009590235395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1448056', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1493, 'n_words': 278}