Skip to content

Commit

Permalink
cfitsio was a dependency of wcslib all along
Browse files Browse the repository at this point in the history
  • Loading branch information
d3v-null committed Jan 29, 2025
1 parent 9ecbffc commit e149188
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 32 deletions.
43 changes: 12 additions & 31 deletions .github/workflows/bottle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ jobs:
- name: test-bot
run: |
brew tap mwatelescope/tap
# TODO: casacore aoflagger birli
for package in cfitsio_reentrant casacore-data; do
for package in cfitsio_reentrant casacore-data casacore aoflagger birli; do
brew test-bot mwatelescope/tap/$package
done
- name: audit
run: |
for package in cfitsio_reentrant casacore-data casacore aoflagger birli; do
for package in cfitsio_reentrant wcslib casacore-data casacore aoflagger birli; do
brew audit mwatelescope/tap/$package
done
Expand All @@ -54,7 +53,7 @@ jobs:
run: |
# build casacore source first
brew uninstall --ignore-dependencies --force cfitsio || true
for package in cfitsio_reentrant casacore-data casacore aoflagger birli; do
for package in cfitsio_reentrant wcslib casacore-data casacore aoflagger birli; do
brew uninstall --ignore-dependencies --force $package || true
brew install --formula --build-bottle mwatelescope/tap/$package
brew postinstall mwatelescope/tap/$package
Expand Down Expand Up @@ -95,33 +94,15 @@ jobs:
asset_name: ${{ env.birli_path }}
asset_content_type: application/gzip

# todo:
# - run: brew test-bot --only-formulae Formula/cfitsio_reentrant.rb Formula/casacore-data.rb
# Error: Unexpected bottle tarball: /Users/runner/work/homebrew-tap/homebrew-tap/cfitsio_reentrant--4.5.0_1.arm64_sonoma.bottle.1.tar.gz
# Error: Unexpected bottle JSON: /Users/runner/work/homebrew-tap/homebrew-tap/cfitsio_reentrant--4.5.0_1.arm64_sonoma.bottle.json
#
# - run: brew test-bot --only-formulae Formula/casacore.rb
# Error: Failed to load cask: Formula/casacore-data.rb
# Cask 'casacore-data' is unreadable: wrong constant name #<Class:0x00000001399f8c08>
# Error: Failed to load cask: Formula/casacore.rb
# Cask 'casacore' is unreadable: wrong constant name #<Class:0x0000000139ab83f0>
# Warning: Treating Formula/casacore.rb as a formula.
# Error: The `brew link` step did not complete successfully
# The formula built, but is not symlinked into /opt/homebrew
# Could not symlink include/fitsio.h
# Target /opt/homebrew/include/fitsio.h
# is a symlink belonging to cfitsio_reentrant. You can unlink it:
# brew unlink cfitsio_reentrant
# To force the link and overwrite all conflicting files:
# brew link --overwrite cfitsio
# To list all files that would be deleted:
# brew link --overwrite cfitsio --dry-run
# Possible conflicting files are:
# /opt/homebrew/include/fitsio.h -> /opt/homebrew/Cellar/cfitsio_reentrant/4.5.0_1/include/fitsio.h
# /opt/homebrew/include/fitsio2.h -> /opt/homebrew/Cellar/cfitsio_reentrant/4.5.0_1/include/fitsio2.h
# /opt/homebrew/include/longnam.h -> /opt/homebrew/Cellar/cfitsio_reentrant/4.5.0_1/include/longnam.h


# TODO:
# - run: brew test-bot mwatelescope/tap/wcslib
# ==> brew linkage --test mwatelescope/tap/wcslib
# ==> FAILED
# Full linkage --test mwatelescope/tap/wcslib output
# Broken dependencies:
# /opt/homebrew/opt/cfitsio/lib/libcfitsio.10.dylib (cfitsio)
# Truncated linkage --test mwatelescope/tap/wcslib output
# Error: /opt/homebrew/opt/cfitsio/lib/libcfitsio.10.dylib (cfitsio)

# TODO:
# - run: brew test-bot --only-tap-syntax
Expand Down
2 changes: 1 addition & 1 deletion Formula/casacore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class Casacore < Formula
depends_on "hdf5"
depends_on "mwatelescope/tap/casacore-data"
depends_on "mwatelescope/tap/cfitsio_reentrant"
depends_on "mwatelescope/tap/wcslib"
depends_on "ncurses"
depends_on "openblas"
depends_on "readline"
depends_on "wcslib"

if build.with?("python")
# if this line changes https://github.com/Homebrew/homebrew-core/blob/dc61aaab304abbb8ef863eed3313b6661846f79e/Formula/b/boost-python3.rb#L28
Expand Down
40 changes: 40 additions & 0 deletions Formula/wcslib.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# source: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/w/wcslib.rb

Check failure on line 1 in Formula/wcslib.rb

View workflow job for this annotation

GitHub Actions / test-bot (macOS-latest)

`brew linkage --test mwatelescope/tap/wcslib` failed on macOS Sonoma (14) on Apple Silicon!

/opt/homebrew/opt/cfitsio/lib/libcfitsio.10.dylib (cfitsio)
class Wcslib < Formula
desc "Library and utilities for the FITS World Coordinate System"
homepage "https://www.atnf.csiro.au/computing/software/wcs/"
url "https://www.atnf.csiro.au/computing/software/wcs/wcslib-8.4.tar.bz2"
sha256 "960b844426d14a8b53cdeed78258aa9288cded99a7732c0667c64fa6a50126dc"
license "GPL-3.0-or-later"

livecheck do
url :homepage
regex(/href=.*?wcslib[._-]v?(\d+(?:\.\d+)+)\.t/i)
end

bottle do
sha256 cellar: :any, arm64_sequoia: "9b4c893d06fdc0f35e6d0068cd2c0f8e310bcc21fcd80242c8096895ef6bbdc5"
sha256 cellar: :any, arm64_sonoma: "9d19f46e3c4eccaf8a8f0e47b15650a0d597fb7b1a0e41523f98c225733f79cd"
sha256 cellar: :any, arm64_ventura: "a8a2219881ba618ed874d2d8e398c6014e0acc2a8116f2786fa44354950d0050"
sha256 cellar: :any, sonoma: "1e11d5347b5aabd5a8be7b58f255b296b32a27daea37dd6f1c96d58e05a099f9"
sha256 cellar: :any, ventura: "7ad6caa1fcc73ee40853218467f7c69063672b81c9f57168c2fc3fe36a352581"
sha256 cellar: :any_skip_relocation, x86_64_linux: "5b4796b96042e9131506aaacb702c1e6cb372fddc463b0e328b5f46ea49bf342"
end

depends_on "mwatelescope/tap/cfitsio_reentrant"

def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-cfitsiolib=#{Formula["cfitsio"].opt_lib}",
"--with-cfitsioinc=#{Formula["cfitsio"].opt_include}",
"--without-pgplot",
"--disable-fortran"
system "make", "install"
end

test do
piped = "SIMPLE =" + (" "*20) + "T / comment" + (" "*40) + "END" + (" "*2797)
pipe_output("#{bin}/fitshdr", piped, 0)
end
end

0 comments on commit e149188

Please sign in to comment.