<commit_before>{ config, stdenv, fetchFromGitHub
, fetchpatch, pkgconfig, perl, python, which
, libX11, libxcb, libGLU, libGL
, qtbase, qtdeclarative, qtquickcontrols, qttools, qtx11extras, qmake, makeWrapper
, libchardet
, ffmpeg

, mpg123
, libass
, libdvdread
, libdvdnav
, icu
, libquvi
, alsaLib
, libvdpau, libva
, libbluray
, jackSupport ? false, jack ? null
, portaudioSupport ? false, portaudio ? null
, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
, cddaSupport ? false, libcdda ? null
, youtubeSupport ? true, youtube-dl ? null
}:

with stdenv.lib;

assert jackSupport -> jack != null;
assert portaudioSupport -> portaudio != null;
assert pulseSupport -> libpulseaudio != null;
assert cddaSupport -> libcdda != null;
assert youtubeSupport -> youtube-dl != null;

stdenv.mkDerivation rec {
  pname = "bomi";
  version = "0.9.11";

  src = fetchFromGitHub {
    owner = "xylosper";
    repo = "bomi";
    rev = "v${version}";
    sha256 = "0a7n46gn3n5098lxxvl3s29s8jlkzss6by9074jx94ncn9cayf2h";
  };

  patches = [
    (fetchpatch rec {
      name = "bomi-compilation-fix.patch";
      url = "https://svnweb.mageia.org/packages/cauldron/bomi/current/SOURCES/${name}?revision=995725&view=co&pathrev=995725";
      sha256 = "1dwryya5ljx35dbx6ag9d3rjjazni2mfn3vwirjdijdy6yz22jm6";
    })
    (fetchpatch rec {
      name = "bomi-fix-expected-unqualified-id-before-numeric-constant-unix.patch";
      url = "https://svnweb.mageia.org/packages/cauldron/bomi/current/SOURCES/${name}?revision=995725&view=co&pathrev=995725";
      sha256 = "0n3xsrdrggimzw30gxlnrr088ndbdjqlqr46dzmfv8zan79lv5ri";
    })
  ];

  buildInputs = with stdenv.lib;
                [ libX11
                  libxcb
                  libGLU libGL
                  qtbase
                  qtx11extras
                  qtdeclarative
                  qtquickcontrols
                  ffmpeg
                  libchardet

                  mpg123
                  libass
                  libdvdread
                  libdvdnav
                  icu
                  libquvi
                  alsaLib
                  libvdpau
                  libva
                  libbluray
                ]
                ++ optional jackSupport jack
                ++ optional portaudioSupport portaudio
                ++ optional pulseSupport libpulseaudio
                ++ optional cddaSupport libcdda
                ;

  preConfigure = ''
    patchShebangs configure
  '';

  preBuild = ''
    patchShebangs src/mpv/waf
    patchShebangs build-mpv
  '';

  postInstall = ''
    wrapProgram $out/bin/bomi \
      ${optionalString youtubeSupport "--prefix PATH ':' '${youtube-dl}/bin'"}
  '';

  dontUseQmakeConfigure = true;

  configureFlags = with stdenv.lib;
                   [ "--qmake=qmake" ]
                   ++ optional jackSupport "--enable-jack"
                   ++ optional portaudioSupport "--enable-portaudio"
                   ++ optional pulseSupport "--enable-pulseaudio"
                   ++ optional cddaSupport "--enable-cdda"
                   ;

  nativeBuildInputs = [ makeWrapper pkgconfig perl python which qttools qmake ];

  meta = with stdenv.lib; {
    description = "Powerful and easy-to-use multimedia player";
    homepage = "https://bomi-player.github.io/";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.abbradar ];
    platforms = platforms.linux;
  };
}
<commit_msg>bomi: use qt5's mkDerivation<commit_after>{ mkDerivation, config, stdenv, fetchFromGitHub
, fetchpatch, pkgconfig, perl, python, which
, libX11, libxcb, libGLU, libGL
, qtbase, qtdeclarative, qtquickcontrols, qttools, qtx11extras, qmake
, libchardet
, ffmpeg

