107 lines
3.2 KiB
Ruby
107 lines
3.2 KiB
Ruby
class Qmmp < Formula
|
|
desc "Qt-based Multimedia Player"
|
|
homepage "https://qmmp.ylsoftware.com/"
|
|
url "https://qmmp.ylsoftware.com/files/qmmp/2.1/qmmp-2.1.1.tar.bz2"
|
|
sha256 "d16fa33d066ec3e4993070b7dee8336df39869560a54a36d5d9659935ef0057f"
|
|
license "GPL-2.0-or-later"
|
|
|
|
livecheck do
|
|
url "https://qmmp.ylsoftware.com/downloads.php"
|
|
regex(/href=.*?qmmp[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "71a53acc1108adc9c918a979ef90d5af0800eb99d7c0293b7e967049f94125fb"
|
|
sha256 arm64_big_sur: "e60001ec427e59a06271e08259035db1f8035faede6072ecfe72fec2d93885ed"
|
|
sha256 monterey: "34bcff555cd200f2466183c88778a371b8e2336dfa34a99e946b0db97bd949d6"
|
|
sha256 big_sur: "4250889ad41fcd66a89c29b02d580b3f5c43d795784c9c184b79cecf12c6f4d1"
|
|
sha256 catalina: "b775a1c3af67e426845a72fca215bb66ea3fdfa07d5d492ec6528ce77f639a8e"
|
|
sha256 x86_64_linux: "a7e875d93455467c6ab319f96281dd7af62407830596931bc5ebb96cd6aaffdf"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
|
|
# TODO: on linux: pipewire
|
|
depends_on "faad2"
|
|
depends_on "ffmpeg"
|
|
depends_on "flac"
|
|
depends_on "game-music-emu"
|
|
depends_on "jack"
|
|
depends_on "libarchive"
|
|
depends_on "libbs2b"
|
|
depends_on "libcddb"
|
|
depends_on "libcdio"
|
|
depends_on "libmms"
|
|
depends_on "libmodplug"
|
|
depends_on "libogg"
|
|
depends_on "libsamplerate"
|
|
depends_on "libshout"
|
|
depends_on "libsndfile"
|
|
depends_on "libsoxr"
|
|
depends_on "libvorbis"
|
|
depends_on "libxcb"
|
|
depends_on "libxmp"
|
|
depends_on "mad"
|
|
depends_on "mplayer"
|
|
depends_on "opus"
|
|
depends_on "opusfile"
|
|
depends_on "projectm"
|
|
depends_on "pulseaudio"
|
|
depends_on "qt"
|
|
depends_on "taglib"
|
|
depends_on "wavpack"
|
|
depends_on "wildmidi"
|
|
|
|
uses_from_macos "curl"
|
|
|
|
on_macos do
|
|
# musepack is not bottled on Linux
|
|
# https://github.com/Homebrew/homebrew-core/pull/92041
|
|
depends_on "musepack"
|
|
end
|
|
|
|
on_linux do
|
|
depends_on "gcc"
|
|
end
|
|
|
|
fails_with gcc: "5" # ffmpeg is compiled with GCC
|
|
|
|
resource "qmmp-plugin-pack" do
|
|
url "https://qmmp.ylsoftware.com/files/qmmp-plugin-pack/2.1/qmmp-plugin-pack-2.1.0.tar.bz2"
|
|
sha256 "25692f5fc9f608d9b194697dae76d16408c98707758fb1d77ca633ba78eee917"
|
|
end
|
|
|
|
def install
|
|
cmake_args = std_cmake_args + %W[
|
|
-DCMAKE_INSTALL_RPATH=#{rpath}
|
|
-DCMAKE_STAGING_PREFIX=#{prefix}
|
|
-DUSE_SKINNED=ON
|
|
-DUSE_ENCA=ON
|
|
-DUSE_QMMP_DIALOG=ON
|
|
]
|
|
if OS.mac?
|
|
cmake_args << "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-undefined,dynamic_lookup"
|
|
cmake_args << "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-undefined,dynamic_lookup"
|
|
cmake_args << "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-undefined,dynamic_lookup"
|
|
end
|
|
|
|
system "cmake", "-S", ".", *cmake_args
|
|
system "cmake", "--build", "."
|
|
system "cmake", "--install", "."
|
|
|
|
ENV.append_path "PKG_CONFIG_PATH", lib/"pkgconfig"
|
|
resource("qmmp-plugin-pack").stage do
|
|
system "cmake", ".", *std_cmake_args, "-DCMAKE_INSTALL_RPATH=#{rpath}"
|
|
system "cmake", "--build", "."
|
|
system "cmake", "--install", "."
|
|
end
|
|
end
|
|
|
|
test do
|
|
# Set QT_QPA_PLATFORM to minimal to avoid error "qt.qpa.xcb: could not connect to display"
|
|
ENV["QT_QPA_PLATFORM"] = "minimal" unless OS.mac?
|
|
system bin/"qmmp", "--version"
|
|
end
|
|
end
|