From 9f5dfce45c7fc50cd910127a95bfcba4344160f1 Mon Sep 17 00:00:00 2001 From: Yoshitaka Moriwaki Date: Fri, 23 Aug 2024 20:08:18 +0900 Subject: [PATCH] kmc 3.2.4 (#1839) --- Formula/kmc.rb | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Formula/kmc.rb b/Formula/kmc.rb index a27fc1724..36753bb83 100644 --- a/Formula/kmc.rb +++ b/Formula/kmc.rb @@ -2,9 +2,10 @@ class Kmc < Formula # cite Deorowicz_2015: "https://doi.org/10.1093/bioinformatics/btv022" desc "Fast and frugal disk based k-mer counter" homepage "https://github.com/refresh-bio/KMC" - url "https://github.com/refresh-bio/KMC/archive/refs/tags/v3.2.1.tar.gz" - sha256 "7db333091a754508163a097c41720cf32a80abe160bef60f3fc82c8da1d67896" - head "https://github.com/marekkokot/KMC.git" + url "https://github.com/marekkokot/KMC.git", + tag: "v3.2.4", + revision: "d6c24dc88010508336d824bbffbf1ef3f49fddf8" + head "https://github.com/marekkokot/KMC.git", branch: "master" bottle do root_url "https://ghcr.io/v2/brewsci/bio" @@ -12,15 +13,25 @@ class Kmc < Formula sha256 cellar: :any_skip_relocation, x86_64_linux: "cb51b8cbbedfba92900e56910d4b8ecd6754891dcdc1a7a0d47d6335ace73076" end + depends_on "pybind11" => :build depends_on "gcc" - uses_from_macos "bzip2" uses_from_macos "zlib" - # Fix error: 'ext/algorithm' file not found - fails_with :clang + fails_with gcc: "11" def install - args = %W[CC=#{ENV.cxx} KMC_BIN_DIR=#{bin}] + if OS.mac? + inreplace "Makefile" do |s| + s.gsub! "-fsigned-char", "-fsigned-char -Wno-deprecated-declarations" + s.gsub! "-static-libgcc -static-libstdc++", "-static-libgcc -static-libstdc++ -stdlib=libstdc++ -lstdc++" + end + else + # On Linux, we need to link against libstdc++ + inreplace "Makefile", "-static -Wl,", "-lstdc++ -Wl," + end + gcc_major_ver = Formula["gcc"].any_installed_version.major + cc = Formula["gcc"].opt_bin/"gcc-#{gcc_major_ver}" + args = %W[CC=#{cc} KMC_BIN_DIR=#{bin}] system "make", *args, "kmc", "kmc_dump", "kmc_tools" bin.install Dir["bin/kmc*"] doc.install Dir["*.pdf"]