<commit_before>class Qjackctl < Formula
  desc "simple Qt application to control the JACK sound server daemon"
  homepage "http://qjackctl.sourceforge.net"
  url "https://downloads.sourceforge.net/qjackctl/qjackctl-0.4.1.tar.gz"
  sha256 "98024e1ea9f55ac16c290feda051d6494b2261e83f6a918f0fa583b509e2bfd1"
  head "http://git.code.sf.net/p/qjackctl/code", :using=>:git

  stable do
    # fixes compile error with getDeviceUIDFromID and combo box device selection is general
    # also fixes linking without X11
    #
    # patch is composed of
    # https://sourceforge.net/p/qjackctl/code/ce7bbc6814da9be44b9320fbe20dd524516d525f
    # https://sourceforge.net/p/qjackctl/code/ci/1983c9c4ce3ef663e29e8d07addee1d6856664fd
    # https://sourceforge.net/p/qjackctl/code/ci/979f0a5afef3107288b17a508966ca5f27ce7069
    patch :DATA
  end
  bottle do
    sha256 "5eb11af861de629ba8afba7d75c71b02029817a69d2a6a2db15f13fb3bea9594" => :el_capitan
    sha256 "5cf871c347c52298c161c83443f12a825cd18ce8037286dcc9cd552ab3857e9e" => :yosemite
    sha256 "671c6d52aa37729c4471390673310fa90c68139dae697f1630552b3b2511d690" => :mavericks
  end


  depends_on "autoconf" => :build
  depends_on "qt"
  depends_on "jack"

  def install
    system "./autogen.sh"
    system "./configure", "--disable-debug",
                          "--enable-qt4",
                          "--disable-dbus",
                          "--disable-xunique",
                          "--prefix=#{prefix}"

    system "make", "install"
    mv "#{bin}/qjackctl.app", prefix
    bin.install_symlink "#{prefix}/qjackctl.app/Contents/MacOS/qjackctl"
  end

  test do
    assert_match /QjackCtl: \d+\.\b+/, shell_output("qjackctl --version 2>&1", 1)
  end
end

__END__
From ce7bbc6814da9be44b9320fbe20dd524516d525f Mon Sep 17 00:00:00 2001
From: David <<EMAIL>>
Date: Sun, 22 Nov 2015 09:08:04 +0100
Subject: [PATCH] Fix compile without X11

https://sourceforge.net/p/qjackctl/code/ce7bbc6814da9be44b9320fbe20dd524516d525f

When compiling without X11 (--disable-xunique) linking against X11 is not required
and would lead to an error.<commit_msg>qjackctl: general cleanup.<commit_after>class Qjackctl < Formula
  desc "simple Qt application to control the JACK sound server daemon"
  homepage "http://qjackctl.sourceforge.net"
  url "https://downloads.sourceforge.net/qjackctl/qjackctl-0.4.1.tar.gz"
  sha256 "98024e1ea9f55ac16c290feda051d6494b2261e83f6a918f0fa583b509e2bfd1"
  head "http://git.code.sf.net/p/qjackctl/code", :using=>:git

  stable do
    # fixes compile error with getDeviceUIDFromID and combo box device selection is general
    # also fixes linking without X11
    #
    # patch is composed of
    # https://sourceforge.net/p/qjackctl/code/ci/ce7bbc6814da9be44b9320fbe20dd524516d525f
    # https://sourceforge.net/p/qjackctl/code/ci/1983c9c4ce3ef663e29e8d07addee1d6856664fd
    # https://sourceforge.net/p/qjackctl/code/ci/979f0a5afef3107288b17a508966ca5f27ce7069
    patch :DATA
  end

  bottle do
    sha256 "5eb11af861de629ba8afba7d75c71b02029817a69d2a6a2db15f13fb3bea9594" => :el_capitan
    sha256 "5cf871c347c52298c161c83443f12a825cd18ce8037286dcc9cd552ab3857e9e" => :yosemite
    sha256 "671c6d52aa37729c4471390673310fa90c68139dae697f1630552b3b2511d690" => :mavericks
  end

  depends_on "autoconf" => :build
  depends_on "qt"
  depends_on "jack"

  def install
    system "./autogen.sh"
    system "./configure", "--disable-debug",
                          "--enable-qt4",
                          "--disable-dbus",
                          "--disable-xunique",
                          "--prefix=#{prefix}"

    system "make", "install"
    prefix.install "#{bin}/qjackctl.app"
    bin.install_symlink "#{prefix}/qjackctl.app/Contents/MacOS/qjackctl"
  end

  test do
    assert_match /QjackCtl: \d+\.\b+/, shell_output("qjackctl --version 2>&1", 1)
  end
end

__END__
From ce7bbc6814da9be44b9320fbe20dd524516d525f Mon Sep 17 00:00:00 2001
From: David <<EMAIL>>
Date: Sun, 22 Nov 2015 09:08:04 +0100
Subject: [PATCH] Fix compile without X11

https://sourceforge.net/p/qjackctl/code/ce7bbc6814da9be44b9320fbe20dd524516d525f

When compiling without X11 (--disable-xunique) linking against X11 is not required
and would lead to an error.
{'fraction_non_alphanumeric': 0.10355450236966825, 'fraction_numerical': 0.16255924170616115, 'mean_word_length': 3.5632432432432433, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 19, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, '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': '6481946', 'n_tokens_mistral': 2015, 'n_tokens_neox': 1631, 'n_words': 288}