Skip to content

bornagain 22.0 (new formula) #218251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed

Conversation

AlQuemiste
Copy link

A Homebrew formula is added to build the BornAgain GUI and its related Python wheel.

BornAgain is an open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering. BornAgain has a GUI which can interoperate with a Python interpreter. It can be also used as a Python package.

homepage: https://bornagainproject.org
source: https://jugit.fz-juelich.de/mlz/bornagain.git

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

BornAgain v22.0 needs, in particular, libheinz v2.0.1 and libformfactor v0.3.2 (latest versions of the respective libraries).

However, I could not update these libraries via brew bump-formula-pr as they are apparently automatically updated.

For instance, with brew bump-formula-pr libformfactor I get the following error message:

Error: Whoops, the libformfactor formula has its version update
pull requests automatically opened by BrewTestBot every ~3 hours!
We'd still love your contributions, though, so try another one
that's not in the autobump list:
  https://github.com/Homebrew/homebrew-core/blob/master/.github/autobump.txt

With brew audit --new bornagain, I get the following errors which I cannot resolve:

  * Dependency 'python@3' is an alias; use the canonical name 'python@3.13'.
  * Dependency 'qt@6' is an alias; use the canonical name 'qt'.
  * Files were found with references to the Homebrew shims directory.
    The offending files are:
      share/BornAgain/bornagain_build.log
  * Unexpected universal binaries were found.
    The offending files are:
       ...
  * Libraries were compiled with a flat namespace.
       ...

Reason:
* BornAgain is compatible with Python 3.x with x >= 10 (not just 3.13).
* BornAgain requires Qt6.
* The build log should be included in the distribution and is needed for bug reports.
* BornAgain needs its own Python virtual environment, hence the extra binaries.
* Currently BornAgain libraries do not have a version number. This cannot be changed at the moment.

@github-actions github-actions bot added autosquash Automatically squash pull request commits according to Homebrew style. python Python use is a significant feature of the PR or issue new formula PR adds a new formula to Homebrew/homebrew-core labels Apr 4, 2025
Copy link
Contributor

github-actions bot commented Apr 4, 2025

Thanks for contributing to Homebrew! 🎉 It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

@chenrui333 chenrui333 changed the title Add a formula for BornAgain GUI v22.0 bornagain 22.0 (new formula) Apr 4, 2025
Copy link
Member

@SMillerDev SMillerDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put some comments on the install block, but this is way too much custom logic to be maintainable. Please check other formula to see how formulae usually install python wheels.

@botantony
Copy link
Contributor

Please, do not use puts and odie so much. def install block works only if you build from source, regular Homebrew users will download pre-compiled binaries (bottles in Homebrew terminology) created during CI.

I'd recommend to read docs about Language::Python module: https://rubydoc.brew.sh/Language/Python.html

AlQuemist added 2 commits April 7, 2025 17:33
BornAgain is an open-source research software to simulate and fit neutron
and x-ray reflectometry and grazing-incidence small-angle scattering.

BornAgain has a GUI which can interoperate with a Python interpreter.
It can be also used as a Python package.

homepage: <https://bornagainproject.org>
source: <https://jugit.fz-juelich.de/mlz/bornagain.git>
@github-actions github-actions bot added the macos-only Formula depends on macOS label Apr 7, 2025
AlQuemist added 2 commits April 8, 2025 10:04
Revision 3:
* Removed architecture requirement.
* Extracted shim-producing part of the code as an extra function.
* Removed unnecessary comments.
* Simplified the CMake commands.
* Removed `Etc.nprocessors` usage.
AlQuemist added 2 commits April 9, 2025 15:04
Added a numerical test for the libraries.
@AlQuemiste
Copy link
Author

AlQuemiste commented Apr 11, 2025

Added a numerical test; see revision d0c9522.
Please let me know if any further changes are required.

Add explicit CMake paths for libheinz and libformfactor.
@p-linnane
Copy link
Member

This still needs a lot of work. Given that it's also not very notable software, I'm not inclined to accept this. Please consider hosting this in your own Homebrew tap instead.

@p-linnane p-linnane closed this Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosquash Automatically squash pull request commits according to Homebrew style. macos-only Formula depends on macOS new formula PR adds a new formula to Homebrew/homebrew-core python Python use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants