class CdrtoolsAT302 < Formula desc "CD/DVD/Blu-ray premastering and recording software" homepage "https://cdrtools.sourceforge.net/private/cdrecord.html" url "https://code.simaek.com/xueye/cdrtools/archive/3.02a09.tar.gz" version "3.02a09" sha256 "8382bb445c1e87c160fdf511f0c86e6b6f7acdecf0c4ca2e619bd7e1af3836b5" license "CDDL-1.0" livecheck do # For 3.0.2a we are temporarily using the "alpha" due to a long wait for release. # This can go back to "url :stable" later url "https://downloads.sourceforge.net/project/cdrtools/alpha" regex(%r{url=.*?/cdrtools[._-]v?(\d+(?:\.\d+)+(a\d\d)?)\.t}i) end no_autobump! because: :requires_manual_review bottle do root_url "https://dl.simaek.com/homebrew-snake/bottles" sha256 monterey: "2a43d2f5d5b9d662dc3b7ac3e67b11c19a758b079e2690c6973e0e3602c69fe6" end depends_on "smake" => :build conflicts_with "dvdrtools", because: "both dvdrtools and cdrtools install binaries by the same name" patch do url "https://code.simaek.com/homebrew/homebrew-patches/raw/commit/d9cfb453af28244f4928c0071e191aa32bf08cc3/cdrtools/cdrtools-3.02a09-growisofs.patch" sha256 "30b1a8f061455d40d47e536d1855b42020c3f85be726514eca7cf1878e1e5ed2" end def install # Fix for newer clang ENV.append_to_cflags "-Wno-implicit-int" if DevelopmentTools.clang_build_version >= 1403 ENV.append_to_cflags "-Wno-implicit-function-declaration" # Speed-up the build by skipping the compilation of the profiled libraries. # This could be done by dropping each occurrence of *_p.mk from the definition # of MK_FILES in every lib*/Makefile. But it is much easier to just remove all # lib*/*_p.mk files. The latter method produces warnings but works fine. rm(Dir["lib*/*_p.mk"]) # CFLAGS is required to work around autoconf breakages as of 3.02a system "smake", "INS_BASE=#{prefix}", "INS_RBASE=#{prefix}", "CFLAGS=#{ENV.cflags}", "install" # cdrtools tries to install some generic smake headers, libraries and # manpages, which conflict with the copies installed by smake itself rm_r(include/"schily") %w[libschily.a libdeflt.a libfind.a].each do |file| (lib/file).unlink end rm_r(man5) end test do system bin/"cdrecord", "-version" system bin/"cdda2wav", "-version" date = shell_output("date") mkdir "subdir" do (testpath/"subdir/testfile.txt").write(date) system bin/"mkisofs", "-r", "-o", "../test.iso", "." end assert_path_exists testpath/"test.iso" system bin/"isoinfo", "-R", "-i", "test.iso", "-X" assert_path_exists testpath/"testfile.txt" assert_equal date, File.read("testfile.txt") end end