24 Commits

Author SHA1 Message Date
Mike McQuaid
a9faa2cd8e
package/scripts/postinstall: add Homebrew to PATH.
This is automatic for `/usr/local/bin/brew` but let's do it manually
for `/opt/homebrew/bin/brew` too.
2025-06-23 15:16:49 +01:00
Eric Knibbe
78a326d832
pkg: fix existing installation not being upgraded 2025-03-04 23:42:47 -05:00
Francois-Xavier Coudert
4ab19e09da
Make Sequoia supported 2024-09-11 09:00:37 +01:00
Eric Knibbe
90ac39998f
pkg: adjust setting permissions on Intel 2024-06-13 17:32:38 -04:00
Ruoyu Zhong
8a0b4edd8a
package/scripts/postinstall: simplify
It is safe to override `HOME` for the entire script as only Git uses it.
2024-04-11 20:37:37 +08:00
Ruoyu Zhong
f76442837a
package/scripts/postinstall: avoid writing to ~/.gitconfig
In this attempt we pretend that the "global" configs are in the
repository itself.

    $ XDG_CONFIG_HOME= HOME=$PWD git config --global section.key value
    $ XDG_CONFIG_HOME= HOME=$PWD git config --global section.key
    value
    $ git config --global section.key
    $ cat $PWD/.gitconfig
    [section]
      key = value
2024-04-11 04:15:59 +08:00
Ruoyu Zhong
ad4a0800cc
package/scripts/postinstall: handle /usr/local/Homebrew 2024-04-11 02:02:05 +08:00
Ruoyu Zhong
b516fda8be
package/scripts/postinstall: avoid writing to ~/.gitconfig
We can eliminate permission issues by not touching `~/.gitconfig` at
all.

Fixes #17067.
2024-04-11 01:12:03 +08:00
Ruoyu Zhong
a16d74cf77
package: improve shellenv instructions
The existing instructions is perhaps not clear enough:

  To add Homebrew to your `PATH` run `brew shellenv` in your shell
  profile (e.g. `~/.bash_profile` or `~/.zprofile`)

Fixes #16803.
2024-03-04 06:48:34 +08:00
Ruoyu Zhong
005d76805a
package/scripts/postinstall: fix permissions of opt
Fixes https://github.com/orgs/Homebrew/discussions/5052.
2024-01-15 11:19:15 +08:00
nstrauss
e0ac5459b3
Improve Mac package for enterprise install scenarios
- Allow specifying user through `/var/tmp/.homebrew_pkg_user.plist`
- Improve permission handling
- Correctly write API cache
- Add `preinstall` script to fail if we can't get a valid user

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-10-06 11:53:00 +01:00
Mike McQuaid
5c5ac49a39
More Homebrew .pkg improvements
- test on more macOS versions and improve the test names
- add a more resilient and less disruptive version of changing `git`'s
 `safe.directory` configuration
2023-10-04 18:32:08 +01:00
Mike McQuaid
c95a26b917
Improve building Homebrew*.pkg
- split jobs into build/test/deploy
- test package on both macOS Intel and Apple Silicon
- cleanup some argument handling
- use `HOMEBREW_MACOS_OLDEST_SUPPORTED` naming to be consistent with
  `brew.sh`
- note in `brew.sh` that `Distribution.xml` also needs updated (and do
  so)
- various other little bits of style cleanup
2023-10-04 10:18:27 +01:00
Mike McQuaid
39dc5652aa
package/Distribution: always require CLT.
We always require it in `install.sh` and we need it for all but the
latest version of macOS so this seems a simpler compromise.

Fixes #15802
2023-08-03 11:42:06 +01:00
Mike McQuaid
8819925af4
package/resources: improve text output.
- use the system font instead of Helvetica
- cleanup font definitions
- add extra newline to `CONCLUSION.rtf` to next steps not showing up
  without a click
- add actual hyperlinks to `CONCLUSION.rtf`

Fixes #15793
2023-07-31 14:56:40 +01:00
Mike McQuaid
2b0471c122
workflows/build-pkg: actually try to install package.
- This should help avoid this regressing
- Remove existing Homebrew installation(s)
- Install it twice to ensure that installing over the top of an existing
  installation works as expected
- Remove existing API cache to ensure we have the freshest files from
  the API in our package
2023-07-27 15:51:40 +01:00
Mike McQuaid
b00a95b678
pkg installer: install cached API data.
Continuing with the goals of making the installer:
- more useful
- entirely offline

Let's pre-download the API data from a `brew update` run and install it
into the logged-in user's home directory.

While we're here, in the `postinstall` script:
- use longer arguments for various commands
- fix an issue with symlinking on Intel if `/usr/local/bin` doesn't
  already exist
- unset `bash -x` and use `-v` on more commands instead
2023-07-26 15:32:14 +01:00
ImgBotApp
26921f1f1f
[ImgBot] Optimize images
/package/resources/Homebrew.png -- 130.54kb -> 65.15kb (50.09%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2023-07-25 17:13:39 +00:00
Mike McQuaid
c5afd5d056
macOS .pkg improvements
- don't include GitHub Actions credentials
- generate and include RTF version of Homebrew BSD license
- create nicer installer with `productbuild`
- customise welcome/conclusion messages
- add Homebrew logo as a background image
- remove unnecessary `preinstall` script
- cleanup `postinstall` script to pass `brew doctor`
- use `Distribution.xml` for a nicer installer
- require CLT or Xcode rather than using our hacks to try and install
  CLT during installation
2023-07-25 15:47:34 +01:00
Sean Molenaar
76f4826ff7
package: fix ARM name and owner of prefix 2023-02-17 17:12:36 +01:00
Sean Molenaar
f30779c6bf
Update package/scripts/postinstall 2022-12-23 19:36:13 +01:00
Sean Molenaar
d2aed31387
preinstall: correctly handle headless installs 2022-12-21 13:37:24 +01:00
Sean Molenaar
f6a9980e49
fix: cleanup macOS packaging
Don't allow specifying target
Add `set -e` to shell scripts
Don't try and package on every PR

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2022-12-21 13:18:09 +01:00
Sean Molenaar
72b3348fb1
feature: generate macOS pkg files 2022-12-19 21:26:24 +01:00