<commit_before>{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wineUnstable, makeWrapper, libXau
, bash, patchelf, config }:

let
  topath = "${wineUnstable}/bin";

  toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") 
    [ stdenv.cc.cc libX11 libXtst libXext libXdamage libXfixes wineUnstable ]);
in
stdenv.mkDerivation {
  name = "teamviewer-10.0.37742";
  src = fetchurl {
    url = config.teamviewer10.url or "http://download.teamviewer.com/download/teamviewer_amd64.deb";
    sha256 = config.teamviewer10.sha256 or "0n2lzphvsqnlvm7pd7hjlislqj9rr57lai8jyw4wpqcy9j2xwxd2";
  };

  buildInputs = [ makeWrapper patchelf ];

  unpackPhase = ''
    ar x $src
    tar xf data.tar.gz
  '';

  installPhase = ''
    mkdir -p $out/share/teamviewer $out/bin
    cp -a opt/teamviewer/* $out/share/teamviewer
    rm -R $out/share/teamviewer/tv_bin/wine/{bin,lib,share}

    cat > $out/bin/teamviewer << EOF
    #!${bash}/bin/sh
    export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
    export PATH=${topath}\''${PATH:+:\$PATH}
    $out/share/teamviewer/tv_bin/script/teamviewer "\$@"
    EOF
    chmod +x $out/bin/teamviewer

    patchelf --set-rpath "${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib:${libX11}/lib:${libXext}/lib:${libXau}/lib:${libXdamage}/lib:${libXfixes}/lib" $out/share/teamviewer/tv_bin/teamviewerd
    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/teamviewer/tv_bin/teamviewerd
    ln -s $out/share/teamviewer/tv_bin/teamviewerd $out/bin/
  '';

  meta = {
    homepage = "http://www.teamviewer.com";
    license = stdenv.lib.licenses.unfree;
    description = "Desktop sharing application, providing remote support and online meetings";
  };
}
<commit_msg>teamviewer: add option to accept license<commit_after>{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes,
wineUnstable, makeWrapper, libXau , bash, patchelf, config,
acceptLicense ? false }:

with stdenv.lib;

let
  topath = "${wineUnstable}/bin";

  toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") 
    [ stdenv.cc.cc libX11 libXtst libXext libXdamage libXfixes wineUnstable ]);
in
stdenv.mkDerivation {
  name = "teamviewer-10.0.37742";
  src = fetchurl {
    url = config.teamviewer10.url or "http://download.teamviewer.com/download/teamviewer_amd64.deb";
    sha256 = config.teamviewer10.sha256 or "0n2lzphvsqnlvm7pd7hjlislqj9rr57lai8jyw4wpqcy9j2xwxd2";
  };

  buildInputs = [ makeWrapper patchelf ];

  unpackPhase = ''
    ar x $src
    tar xf data.tar.gz
  '';

  installPhase = ''
    mkdir -p $out/share/teamviewer $out/bin
    cp -a opt/teamviewer/* $out/share/teamviewer
    rm -R $out/share/teamviewer/tv_bin/wine/{bin,lib,share}

    cat > $out/bin/teamviewer << EOF
    #!${bash}/bin/sh
    export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
    export PATH=${topath}\''${PATH:+:\$PATH}
    $out/share/teamviewer/tv_bin/script/teamviewer "\$@"
    EOF
    chmod +x $out/bin/teamviewer

    patchelf --set-rpath "${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib:${libX11}/lib:${libXext}/lib:${libXau}/lib:${libXdamage}/lib:${libXfixes}/lib" $out/share/teamviewer/tv_bin/teamviewerd
    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/teamviewer/tv_bin/teamviewerd
    ln -s $out/share/teamviewer/tv_bin/teamviewerd $out/bin/
    ${optionalString acceptLicense "
      cat > $out/share/teamviewer/config/global.conf << EOF
      [int32] EulaAccepted = 1
      [int32] EulaAcceptedRevision = 6
      EOF
    "}
  '';

  meta = {
    homepage = "http://www.teamviewer.com";
    license = licenses.unfree;
    description = "Desktop sharing application, providing remote support and online meetings";
    maintainers = with maintainers; [ jagajaga ];
  };
}

{'fraction_non_alphanumeric': 0.15465268676277852, 'fraction_numerical': 0.022542595019659238, 'mean_word_length': 3.8735632183908044, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, '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': '822416', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1491, 'n_words': 237}