homebrew-core/Formula/qmmp.rb

105 lines
3.4 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.2.tar.bz2"
sha256 "53ce8ba00920ea604555afdc801f24a426b92b07644743cc426006bdffca017a"
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_ventura: "b3481723b568f28338bab140ea7a0d90a25d8a4bc2ad057145459a6b960af48f"
sha256 arm64_monterey: "6372738827571b4b74600eb297afba37ba8fe85e8e3f461b3daa4dba499bbdba"
sha256 arm64_big_sur: "51baec5b0e6266fdb000624a163adadb85ab2de2c38de157b251e30c80b94cec"
sha256 ventura: "e1fff6b8aad6c637408312c75faf724596ecdfb8799304cdd3c9322e50d788b3"
sha256 monterey: "f8efdbaafb771e7ef17c430e80f56baf161439842ded2212e5c691049c649d86"
sha256 big_sur: "3a10022920b829204dd6c95683e7e5ed591241bf32199dba74fc2d7b8a7310dc"
sha256 catalina: "26cfc6ce80cdf54067d9f166e9512904284e143cada1dc10cae94b8b938ca953"
sha256 x86_64_linux: "d0aef96423a3a1ef7f9c08db5a5f33b65dbabd7f6dbfcff518bee8858e8cf951"
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