104 lines
3.2 KiB
Ruby
104 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"
|
|
revision 1
|
|
|
|
livecheck do
|
|
url "https://qmmp.ylsoftware.com/downloads.php"
|
|
regex(/href=.*?qmmp[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_monterey: "81fbc2241b5b4f010e2c600fa0d465d6bc28785323d8471d674d069a0ae79a31"
|
|
sha256 arm64_big_sur: "8979c84ed7c012235381b88dc345d978d668b80bab599090bbefac6e6344af4c"
|
|
sha256 monterey: "39b406c75bf3c5bc5cfa8e10af0149759065e85a6cf29d28438c94a7c8edf086"
|
|
sha256 big_sur: "213123bee4299bd23b747b5b7fe31abb12079a0bf9012c45a0845321a2bb7a6e"
|
|
sha256 catalina: "e883bad2b5cf516a19c2690df1b3deede580b45a06dc3cf9b2036a88ecbfeea6"
|
|
sha256 x86_64_linux: "d94e3a8571cde4d14506cd1a659885a02aeee4ec95d6d62ba7613d3c1e2a52e0"
|
|
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
|
|
|
|
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
|