, mpg123
, libass
, libdvdread
, libdvdnav
, icu
, libquvi
, alsaLib
, libvdpau, libva
, libbluray
, jackSupport ? false, jack ? null
, portaudioSupport ? false, portaudio ? null
, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio ? null
, cddaSupport ? false, libcdda ? null
, youtubeSupport ? true, youtube-dl ? null
}:

with stdenv.lib;

assert jackSupport -> jack != null;
assert portaudioSupport -> portaudio != null;
assert pulseSupport -> libpulseaudio != null;
assert cddaSupport -> libcdda != null;
assert youtubeSupport -> youtube-dl != null;

mkDerivation rec {
  pname = "bomi";
  version = "0.9.11";

  src = fetchFromGitHub {
    owner = "xylosper";
    repo = "bomi";
    rev = "v${version}";
    sha256 = "0a7n46gn3n5098lxxvl3s29s8jlkzss6by9074jx94ncn9cayf2h";
  };

  patches = [
    (fetchpatch rec {
      name = "bomi-compilation-fix.patch";
      url = "https://svnweb.mageia.org/packages/cauldron/bomi/current/SOURCES/${name}?revision=995725&view=co&pathrev=995725";
      sha256 = "1dwryya5ljx35dbx6ag9d3rjjazni2mfn3vwirjdijdy6yz22jm6";
    })
    (fetchpatch rec {
      name = "bomi-fix-expected-unqualified-id-before-numeric-constant-unix.patch";
      url = "https://svnweb.mageia.org/packages/cauldron/bomi/current/SOURCES/${name}?revision=995725&view=co&pathrev=995725";
      sha256 = "0n3xsrdrggimzw30gxlnrr088ndbdjqlqr46dzmfv8zan79lv5ri";
    })
  ];

  buildInputs = with stdenv.lib;
                [ libX11
                  libxcb
                  libGLU libGL
                  qtbase
                  qtx11extras
                  qtdeclarative
                  qtquickcontrols
                  ffmpeg
                  libchardet

                  mpg123
                  libass
                  libdvdread
                  libdvdnav
                  icu
                  libquvi
                  alsaLib
                  libvdpau
                  libva
                  libbluray
                ]
                ++ optional jackSupport jack
                ++ optional portaudioSupport portaudio
                ++ optional pulseSupport libpulseaudio
                ++ optional cddaSupport libcdda
                ;

  preConfigure = ''
    patchShebangs configure
  '';

  preBuild = ''
    patchShebangs src/mpv/waf
    patchShebangs build-mpv
  '';

  dontWrapQtApps = true;
  postInstall = ''
    wrapQtApp $out/bin/bomi \
      ${optionalString youtubeSupport "--prefix PATH ':' '${youtube-dl}/bin'"}
  '';

  dontUseQmakeConfigure = true;

  configureFlags = with stdenv.lib;
                   [ "--qmake=qmake" ]
                   ++ optional jackSupport "--enable-jack"
                   ++ optional portaudioSupport "--enable-portaudio"
                   ++ optional pulseSupport "--enable-pulseaudio"
                   ++ optional cddaSupport "--enable-cdda"
                   ;

  nativeBuildInputs = [ pkgconfig perl python which qttools qmake ];

  meta = with stdenv.lib; {
    description = "Powerful and easy-to-use multimedia player";
    homepage = "https://bomi-player.github.io/";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.abbradar ];
    platforms = platforms.linux;
  };
}

{'fraction_non_alphanumeric': 0.10081230055120395, 'fraction_numerical': 0.029155787641427327, 'mean_word_length': 2.11849841700588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2480221', 'n_tokens_mistral': 2440, 'n_tokens_neox': 2185, 'n_words': 410}