Skip to content
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

Improve formulae #9

Merged
merged 4 commits into from
Dec 2, 2020
Merged

Improve formulae #9

merged 4 commits into from
Dec 2, 2020

Conversation

rgov
Copy link
Contributor

@rgov rgov commented Nov 16, 2020

Edit: This patch has been rewritten, see below.

This is a quick and dirty patch to change the formulae to build keg-only. On recent systems, Homebrew does not seem to be allowed to copy into /Library/Frameworks, so this forces them to build inside their Homebrew keg.

Unfortunately I ran out of time to work on actually fixing IIO Oscilloscope.

@tfcollins
Copy link
Owner

What brew and macOS versions are you building off? Tests fail in Catalina for me.
-Travis

@rgov
Copy link
Contributor Author

rgov commented Nov 17, 2020

I am on Big Sur, with Homebrew 2.5.11-6-g9f45814.

Sorry, this was kind of a phoned-in pull request because I had to give up and move on, and it requires some tweaking.

I see in TravisCI you are just installing the .pkg releases from analog.com for libiio and libad9361-iio, rather than testing the build from this repo's formulae. I only modified these two, but the i-i-o-oscilloscope formula is busted, see below:

Some improvements:

  1. I couldn't find a reason to use ENV.deparallelize so I re-enabled it.
  2. I removed a handful of build dependencies that didn't seem necessary (e.g., bison doesn't actually seem to be needed)
  3. I made make install not attempt to install to /Library because that wasn't permitted; instead they install to the package's keg.
  4. I made libad9361-iio properly declare its dependency on libiio so that when installing one, the dependencies are automatically sastisfied.
  5. I cleaned up how cmake is invoked, following brew's own core formulae (e.g., passing default args).

Things that need to be improved:

  1. I didn't have time to fix i-i-o-oscilloscope to find its dependencies in their kegs and apply the same improvements.
  2. I didn't see if keg-only is really a necessary option.
  3. The frameworks that are built are kind of bizarre, for instance they have command-line binaries inside them. I don't know if these should be linked into /usr/local/bin?
  4. Almost all of the dependencies are declared as :build but I don't think that is correct. Probably many of them are runtime dependencies.

@tfcollins
Copy link
Owner

kk thanks for the info. To be honest, the libiio and libad9361 formulae were super WIP. This is why travis-ci was just testing IIO-Scope. For IIO-Scope this was working fine with Catalina when the external dependencies libiio and libad9361 were installed. At least with the release specified. Anyway, I need to switch things to GH Actions for CI here as well. For the keg-only build do you just run:

brew install -v --build-from-source <formula>
brew test <formula>

Maybe I can add that in and you can rebase.

- Rename i-i-o-oscilloscope to the more natural iio-oscilloscope
- Invoke CMake with Homebrew's standard arguments
- Fix identification of build-time vs runtime dependencies
- Update packages to latest versions
- Add SHA-256 checksums to verify file integrity
- Add simple test cases

The formulae now pass `brew audit`.
@rgov rgov changed the title Build keg-only Improve formulae Nov 21, 2020
@rgov
Copy link
Contributor Author

rgov commented Nov 21, 2020

Ok I have had time to sit down and improve this. Sorry it was not great before. The new formulae now build and install both libraries and the main osc tool fine.

Unfortunately, in the latest release (v0.11) osc crashes on Big Sur after selecting your device, I think due to this issue in another package: https://gitlab.freedesktop.org/cairo/cairo/-/issues/420 This is not a regression caused by this patch.

Forget about the keg-only stuff I was talking about. For the record I don't think my diagnosis of why it couldn't install into /Library/Frameworks was correct — I suspect now it is Homebrew's own sandbox profile that was restricting it.

If you accept this patch, please update references in your wiki etc. to the i-i-o-oscilloscope formula to reference iio-oscilloscope.

Closes #1. Closes #5.

@rgov
Copy link
Contributor Author

rgov commented Nov 22, 2020

Also included in this pull request is a change from Travis CI to GitHub's built in CI system. The new CI configuration tests all 3 packages on macOS Catalina (10.15). Closes #8.

I was unable to test on Big Sur because Homebrew complains that the default Big Sur system image contains an outdated Xcode.

I also wanted to try running brew audit as part of CI but I hit some Ruby issues. Something to revisit in the future, I suppose.

@rgov
Copy link
Contributor Author

rgov commented Nov 22, 2020

I also have a formula for gr-iio but it is blocked by this issue: Homebrew/homebrew-core#65387

@rgov rgov mentioned this pull request Nov 22, 2020
@tfcollins
Copy link
Owner

Thanks for the update! Had some internet issues last week but I'll review this in the next couple days.

@tfcollins tfcollins self-requested a review December 1, 2020 18:39
@tfcollins tfcollins merged commit ba3c67d into tfcollins:master Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants