class Dssp < Formula # cite Touw_2015: "https://doi.org/10.1093/nar/gku1028" # cite Kabsch_1983: "https://doi.org/10.1002/bip.360221211" desc "Assign secondary structure to proteins" homepage "https://github.com/PDB-REDO/dssp" url "https://github.com/PDB-REDO/dssp/archive/refs/tags/v4.4.7.tar.gz" sha256 "d9d4b17143cc8b58080b28c4694eb11b6e167f9ad7c2dfd238b9436500c2de8c" license "BSD-2-Clause" head "https://github.com/PDB-REDO/dssp.git", branch: "trunk" bottle do root_url "https://ghcr.io/v2/brewsci/bio" sha256 arm64_sonoma: "c8b22661372d17a29241ba3c6cd14793eade94d42b940c3ce4db97c3eec071cb" sha256 ventura: "84d3b1fd92b42454cbf91ccedd6cd973a39fdd7649d45199e52b12821346fffc" sha256 x86_64_linux: "279d70ec0350bbdecae078002fc85ced284a63a2b9a9a10d6c81106044a29168" end depends_on "cmake" => :build depends_on "eigen" => :build depends_on "boost" depends_on "icu4c" uses_from_macos "bzip2" uses_from_macos "zlib" resource "libcifpp" do url "https://github.com/PDB-REDO/libcifpp/archive/refs/tags/v7.0.4.tar.gz" sha256 "324eda2f6874df32671cd984c7249bfae025ca3fe1bfd875cbef35b046408b88" end resource "libmcfp" do url "https://github.com/mhekkel/libmcfp/archive/refs/tags/v1.3.3.tar.gz" sha256 "d35e83e660c3cb443d20246fea39e78d2a11faebe3205ab838614f0280c308d0" end resource "testdata" do url "https://github.com/PDB-REDO/dssp/raw/fa880e3d88f842703f680185fffc4de540284b25/test/1cbs.cif.gz" sha256 "c6a2e4716f843bd608c06cfa4b6a369a56a6021ae16e5f876237b8a73d0dcb5e" end def install resource("libcifpp").stage do # libcifpp should be installed in 'prefix' directory since the path of dic files are always required. system "cmake", "-S", ".", "-B", "build", *std_cmake_args(install_prefix: prefix/"libcifpp") system "cmake", "--build", "build" system "cmake", "--install", "build" end resource("libmcfp").stage do # libcifpp should be installed in 'prefix' directory since the path of dic files are always required. system "cmake", "-S", ".", "-B", "build", *std_cmake_args(install_prefix: prefix/"libmcfp") system "cmake", "--build", "build" system "cmake", "--install", "build" end system "cmake", "-S", ".", "-B", "build", "-Dcifpp_DIR=#{prefix/"libcifpp/lib/cmake/cifpp"}", "-Dlibmcfp_DIR=#{prefix/"libmcfp/lib/cmake/libmcfp"}", "-DCMAKE_BUILD_TYPE=Release", *std_cmake_args system "cmake", "--build", "build" system "cmake", "--install", "build" end test do resource("testdata").unpack testpath cp Dir[pkgshare/"*.dic"], testpath system bin/"mkdssp", "1cbs.cif", "test.dssp" assert_match "CELLULAR RETINOIC ACID BINDING PROTEIN TYPE II", (testpath/"test.dssp").read end end