mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39a4868313 | ||
|
2086a773ae
|
|||
|
|
68ecce6158 | ||
|
7aa4058128
|
|||
|
|
67ad73e500 | ||
| 8ac1f946dd | |||
|
|
cc38319b40 | ||
| e8885400e6 | |||
|
|
00015d861f | ||
| ca8b874be2 | |||
|
5d36f02cca
|
|||
|
5c37e8b0a2
|
|||
| 28ff28b29a | |||
| 3cf1977def | |||
|
bc2a45767e
|
|||
|
|
2320030121 | ||
| c53c398cac | |||
|
|
f7b2baa363 | ||
|
d396165808
|
|||
| 66ccd9c6fd | |||
|
|
907f7babbc | ||
|
e030fee670
|
|||
|
|
0ea0596f69 | ||
| 03ed54ca78 | |||
|
|
9d98b6340b | ||
|
cbac633efb
|
|||
|
db723817bf
|
|||
|
|
509d8bf0b8 | ||
|
d7723ee766
|
|||
|
|
9c99da14b3 | ||
| ccb4f3f438 | |||
|
|
4c997758f8 | ||
| 8267ac1662 | |||
| 5c513ce2e7 | |||
| 6e2b9aa44a | |||
|
|
2758cc93cb | ||
|
|
970cb68701 | ||
|
|
a95a3c1c9a | ||
|
|
533dde85b1 | ||
| ca8951ccd3 | |||
|
cfc5155199
|
|||
|
|
78db99ea2d | ||
|
8a1ae4df1c
|
|||
|
|
5e2aaceb84 | ||
|
|
bcfdeacf95 | ||
|
2f0babae99
|
|||
|
|
6c32cebf96 | ||
| 1743035a6d | |||
|
c38075ee8c
|
|||
|
05d4d86743
|
|||
|
8f2c9f9d42
|
|||
|
|
06ec20fabf | ||
|
97f77f3b10
|
|||
|
|
e0eb0d32a8 | ||
|
85041112ef
|
|||
|
af0b2b83ab
|
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
@@ -1,3 +1,3 @@
|
||||
{
|
||||
".": "0.6.43"
|
||||
".": "0.6.62"
|
||||
}
|
||||
|
||||
1
.github/release-please-config.json
vendored
1
.github/release-please-config.json
vendored
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"bootstrap-sha": "3d6c7fff64bda8ba0dbea181c9f94fb9716dd188",
|
||||
"always-update": true,
|
||||
"packages": {
|
||||
".": {
|
||||
"release-type": "simple",
|
||||
|
||||
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
@@ -1,6 +1,8 @@
|
||||
---
|
||||
name: CI
|
||||
on: [push]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
@@ -8,13 +10,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.20"
|
||||
go-version-file: go.mod
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v8
|
||||
with:
|
||||
version: v1.55
|
||||
version: v2.1
|
||||
env:
|
||||
VERBOSE: "true"
|
||||
|
||||
@@ -23,9 +25,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.20"
|
||||
go-version-file: go.mod
|
||||
- name: Check if mods are tidy
|
||||
run: make check-tidy
|
||||
|
||||
@@ -34,16 +36,23 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: "1.20"
|
||||
go-version-file: go.mod
|
||||
- name: Run tests
|
||||
run: make test
|
||||
env:
|
||||
VERBOSE: "true"
|
||||
|
||||
release-please:
|
||||
name: Release Please
|
||||
runs-on: ubuntu-latest
|
||||
if: github.ref_name == 'main' || github.ref_name == 'master'
|
||||
if: ${{ github.ref_name == 'main' || github.ref_name == 'master' }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: jimeh/release-please-manifest-action@v1
|
||||
- uses: jimeh/release-please-manifest-action@v2
|
||||
with:
|
||||
app-id: ${{ secrets.RELEASE_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,7 +1,6 @@
|
||||
.DS_Store
|
||||
.envrc
|
||||
Formula/*
|
||||
Gemfile.lock
|
||||
bin
|
||||
builds
|
||||
sources
|
||||
|
||||
126
.golangci.yml
126
.golangci.yml
@@ -1,42 +1,21 @@
|
||||
linters-settings:
|
||||
funlen:
|
||||
lines: 100
|
||||
statements: 150
|
||||
goconst:
|
||||
min-occurrences: 5
|
||||
gocyclo:
|
||||
min-complexity: 20
|
||||
govet:
|
||||
check-shadowing: true
|
||||
enable-all: true
|
||||
disable:
|
||||
- fieldalignment
|
||||
lll:
|
||||
line-length: 80
|
||||
tab-width: 4
|
||||
maligned:
|
||||
suggest-new: true
|
||||
misspell:
|
||||
locale: US
|
||||
|
||||
version: "2"
|
||||
run:
|
||||
modules-download-mode: readonly
|
||||
allow-parallel-runners: true
|
||||
linters:
|
||||
disable-all: true
|
||||
default: none
|
||||
enable:
|
||||
- bodyclose
|
||||
- copyloopvar
|
||||
- dupl
|
||||
- errcheck
|
||||
- exportloopref
|
||||
- funlen
|
||||
- gochecknoinits
|
||||
- goconst
|
||||
- gocritic
|
||||
- gocyclo
|
||||
- gofumpt
|
||||
- goimports
|
||||
- goprintffuncname
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- lll
|
||||
@@ -48,36 +27,69 @@ linters:
|
||||
- revive
|
||||
- sqlclosecheck
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- whitespace
|
||||
|
||||
issues:
|
||||
exclude:
|
||||
- Using the variable on range scope `tt` in function literal
|
||||
- Using the variable on range scope `tc` in function literal
|
||||
exclude-rules:
|
||||
- path: "_test\\.go"
|
||||
linters:
|
||||
- funlen
|
||||
- dupl
|
||||
- goconst
|
||||
- source: "^//go:generate "
|
||||
linters:
|
||||
- lll
|
||||
- source: "`json:"
|
||||
linters:
|
||||
- lll
|
||||
- source: "`yaml:"
|
||||
linters:
|
||||
- lll
|
||||
|
||||
run:
|
||||
skip-dirs:
|
||||
- builds
|
||||
- sources
|
||||
- tarballs
|
||||
timeout: 2m
|
||||
allow-parallel-runners: true
|
||||
modules-download-mode: readonly
|
||||
settings:
|
||||
funlen:
|
||||
lines: 100
|
||||
statements: 150
|
||||
goconst:
|
||||
min-occurrences: 5
|
||||
gocyclo:
|
||||
min-complexity: 20
|
||||
govet:
|
||||
disable:
|
||||
- fieldalignment
|
||||
enable-all: true
|
||||
lll:
|
||||
line-length: 80
|
||||
tab-width: 4
|
||||
misspell:
|
||||
locale: US
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
rules:
|
||||
- linters:
|
||||
- dupl
|
||||
- funlen
|
||||
- goconst
|
||||
path: _test\.go
|
||||
- linters:
|
||||
- lll
|
||||
source: "^//go:generate "
|
||||
- linters:
|
||||
- lll
|
||||
source: "`json:"
|
||||
- linters:
|
||||
- lll
|
||||
source: "`yaml:"
|
||||
- path: (.+)\.go$
|
||||
text: Using the variable on range scope `tt` in function literal
|
||||
- path: (.+)\.go$
|
||||
text: Using the variable on range scope `tc` in function literal
|
||||
paths:
|
||||
- builds
|
||||
- sources
|
||||
- tarballs
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
formatters:
|
||||
enable:
|
||||
- gofumpt
|
||||
- goimports
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- builds
|
||||
- sources
|
||||
- tarballs
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
brew 'python'
|
||||
146
CHANGELOG.md
146
CHANGELOG.md
@@ -1,5 +1,151 @@
|
||||
# Changelog
|
||||
|
||||
## [0.6.62](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.61...v0.6.62) (2025-09-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **deps/nix:** upgrade build-time dependencies ([2086a77](https://github.com/jimeh/build-emacs-for-macos/commit/2086a773ae6bf5f4c2e6863d1b06a85acc082e6d))
|
||||
|
||||
## [0.6.61](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.60...v0.6.61) (2025-08-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **emacs-31-builds:** disable fix-window-role patch after it was merged upstream ([7aa4058](https://github.com/jimeh/build-emacs-for-macos/commit/7aa405812802abbd2b78d8c98aee7fca23a2eab2))
|
||||
|
||||
## [0.6.60](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.59...v0.6.60) (2025-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **builder/cask:** correctly resolve version with build variant to release name ([#140](https://github.com/jimeh/build-emacs-for-macos/issues/140)) ([8ac1f94](https://github.com/jimeh/build-emacs-for-macos/commit/8ac1f946dde2342fa82aff7f90d2126bdd1f0057))
|
||||
|
||||
## [0.6.59](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.58...v0.6.59) (2025-06-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **builder/plan:** append test build name to release name ([#138](https://github.com/jimeh/build-emacs-for-macos/issues/138)) ([e888540](https://github.com/jimeh/build-emacs-for-macos/commit/e8885400e66bdb9304f99d9b072aa4dec4e83f4b))
|
||||
|
||||
## [0.6.58](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.57...v0.6.58) (2025-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **builder/plan:** add build variant flag ([#137](https://github.com/jimeh/build-emacs-for-macos/issues/137)) ([ca8b874](https://github.com/jimeh/build-emacs-for-macos/commit/ca8b874be2c8c52cd7dcb05ff1348469e16c74ba))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** work around duplicate RPATHs in libgccjit from Nix ([#134](https://github.com/jimeh/build-emacs-for-macos/issues/134)) ([3cf1977](https://github.com/jimeh/build-emacs-for-macos/commit/3cf1977def02d1f3732b1051bc07a923557f9edd))
|
||||
|
||||
## [0.6.57](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.56...v0.6.57) (2024-12-07)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **patches/alpha-background:** add experimental alpha-background patch ([#129](https://github.com/jimeh/build-emacs-for-macos/issues/129)) ([c53c398](https://github.com/jimeh/build-emacs-for-macos/commit/c53c398cace6479a9c188e46196462791960abee)), closes [#111](https://github.com/jimeh/build-emacs-for-macos/issues/111)
|
||||
|
||||
## [0.6.56](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.55...v0.6.56) (2024-12-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **options:** add --patch option which accepts file path or URL ([#127](https://github.com/jimeh/build-emacs-for-macos/issues/127)) ([66ccd9c](https://github.com/jimeh/build-emacs-for-macos/commit/66ccd9c6fd077d558eae484cdbab831486fbfd58))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **patches:** improve chance of successful patch application by using -l ([d396165](https://github.com/jimeh/build-emacs-for-macos/commit/d396165808ab5852566e7ff6bcc23d47ddfdfdee))
|
||||
|
||||
## [0.6.55](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.54...v0.6.55) (2024-12-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **nix/deps:** update nixpkgs from 24.11-beta to 24.11 ([e030fee](https://github.com/jimeh/build-emacs-for-macos/commit/e030fee6704618b7ddefea7424dff4e94f43e84d))
|
||||
|
||||
## [0.6.54](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.53...v0.6.54) (2024-12-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **startup:** replace bundled site-start.el approach with a custom source patch ([#124](https://github.com/jimeh/build-emacs-for-macos/issues/124)) ([03ed54c](https://github.com/jimeh/build-emacs-for-macos/commit/03ed54ca78ce15b61f5c875f97410b3ff21ecd62))
|
||||
|
||||
## [0.6.53](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.52...v0.6.53) (2024-12-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **help:** correct formatting of help text output ([db72381](https://github.com/jimeh/build-emacs-for-macos/commit/db723817bf6c0ac85da1790a1d50fbea774cc0c0))
|
||||
|
||||
## [0.6.52](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.51...v0.6.52) (2024-11-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **nix/flake:** rename flake-package-versions.txt to flake.pkgs ([d7723ee](https://github.com/jimeh/build-emacs-for-macos/commit/d7723ee766574b6597997de7c54fb7ed7f37965c))
|
||||
|
||||
## [0.6.51](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.50...v0.6.51) (2024-11-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **build/embed:** include all Emacs C sources and related files in the Emacs.app bundle ([#120](https://github.com/jimeh/build-emacs-for-macos/issues/120)) ([ccb4f3f](https://github.com/jimeh/build-emacs-for-macos/commit/ccb4f3f438652c7ae98c202b8afed8861f40eeec))
|
||||
|
||||
## [0.6.50](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.49...v0.6.50) (2024-11-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **build/options:** add --optimize and related flags ([#119](https://github.com/jimeh/build-emacs-for-macos/issues/119)) ([8267ac1](https://github.com/jimeh/build-emacs-for-macos/commit/8267ac166203c0c495520e6970650735702eac35))
|
||||
* **deps:** add support for Nix package manager ([#116](https://github.com/jimeh/build-emacs-for-macos/issues/116)) ([6e2b9aa](https://github.com/jimeh/build-emacs-for-macos/commit/6e2b9aa44ae1cbc3eec8ec7318ce9c9968e2d673))
|
||||
* **package:** produce and include configure output log ([#118](https://github.com/jimeh/build-emacs-for-macos/issues/118)) ([5c513ce](https://github.com/jimeh/build-emacs-for-macos/commit/5c513ce2e7536c57f43a49739b3f0f66d15f7b6d))
|
||||
|
||||
## [0.6.49](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.48...v0.6.49) (2024-11-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **compile-options:** increase runtime max open files limit ([#115](https://github.com/jimeh/build-emacs-for-macos/issues/115)) ([ca8951c](https://github.com/jimeh/build-emacs-for-macos/commit/ca8951ccd350ecee5ad6c637caae0af1831a9eb5)), closes [#106](https://github.com/jimeh/build-emacs-for-macos/issues/106)
|
||||
* **patches:** tidy up patches, deprecate optional poll patch ([cfc5155](https://github.com/jimeh/build-emacs-for-macos/commit/cfc5155199486c4e3fae7edbc7262299b3c9955c))
|
||||
|
||||
## [0.6.48](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.47...v0.6.48) (2024-08-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **local-lisp-path:** add Apple Silicon homebrew lisp-site ([8a1ae4d](https://github.com/jimeh/build-emacs-for-macos/commit/8a1ae4df1ca37a851f9936fcf2081536837e4c67))
|
||||
|
||||
## [0.6.47](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.46...v0.6.47) (2024-05-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **bootstrap:** remove --no-upgrade option from brew bundle ([2f0baba](https://github.com/jimeh/build-emacs-for-macos/commit/2f0babae990f908d706f5f60dc4a11573918c23d))
|
||||
|
||||
## [0.6.46](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.45...v0.6.46) (2024-04-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **emacs-builder:** resolve issues with notarizing Emacs app ([#100](https://github.com/jimeh/build-emacs-for-macos/issues/100)) ([1743035](https://github.com/jimeh/build-emacs-for-macos/commit/1743035a6d5d8c07a2c1da3f76cafe156e4ec31d))
|
||||
|
||||
## [0.6.45](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.44...v0.6.45) (2023-11-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **builder/cask:** support shared helpers template ([97f77f3](https://github.com/jimeh/build-emacs-for-macos/commit/97f77f3b1043b66da6ec737e5db91605ec961d08))
|
||||
|
||||
## [0.6.44](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.43...v0.6.44) (2023-11-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **builder/cask:** ensure release info helpers return correct asset ([af0b2b8](https://github.com/jimeh/build-emacs-for-macos/commit/af0b2b83abd5af0e61a085da386cc0da389f6588))
|
||||
|
||||
## [0.6.43](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.42...v0.6.43) (2023-11-16)
|
||||
|
||||
|
||||
|
||||
5
Gemfile
5
Gemfile
@@ -1,12 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source 'http://rubygems.org/'
|
||||
source 'https://rubygems.org/'
|
||||
|
||||
gem 'ruby-macho'
|
||||
|
||||
group :development do
|
||||
gem 'byebug'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop-daemon'
|
||||
gem 'solargraph', '~> 0.39.17'
|
||||
end
|
||||
|
||||
40
Gemfile.lock
Normal file
40
Gemfile.lock
Normal file
@@ -0,0 +1,40 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
ast (2.4.2)
|
||||
json (2.8.2)
|
||||
language_server-protocol (3.17.0.3)
|
||||
parallel (1.26.3)
|
||||
parser (3.3.6.0)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
racc (1.8.1)
|
||||
rainbow (3.1.1)
|
||||
regexp_parser (2.9.2)
|
||||
rubocop (1.68.0)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (>= 3.17.0)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 2.4, < 3.0)
|
||||
rubocop-ast (>= 1.32.2, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.36.1)
|
||||
parser (>= 3.3.1.0)
|
||||
ruby-macho (4.1.0)
|
||||
ruby-progressbar (1.13.0)
|
||||
unicode-display_width (2.6.0)
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin
|
||||
ruby
|
||||
x86_64-darwin
|
||||
|
||||
DEPENDENCIES
|
||||
rubocop
|
||||
ruby-macho
|
||||
|
||||
BUNDLED WITH
|
||||
2.5.23
|
||||
27
Makefile
27
Makefile
@@ -46,16 +46,14 @@ SHELL := env \
|
||||
#
|
||||
|
||||
bootstrap: bootstrap-brew bootstrap-ruby
|
||||
bootstrap-ci: bootstrap-brew bootstrap-brew-ci bootstrap-ruby bootstrap-pip
|
||||
|
||||
bootstrap-ruby:
|
||||
bundle install
|
||||
env BUNDLE_WITHOUT=development bundle install
|
||||
|
||||
bootstrap-brew:
|
||||
brew bundle
|
||||
|
||||
bootstrap-brew-ci:
|
||||
brew bundle --file Brewfile.ci
|
||||
ifndef IN_NIX_SHELL
|
||||
brew bundle --verbose
|
||||
endif
|
||||
|
||||
bootstrap-pip:
|
||||
$(PIP) install -r requirements-ci.txt
|
||||
@@ -73,7 +71,7 @@ $(TOOLDIR)/$(1): Makefile
|
||||
endef
|
||||
|
||||
$(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest))
|
||||
$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.40))
|
||||
$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1))
|
||||
$(eval $(call tool,gomod,github.com/Helcaraxan/gomod@latest))
|
||||
|
||||
.PHONY: tools
|
||||
@@ -136,6 +134,21 @@ format: $(TOOLDIR)/gofumpt
|
||||
gen:
|
||||
go generate $$(go list ./... | grep -v 'sources/' | grep -v 'builds/')
|
||||
|
||||
.PHONY: nix-flake-update
|
||||
nix-flake-update:
|
||||
nix flake update \
|
||||
&& $(MAKE) flake.pkgs
|
||||
|
||||
.SILENT: flake-package-versions
|
||||
flake-package-versions:
|
||||
nix develop --command -- bash -c \
|
||||
'nix derivation show \
|
||||
$$(echo $$PATH | tr ":" "\n" | grep "/nix/store" | sort -u) \
|
||||
| jq -r ".[].name" | sort -u'
|
||||
|
||||
flake.pkgs: flake.nix flake.lock
|
||||
$(MAKE) flake-package-versions > "$@"
|
||||
|
||||
#
|
||||
# Dependencies
|
||||
#
|
||||
|
||||
125
README.md
125
README.md
@@ -36,42 +36,89 @@ The build produced does have some limitations:
|
||||
|
||||
## Requirements
|
||||
|
||||
Required with both Nix and Homebrew approaches:
|
||||
|
||||
- [Xcode](https://apps.apple.com/gb/app/xcode/id497799835?mt=12)
|
||||
- [Homebrew](https://brew.sh/)
|
||||
- All Homebrew formula listed in the `Brewfile`, which can all easily be
|
||||
installed by running:
|
||||
```
|
||||
brew bundle
|
||||
```
|
||||
- Ruby 2.3.0 or later is needed to execute the build script itself. macOS comes
|
||||
with Ruby, check your version with `ruby --version`. If it's too old, you can
|
||||
install a newer version with:
|
||||
```
|
||||
brew install ruby
|
||||
```
|
||||
|
||||
### Nix
|
||||
|
||||
The [Nix](https://nixos.org/) package manager is the preferred and most reliable
|
||||
way to install all dependencies required to build Emacs, by way of a Nix flake
|
||||
included in the project root.
|
||||
|
||||
To install all required dependencies within the nix shell, run:
|
||||
|
||||
```
|
||||
nix develop --command make bootstrap
|
||||
```
|
||||
|
||||
### Homebrew
|
||||
|
||||
If you do not have Nix installed, then the alternative way to manage and install
|
||||
build-time dependencies is via [Homebrew](https://brew.sh/).
|
||||
|
||||
Ruby 3.3.x or later is also needed to execute the build script. Earlier versions
|
||||
may work, but are untested. Simplest way to install a recent Ruby version is via
|
||||
Homebrew:
|
||||
|
||||
```
|
||||
brew install ruby
|
||||
```
|
||||
|
||||
And finally, to install all built-time dependencies, run:
|
||||
|
||||
```
|
||||
make bootstrap
|
||||
```
|
||||
|
||||
## Status
|
||||
|
||||
As of writing (2021-11-27) it works for me on my machine and for the nightly
|
||||
As of writing (2024-11-30) it works for me on my machine and for the nightly
|
||||
builds in [jimeh/emacs-builds](https://github.com/jimeh/emacs-builds). Your luck
|
||||
may vary.
|
||||
|
||||
I have successfully built:
|
||||
|
||||
- `emacs-28` release branch
|
||||
- `master` branch (Emacs 29.x)
|
||||
- `emacs-29.4` release tag.
|
||||
- `emacs-30.0.92` pretest tag.
|
||||
- `master` branch (Emacs 31.x).
|
||||
|
||||
For reference, my machine is:
|
||||
|
||||
- 13-inch MacBook Pro (2020), 10th-gen 2.3 GHz Quad-Core Intel Core i7 (4c/8t)
|
||||
- macOS Monterey 12.0.1 (21A559)
|
||||
- Xcode 13.1 (13A1030d)
|
||||
- 14-inch MacBook Pro (2023), Apple M3 Max (16-cores)
|
||||
- macOS Sonoma 15.1.1 (24B91)
|
||||
- Xcode 16.1 (16B40)
|
||||
|
||||
Nightly builds are built with GitHub Actions on GitHub-hosted runners, using
|
||||
`macos-10.15`.
|
||||
The [nightly builds](https://github.com/jimeh/emacs-builds) are built with
|
||||
GitHub Actions on GitHub-hosted runners, using `macos-13` for Intel builds, and
|
||||
`macos-14` for Apple Silicon builds. The build environment is managed with Nix,
|
||||
and targets the macOS 11 SDK.
|
||||
|
||||
## Usage
|
||||
|
||||
### Nix
|
||||
|
||||
Ensure [Flakes](https://nixos.wiki/wiki/Flakes) are enabled, and enter the flake
|
||||
development environment with `nix develop`. Within this environment, you can
|
||||
execute the `./build-emacs-for-macos --help` to get started.
|
||||
|
||||
Or you can run the build script via `nix develop`:
|
||||
|
||||
```
|
||||
nix develop --command ./build-emacs-for-macos --help
|
||||
```
|
||||
|
||||
The Nix environment defaults to targeting the macOS 11 SDK, which makes Emacs
|
||||
builds compatible with macOS 11.3 or later. You can easily target later macOS
|
||||
SDKs. Versions 11 to 15 are available. For example, to target the macOS 12 SDK,
|
||||
run `nix develop .#macos12`
|
||||
|
||||
### Homebrew
|
||||
|
||||
Run `make boostrap` to ensure all Ruby and Homebrew dependencies are installed.
|
||||
|
||||
### Build Script
|
||||
|
||||
```
|
||||
Usage: ./build-emacs-for-macos [options] <branch/tag/sha>
|
||||
|
||||
@@ -79,26 +126,42 @@ Branch, tag, and SHA are from the emacs-mirror/emacs/emacs Github repo,
|
||||
available here: https://github.com/emacs-mirror/emacs
|
||||
|
||||
Options:
|
||||
-j, --parallel COUNT Compile using COUNT parallel processes (detected: 8)
|
||||
--info Print environment info and detected library paths, then exit
|
||||
--preview Print preview details about build and exit.
|
||||
-j, --parallel COUNT Compile using COUNT parallel processes (detected: 16)
|
||||
--git-sha SHA Override detected git SHA of specified branch allowing builds of old commits
|
||||
--[no-]xwidgets Enable/disable XWidgets if supported (default: enabled)
|
||||
--[no-]use-nix Use Nix instead of Homebrew to find dependencies (default: enabled if IN_NIX_SHELL is set)
|
||||
--[no-]tree-sitter Enable/disable tree-sitter if supported (default: enabled)
|
||||
--[no-]native-comp Enable/disable native-comp (default: enabled if supported)
|
||||
--[no-]native-march Enable/disable -march=native CFLAG(default: disabled)
|
||||
--optimize Shorthand for --native-march --native-mtune --fomit-frame-pointer (default: disabled)
|
||||
--[no-]native-march Enable/disable -march=native CFLAG (default: disabled)
|
||||
--[no-]native-mtune Enable/disable -mtune=native CFLAG (default: disabled)
|
||||
--[no-]fomit-frame-pointer Enable/disable -fomit-frame-pointer CFLAG (default: disabled)
|
||||
--[no-]native-full-aot Enable/disable NATIVE_FULL_AOT / Ahead of Time compilation (default: disabled)
|
||||
--[no-]relink-eln-files Enable/disable re-linking shared libraries in bundled *.eln files (default: enabled)
|
||||
--[no-]rsvg Enable/disable SVG image support via librsvg (default: enabled)
|
||||
--no-titlebar Apply no-titlebar patch (default: disabled)
|
||||
--posix-spawn Apply posix-spawn patch (default: disabled)
|
||||
--no-frame-refocus Apply no-frame-refocus patch (default: disabled)
|
||||
--[no-]dbus Enable/disable dbus support (default: enabled)
|
||||
--[no-]alpha-background Enable/disable experimental alpha-background patch when building Emacs 30.x - 31.x (default: disabled)
|
||||
--no-frame-refocus Apply no-frame-refocus patch when building Emacs 27.x - 31.x (default: disabled)
|
||||
--no-titlebar Apply no-titlebar patch when building Emacs 27.x - 28.x (default: disabled)
|
||||
--[no-]xwidgets Enable/disable XWidgets when building Emacs 27.x (default: disabled)
|
||||
--[no-]poll Apply poll patch (deprecated)
|
||||
--posix-spawn Apply posix-spawn patch (deprecated)
|
||||
-p, --patch=URL Specify a custom patch file or URL to apply to the Emacs source (can be used multiple times)
|
||||
--[no-]fd-setsize SIZE Set an file descriptor (max open files) limit (default: 10000)
|
||||
--github-src-repo REPO Specify a GitHub repo to download source tarballs from (default: emacs-mirror/emacs)
|
||||
--[no-]github-auth Make authenticated GitHub API requests if GITHUB_TOKEN environment variable is set.(default: enabled)
|
||||
--work-dir DIR Specify a working directory where tarballs, sources, and builds will be stored and worked with
|
||||
-o, --output DIR Output directory for finished builds (default: <work-dir>/builds)
|
||||
--build-name NAME Override generated build name
|
||||
--dist-include x,y,z List of extra files to copy from Emacs source into build folder/archive (default: COPYING)
|
||||
--[no-]self-sign Enable/disable self-signing of Emacs.app (default: enabled)
|
||||
--[no-]archive Enable/disable creating *.tbz archive (default: enabled)
|
||||
--[no-]archive-keep-build-dir
|
||||
Enable/disable keeping source folder for archive (default: disabled)
|
||||
--log-level LEVEL Build script log level (default: info)
|
||||
--plan FILE Follow given plan file, instead of using given git ref/sha
|
||||
--clean-macho-binary FILE Tool to clean duplicate RPATHs from given Mach-O binary.
|
||||
```
|
||||
|
||||
Resulting applications are saved to the `builds` directory in a bzip2 compressed
|
||||
@@ -119,10 +182,10 @@ as of writing) and build Emacs.app from it:
|
||||
./build-emacs-for-macos
|
||||
```
|
||||
|
||||
To build the stable `emacs-27.1` release git tag run:
|
||||
To build the stable `emacs-29.4` release git tag run:
|
||||
|
||||
```
|
||||
./build-emacs-for-macos emacs-27.1
|
||||
./build-emacs-for-macos emacs-29.4
|
||||
```
|
||||
|
||||
All sources as downloaded as tarballs from the
|
||||
@@ -155,14 +218,10 @@ use the alias from the above example.
|
||||
|
||||
## Native-Comp
|
||||
|
||||
_Note: On 2021-04-25 the `feature/native-comp` branch was
|
||||
[merged](http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=289000eee729689b0cf362a21baa40ac7f9506f6)
|
||||
into `master`._
|
||||
|
||||
The build script will automatically detect if the source tree being built
|
||||
supports native-compilation, and enable it if available. You can override the
|
||||
auto-detection logic to force enable or force disable native-compilation by
|
||||
passing `--native-comp` or `--no-native-comp` respectfully.
|
||||
passing `--native-comp` or `--no-native-comp` respectively.
|
||||
|
||||
By default `NATIVE_FULL_AOT` is disabled which ensures a fast build by native
|
||||
compiling as few elisp source files as possible to build Emacs itself. Any
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
61
flake.lock
generated
Normal file
61
flake.lock
generated
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1757545623,
|
||||
"narHash": "sha256-mCxPABZ6jRjUQx3bPP4vjA68ETbPLNz9V2pk9tO7pRQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8cd5ce828d5d1d16feff37340171a98fc3bf6526",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
102
flake.nix
Normal file
102
flake.nix
Normal file
@@ -0,0 +1,102 @@
|
||||
{
|
||||
description = "Development environment flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
|
||||
# List of supported macOS SDK versions.
|
||||
sdk_versions = [ "11" "12" "13" "14" "15" ];
|
||||
default_sdk_version = "11";
|
||||
|
||||
mkDevShell = { macos_version ? default_sdk_version }:
|
||||
let
|
||||
apple_sdk = pkgs.${"apple-sdk_${macos_version}"};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
# Package list specifically excludes ncurses, so that we link
|
||||
# against the system version of ncurses. This ensures emacs' TUI
|
||||
# works out of the box without the user having to manually set
|
||||
# TERMINFO in the shell before launching emacs.
|
||||
packages = with pkgs; [
|
||||
apple_sdk
|
||||
autoconf
|
||||
bash
|
||||
cairo
|
||||
clang
|
||||
coreutils
|
||||
curl
|
||||
darwin.DarwinTools # sw_vers
|
||||
dbus
|
||||
expat
|
||||
findutils
|
||||
gcc
|
||||
gettext
|
||||
giflib
|
||||
git
|
||||
gmp
|
||||
gnumake
|
||||
gnupatch
|
||||
gnused
|
||||
gnutar
|
||||
gnutls
|
||||
harfbuzz
|
||||
jansson
|
||||
jq
|
||||
lcms2
|
||||
libffi
|
||||
libgccjit
|
||||
libiconv
|
||||
libjpeg
|
||||
libpng
|
||||
librsvg
|
||||
libtasn1
|
||||
libunistring
|
||||
libwebp
|
||||
libxml2
|
||||
mailutils
|
||||
nettle
|
||||
pkg-config
|
||||
python313Packages.dmgbuild
|
||||
rsync
|
||||
ruby
|
||||
sqlite
|
||||
texinfo
|
||||
time
|
||||
tree-sitter
|
||||
which
|
||||
xcbuild
|
||||
zlib
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
export CC=clang
|
||||
export MACOSX_DEPLOYMENT_TARGET="${macos_version}.0"
|
||||
export DEVELOPER_DIR="${apple_sdk}"
|
||||
export NIX_LIBGCCJIT_VERSION="${pkgs.libgccjit.version}"
|
||||
export NIX_LIBGCCJIT_ROOT="${pkgs.libgccjit.outPath}"
|
||||
export BUNDLE_WITHOUT=development
|
||||
'';
|
||||
};
|
||||
|
||||
# Generate an attrset of shells for each macOS SDK version.
|
||||
versionShells = builtins.listToAttrs (
|
||||
map (version: {
|
||||
name = "macos${version}";
|
||||
value = mkDevShell { macos_version = version; };
|
||||
}) sdk_versions
|
||||
);
|
||||
in
|
||||
{
|
||||
devShells = versionShells // {
|
||||
default = mkDevShell {};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
72
flake.pkgs
Normal file
72
flake.pkgs
Normal file
@@ -0,0 +1,72 @@
|
||||
DarwinTools-1
|
||||
autoconf-2.72
|
||||
bash-5.2p37
|
||||
bash-interactive-5.2p37
|
||||
brotli-1.1.0
|
||||
bzip2-1.0.8
|
||||
cairo-1.18.2
|
||||
cctools-binutils-darwin-1010.6
|
||||
cctools-binutils-darwin-wrapper-1010.6
|
||||
clang-19.1.7
|
||||
clang-wrapper-19.1.7
|
||||
coreutils-9.7
|
||||
curl-8.14.1
|
||||
dbus-1.14.10
|
||||
diffutils-3.12
|
||||
expat-2.7.1
|
||||
file-5.45
|
||||
findutils-4.10.0
|
||||
fontconfig-2.16.0
|
||||
freetype-2.13.3
|
||||
gawk-5.3.2
|
||||
gcc-14.3.0
|
||||
gcc-wrapper-14.3.0
|
||||
gdk-pixbuf-2.42.12
|
||||
gettext-0.22.5
|
||||
giflib-5.2.2
|
||||
git-2.50.1
|
||||
glib-2.84.3
|
||||
gnugrep-3.11
|
||||
gnumake-4.4.1
|
||||
gnused-4.9
|
||||
gnutar-1.35
|
||||
gnutls-3.8.9
|
||||
graphite2-1.3.14
|
||||
gzip-1.14
|
||||
harfbuzz-10.2.0
|
||||
jq-1.7.1
|
||||
krb5-1.21.3
|
||||
lcms2-2.17
|
||||
libdeflate-1.23
|
||||
libgccjit-14.3.0
|
||||
libiconv-1.17
|
||||
libiconv-109
|
||||
libidn2-2.3.8
|
||||
libjpeg-turbo-3.0.4
|
||||
libpng-apng-1.6.46
|
||||
libpsl-0.21.5
|
||||
librsvg-2.60.0
|
||||
libtasn1-4.20.0
|
||||
libtiff-4.7.0
|
||||
libwebp-1.5.0
|
||||
libxml2-2.13.8
|
||||
mailutils-3.18
|
||||
nettle-3.10.1
|
||||
nghttp2-1.65.0
|
||||
openssl-3.4.2
|
||||
patch-2.7.6
|
||||
pkg-config-wrapper-0.29.2
|
||||
python3-3.13.5
|
||||
python3.13-dmgbuild-1.6.2
|
||||
python3.13-ds-store-1.3.1
|
||||
python3.13-mac-alias-2.2.2
|
||||
rsync-3.4.1
|
||||
ruby-3.3.9
|
||||
sqlite-3.48.0
|
||||
texinfo-7.2
|
||||
time-1.9
|
||||
tree-sitter-0.25.3
|
||||
which-2.23
|
||||
xcbuild-0.1.1-unstable-2019-11-20
|
||||
xz-5.8.1
|
||||
zstd-1.5.7
|
||||
12
go.mod
12
go.mod
@@ -1,13 +1,13 @@
|
||||
module github.com/jimeh/build-emacs-for-macos
|
||||
|
||||
go 1.20
|
||||
go 1.23
|
||||
|
||||
require (
|
||||
github.com/bearer/gon v0.0.36
|
||||
github.com/google/go-github/v35 v35.3.0
|
||||
github.com/hashicorp/go-hclog v1.5.0
|
||||
github.com/hexops/gotextdiff v1.0.3
|
||||
github.com/jimeh/undent v1.1.0
|
||||
github.com/mitchellh/gon v0.2.5
|
||||
github.com/stretchr/testify v1.7.2
|
||||
github.com/urfave/cli/v2 v2.25.7
|
||||
golang.org/x/oauth2 v0.14.0
|
||||
@@ -21,17 +21,15 @@ require (
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/google/go-querystring v1.1.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||
golang.org/x/crypto v0.15.0 // indirect
|
||||
golang.org/x/sys v0.14.0 // indirect
|
||||
golang.org/x/crypto v0.17.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
google.golang.org/appengine v1.6.8 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
google.golang.org/protobuf v1.33.0 // indirect
|
||||
howett.net/plist v1.0.0 // indirect
|
||||
)
|
||||
|
||||
25
go.sum
25
go.sum
@@ -1,6 +1,8 @@
|
||||
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
|
||||
github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
|
||||
github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
|
||||
github.com/bearer/gon v0.0.36 h1:IswEKy8WbBPx7ZxCs4T7mHN6Rj8CbLpS/0u8wka6fO8=
|
||||
github.com/bearer/gon v0.0.36/go.mod h1:jiD3TC2OA5lR2oADhe83a/FLxNS7/ra+58QUT9sQveg=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -22,6 +24,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-github/v35 v35.3.0 h1:fU+WBzuukn0VssbayTT+Zo3/ESKX9JYWjbZTLOTEyho=
|
||||
github.com/google/go-github/v35 v35.3.0/go.mod h1:yWB7uCcVWaUbUP74Aq3whuMySRMatyRmq5U9FTNlbio=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
@@ -30,19 +33,12 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v0.9.3-0.20191025211905-234833755cb2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
|
||||
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-retryablehttp v0.6.3/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
|
||||
github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90=
|
||||
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
|
||||
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
|
||||
@@ -68,15 +64,12 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
|
||||
github.com/mitchellh/gon v0.2.5 h1:mVWtqTzV03W0avJqmqjk9M0qls3TDUXfc9ETJaPIOWY=
|
||||
github.com/mitchellh/gon v0.2.5/go.mod h1:Ua18ZhqjZHg8VyqZo8kNHAY331ntV6nNJ9mT3s2mIo8=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY=
|
||||
github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/sebdah/goldie v1.0.0 h1:9GNhIat69MSlz/ndaBg48vl9dF5fI+NBB6kfOxgfkMc=
|
||||
github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
@@ -96,8 +89,8 @@ github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
|
||||
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
|
||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
@@ -127,8 +120,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
|
||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -146,8 +139,8 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs
|
||||
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
|
||||
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
487
patches/emacs-29/ns-alpha-background.patch
Normal file
487
patches/emacs-29/ns-alpha-background.patch
Normal file
@@ -0,0 +1,487 @@
|
||||
From 9b436ccb00ea321fe778ea51cf1ad536aff7210f Mon Sep 17 00:00:00 2001
|
||||
From: Jon Rubens <jonathanrubens@gmail.com>
|
||||
Date: Wed, 24 Jan 2024 19:45:55 -0800
|
||||
Subject: [PATCH 1/3] Enable frame parameter alpha_background for MacOS
|
||||
|
||||
---
|
||||
src/macfont.m | 10 ++++++++--
|
||||
src/nsfns.m | 42 ++++++++++++++++++++++++++++++++++--------
|
||||
src/nsterm.m | 42 ++++++++++++++++++++++--------------------
|
||||
3 files changed, 64 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/src/macfont.m b/src/macfont.m
|
||||
index 8aba440d196e..56c1eb57024e 100644
|
||||
--- a/src/macfont.m
|
||||
+++ b/src/macfont.m
|
||||
@@ -2953,9 +2953,14 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|
||||
CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
|
||||
else
|
||||
CG_SET_FILL_COLOR_WITH_FRAME_CURSOR (context, f);
|
||||
- }
|
||||
+ CGContextSetAlpha(context, 1);
|
||||
+ }
|
||||
else
|
||||
- CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
|
||||
+ {
|
||||
+ CGContextSetAlpha(context, f->alpha_background);
|
||||
+ CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
|
||||
+ }
|
||||
+ CGContextClearRect(context, background_rect);
|
||||
CGContextFillRects (context, &background_rect, 1);
|
||||
}
|
||||
|
||||
@@ -2964,6 +2969,7 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|
||||
CGAffineTransform atfm;
|
||||
|
||||
CGContextScaleCTM (context, 1, -1);
|
||||
+ CGContextSetAlpha(context, 1);
|
||||
if (s->hl == DRAW_CURSOR)
|
||||
{
|
||||
if (face && (NS_FACE_BACKGROUND (face)
|
||||
diff --git a/src/nsfns.m b/src/nsfns.m
|
||||
index b0281aac2572..3e19cce89de9 100644
|
||||
--- a/src/nsfns.m
|
||||
+++ b/src/nsfns.m
|
||||
@@ -301,7 +301,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
struct face *face;
|
||||
NSColor *col;
|
||||
NSView *view = FRAME_NS_VIEW (f);
|
||||
- EmacsCGFloat alpha;
|
||||
+ EmacsCGFloat alpha = f->alpha_background;
|
||||
|
||||
block_input ();
|
||||
if (ns_lisp_to_color (arg, &col))
|
||||
@@ -316,11 +316,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
f->output_data.ns->background_color = col;
|
||||
|
||||
FRAME_BACKGROUND_PIXEL (f) = [col unsignedLong];
|
||||
- alpha = [col alphaComponent];
|
||||
|
||||
if (view != nil)
|
||||
{
|
||||
- [[view window] setBackgroundColor: col];
|
||||
+ [[view window] setBackgroundColor: [col colorWithAlphaComponent: alpha]];
|
||||
|
||||
if (alpha != (EmacsCGFloat) 1.0)
|
||||
[[view window] setOpaque: NO];
|
||||
@@ -330,10 +329,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
face = FRAME_DEFAULT_FACE (f);
|
||||
if (face)
|
||||
{
|
||||
- col = [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)];
|
||||
- face->background = [[col colorWithAlphaComponent: alpha]
|
||||
- unsignedLong];
|
||||
-
|
||||
+ face->background = [col unsignedLong];
|
||||
update_face_from_frame_parameter (f, Qbackground_color, arg);
|
||||
}
|
||||
|
||||
@@ -346,6 +342,36 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
unblock_input ();
|
||||
}
|
||||
|
||||
+static void
|
||||
+ns_set_alpha_background (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
+{
|
||||
+ NSView *view = FRAME_NS_VIEW (f);
|
||||
+ double alpha = 1.0;
|
||||
+
|
||||
+ if (NILP (arg))
|
||||
+ alpha = 1.0;
|
||||
+ else if (FLOATP (arg))
|
||||
+ {
|
||||
+ alpha = XFLOAT_DATA (arg);
|
||||
+ if (! (0 <= alpha && alpha <= 1.0))
|
||||
+ args_out_of_range (make_float (0.0), make_float (1.0));
|
||||
+ }
|
||||
+ else if (FIXNUMP (arg))
|
||||
+ {
|
||||
+ EMACS_INT ialpha = XFIXNUM (arg);
|
||||
+ if (! (0 <= ialpha && ialpha <= 100))
|
||||
+ args_out_of_range (make_fixnum (0), make_fixnum (100));
|
||||
+ alpha = ialpha / 100.0;
|
||||
+ }
|
||||
+ else
|
||||
+ wrong_type_argument (Qnumberp, arg);
|
||||
+
|
||||
+ f->alpha_background = alpha;
|
||||
+ [[view window] setBackgroundColor: [f->output_data.ns->background_color
|
||||
+ colorWithAlphaComponent: alpha]];
|
||||
+ recompute_basic_faces (f);
|
||||
+ SET_FRAME_GARBAGED (f);
|
||||
+}
|
||||
|
||||
static void
|
||||
ns_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
|
||||
@@ -1065,7 +1091,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
ns_set_z_group,
|
||||
0, /* x_set_override_redirect */
|
||||
gui_set_no_special_glyphs,
|
||||
- gui_set_alpha_background,
|
||||
+ ns_set_alpha_background,
|
||||
NULL,
|
||||
#ifdef NS_IMPL_COCOA
|
||||
ns_set_appearance,
|
||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||
index 518b38658d17..bda3a12172f5 100644
|
||||
--- a/src/nsterm.m
|
||||
+++ b/src/nsterm.m
|
||||
@@ -2618,8 +2618,9 @@ Hide the window (X11 semantics)
|
||||
|
||||
block_input ();
|
||||
ns_focus (f, &r, 1);
|
||||
- [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND
|
||||
- (FACE_FROM_ID (f, DEFAULT_FACE_ID))] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND
|
||||
+ (FACE_FROM_ID (f, DEFAULT_FACE_ID))]
|
||||
+ colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (r);
|
||||
ns_unfocus (f);
|
||||
|
||||
@@ -2647,7 +2648,7 @@ Hide the window (X11 semantics)
|
||||
|
||||
r = NSIntersectionRect (r, [view frame]);
|
||||
ns_focus (f, &r, 1);
|
||||
- [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: f->alpha_background] set];
|
||||
|
||||
NSRectFill (r);
|
||||
|
||||
@@ -2751,7 +2752,7 @@ Hide the window (X11 semantics)
|
||||
return;
|
||||
|
||||
ns_focus (f, NULL, 1);
|
||||
- [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (NSMakeRect (0, margin, width, border));
|
||||
NSRectFill (NSMakeRect (0, 0, border, height));
|
||||
NSRectFill (NSMakeRect (0, margin, width, border));
|
||||
@@ -2802,7 +2803,7 @@ Hide the window (X11 semantics)
|
||||
NSRect r = NSMakeRect (0, y, FRAME_PIXEL_WIDTH (f), height);
|
||||
ns_focus (f, &r, 1);
|
||||
|
||||
- [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (NSMakeRect (0, y, width, height));
|
||||
NSRectFill (NSMakeRect (FRAME_PIXEL_WIDTH (f) - width,
|
||||
y, width, height));
|
||||
@@ -2966,8 +2967,7 @@ Hide the window (X11 semantics)
|
||||
if (! NSIsEmptyRect (clearRect))
|
||||
{
|
||||
NSTRACE_RECT ("clearRect", clearRect);
|
||||
-
|
||||
- [[NSColor colorWithUnsignedLong:face->background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:face->background] colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (clearRect);
|
||||
}
|
||||
|
||||
@@ -2998,7 +2998,7 @@ Hide the window (X11 semantics)
|
||||
else
|
||||
bm_color = f->output_data.ns->cursor_color;
|
||||
|
||||
- [bm_color set];
|
||||
+ [[bm_color colorWithAlphaComponent:f->alpha_background] set];
|
||||
[bmp fill];
|
||||
|
||||
[bmp release];
|
||||
@@ -3719,7 +3719,7 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color)
|
||||
{
|
||||
ns_draw_box (r, abs (hthickness), abs (vthickness),
|
||||
- [NSColor colorWithUnsignedLong:face->box_color],
|
||||
+ [[NSColor colorWithUnsignedLong:face->box_color] colorWithAlphaComponent: s->f->alpha_background],
|
||||
left_p, right_p);
|
||||
}
|
||||
else
|
||||
@@ -3757,8 +3757,10 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
{
|
||||
if (s->hl != DRAW_CURSOR)
|
||||
[(NS_FACE_BACKGROUND (face) != 0
|
||||
- ? [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
|
||||
+ ? [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background]
|
||||
: FRAME_BACKGROUND_COLOR (s->f)) set];
|
||||
+
|
||||
else if (face && (NS_FACE_BACKGROUND (face)
|
||||
== [(NSColor *) FRAME_CURSOR_COLOR (s->f)
|
||||
unsignedLong]))
|
||||
@@ -3902,7 +3904,7 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
otherwise, since we composite the image under NS (instead of mucking
|
||||
with its background color), we must clear just the image area. */
|
||||
|
||||
- [[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
|
||||
if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
|
||||
|| s->img->mask || s->img->pixmap == 0 || s->width != s->background_width)
|
||||
@@ -3972,7 +3974,7 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
if (s->hl == DRAW_CURSOR)
|
||||
{
|
||||
[FRAME_CURSOR_COLOR (s->f) set];
|
||||
- tdCol = [NSColor colorWithUnsignedLong: NS_FACE_BACKGROUND (face)];
|
||||
+ tdCol = [[NSColor colorWithUnsignedLong: NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: s->f->alpha_background];
|
||||
}
|
||||
else
|
||||
tdCol = [NSColor colorWithUnsignedLong: NS_FACE_FOREGROUND (face)];
|
||||
@@ -4066,10 +4068,10 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
|
||||
prepare_face_for_display (s->f, face);
|
||||
|
||||
- [[NSColor colorWithUnsignedLong: face->background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong: face->background] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
}
|
||||
else
|
||||
- [[NSColor colorWithUnsignedLong: s->face->background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong: s->face->background] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
NSRectFill (NSMakeRect (x, y, w, h));
|
||||
}
|
||||
}
|
||||
@@ -4095,7 +4097,7 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
if (s->hl == DRAW_CURSOR)
|
||||
[FRAME_CURSOR_COLOR (s->f) set];
|
||||
else
|
||||
- [[NSColor colorWithUnsignedLong: s->face->background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong: s->face->background] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
|
||||
NSRectFill (NSMakeRect (x, s->y, background_width, s->height));
|
||||
}
|
||||
@@ -8436,8 +8438,8 @@ - (void)toggleFullScreen: (id)sender
|
||||
}
|
||||
|
||||
[w setContentView:[fw contentView]];
|
||||
- [w setBackgroundColor: col];
|
||||
- if ([col alphaComponent] != (EmacsCGFloat) 1.0)
|
||||
+ [w setBackgroundColor: [col colorWithAlphaComponent: f->alpha_background]];
|
||||
+ if (f->alpha_background != (EmacsCGFloat) 1.0)
|
||||
[w setOpaque: NO];
|
||||
|
||||
f->border_width = [w borderWidth];
|
||||
@@ -9172,9 +9174,9 @@ - (instancetype) initWithEmacsFrame: (struct frame *) f
|
||||
f->border_width = [self borderWidth];
|
||||
|
||||
col = [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND
|
||||
- (FACE_FROM_ID (f, DEFAULT_FACE_ID))];
|
||||
- [self setBackgroundColor:col];
|
||||
- if ([col alphaComponent] != (EmacsCGFloat) 1.0)
|
||||
+ (FACE_FROM_ID (f, DEFAULT_FACE_ID))];
|
||||
+ [self setBackgroundColor:[col colorWithAlphaComponent:f->alpha_background]];
|
||||
+ if (f->alpha_background != (EmacsCGFloat) 1.0)
|
||||
[self setOpaque:NO];
|
||||
|
||||
/* toolbar support */
|
||||
|
||||
From 58cf6e6da20eefca161c1ab1fd0d6ad67d1ba710 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Rubens <jonathanrubens@gmail.com>
|
||||
Date: Fri, 26 Jan 2024 09:35:15 -0800
|
||||
Subject: [PATCH 2/3] Fix code formatting
|
||||
|
||||
---
|
||||
src/macfont.m | 8 ++++----
|
||||
src/nsterm.m | 30 ++++++++++++++++++++----------
|
||||
2 files changed, 24 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/macfont.m b/src/macfont.m
|
||||
index 56c1eb57024e..8fb835c7ff01 100644
|
||||
--- a/src/macfont.m
|
||||
+++ b/src/macfont.m
|
||||
@@ -2953,14 +2953,14 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|
||||
CG_SET_FILL_COLOR_WITH_FACE_FOREGROUND (context, face);
|
||||
else
|
||||
CG_SET_FILL_COLOR_WITH_FRAME_CURSOR (context, f);
|
||||
- CGContextSetAlpha(context, 1);
|
||||
+ CGContextSetAlpha (context, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
- CGContextSetAlpha(context, f->alpha_background);
|
||||
+ CGContextSetAlpha (context, f->alpha_background);
|
||||
CG_SET_FILL_COLOR_WITH_FACE_BACKGROUND (context, face);
|
||||
}
|
||||
- CGContextClearRect(context, background_rect);
|
||||
+ CGContextClearRect (context, background_rect);
|
||||
CGContextFillRects (context, &background_rect, 1);
|
||||
}
|
||||
|
||||
@@ -2969,7 +2969,7 @@ So we use CTFontDescriptorCreateMatchingFontDescriptor (no
|
||||
CGAffineTransform atfm;
|
||||
|
||||
CGContextScaleCTM (context, 1, -1);
|
||||
- CGContextSetAlpha(context, 1);
|
||||
+ CGContextSetAlpha (context, 1);
|
||||
if (s->hl == DRAW_CURSOR)
|
||||
{
|
||||
if (face && (NS_FACE_BACKGROUND (face)
|
||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||
index bda3a12172f5..9ab3ff8f783f 100644
|
||||
--- a/src/nsterm.m
|
||||
+++ b/src/nsterm.m
|
||||
@@ -2803,7 +2803,8 @@ Hide the window (X11 semantics)
|
||||
NSRect r = NSMakeRect (0, y, FRAME_PIXEL_WIDTH (f), height);
|
||||
ns_focus (f, &r, 1);
|
||||
|
||||
- [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
|
||||
+ colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (NSMakeRect (0, y, width, height));
|
||||
NSRectFill (NSMakeRect (FRAME_PIXEL_WIDTH (f) - width,
|
||||
y, width, height));
|
||||
@@ -2967,7 +2968,8 @@ Hide the window (X11 semantics)
|
||||
if (! NSIsEmptyRect (clearRect))
|
||||
{
|
||||
NSTRACE_RECT ("clearRect", clearRect);
|
||||
- [[[NSColor colorWithUnsignedLong:face->background] colorWithAlphaComponent: f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:face->background]
|
||||
+ colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (clearRect);
|
||||
}
|
||||
|
||||
@@ -3719,7 +3721,8 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
if (s->face->box == FACE_SIMPLE_BOX && s->face->box_color)
|
||||
{
|
||||
ns_draw_box (r, abs (hthickness), abs (vthickness),
|
||||
- [[NSColor colorWithUnsignedLong:face->box_color] colorWithAlphaComponent: s->f->alpha_background],
|
||||
+ [[NSColor colorWithUnsignedLong:face->box_color]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background],
|
||||
left_p, right_p);
|
||||
}
|
||||
else
|
||||
@@ -3904,7 +3907,8 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
otherwise, since we composite the image under NS (instead of mucking
|
||||
with its background color), we must clear just the image area. */
|
||||
|
||||
- [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
|
||||
if (bg_height > s->slice.height || s->img->hmargin || s->img->vmargin
|
||||
|| s->img->mask || s->img->pixmap == 0 || s->width != s->background_width)
|
||||
@@ -3974,7 +3978,8 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
if (s->hl == DRAW_CURSOR)
|
||||
{
|
||||
[FRAME_CURSOR_COLOR (s->f) set];
|
||||
- tdCol = [[NSColor colorWithUnsignedLong: NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: s->f->alpha_background];
|
||||
+ tdCol = [[NSColor colorWithUnsignedLong: NS_FACE_BACKGROUND (face)]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background];
|
||||
}
|
||||
else
|
||||
tdCol = [NSColor colorWithUnsignedLong: NS_FACE_FOREGROUND (face)];
|
||||
@@ -4068,10 +4073,12 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
face = FACE_FROM_ID (s->f, MOUSE_FACE_ID);
|
||||
prepare_face_for_display (s->f, face);
|
||||
|
||||
- [[[NSColor colorWithUnsignedLong: face->background] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong: face->background]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
}
|
||||
else
|
||||
- [[[NSColor colorWithUnsignedLong: s->face->background] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong: s->face->background]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
NSRectFill (NSMakeRect (x, y, w, h));
|
||||
}
|
||||
}
|
||||
@@ -4097,7 +4104,8 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
if (s->hl == DRAW_CURSOR)
|
||||
[FRAME_CURSOR_COLOR (s->f) set];
|
||||
else
|
||||
- [[[NSColor colorWithUnsignedLong: s->face->background] colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong: s->face->background]
|
||||
+ colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
|
||||
NSRectFill (NSMakeRect (x, s->y, background_width, s->height));
|
||||
}
|
||||
@@ -8438,7 +8446,8 @@ - (void)toggleFullScreen: (id)sender
|
||||
}
|
||||
|
||||
[w setContentView:[fw contentView]];
|
||||
- [w setBackgroundColor: [col colorWithAlphaComponent: f->alpha_background]];
|
||||
+ [w setBackgroundColor: [col colorWithAlphaComponent:
|
||||
+ f->alpha_background]];
|
||||
if (f->alpha_background != (EmacsCGFloat) 1.0)
|
||||
[w setOpaque: NO];
|
||||
|
||||
@@ -9175,7 +9184,8 @@ - (instancetype) initWithEmacsFrame: (struct frame *) f
|
||||
|
||||
col = [NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND
|
||||
(FACE_FROM_ID (f, DEFAULT_FACE_ID))];
|
||||
- [self setBackgroundColor:[col colorWithAlphaComponent:f->alpha_background]];
|
||||
+ [self setBackgroundColor:
|
||||
+ [col colorWithAlphaComponent:f->alpha_background]];
|
||||
if (f->alpha_background != (EmacsCGFloat) 1.0)
|
||||
[self setOpaque:NO];
|
||||
|
||||
|
||||
From 896596aac2932ab98dbeb68f48a963275fdb76c5 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Rubens <jonathanrubens@gmail.com>
|
||||
Date: Wed, 31 Jan 2024 13:30:13 -0800
|
||||
Subject: [PATCH 3/3] More code formatting
|
||||
|
||||
---
|
||||
src/nsfns.m | 11 ++++++-----
|
||||
src/nsterm.m | 8 +++++---
|
||||
2 files changed, 11 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/nsfns.m b/src/nsfns.m
|
||||
index 3e19cce89de9..67d8449c70dd 100644
|
||||
--- a/src/nsfns.m
|
||||
+++ b/src/nsfns.m
|
||||
@@ -321,11 +321,6 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
{
|
||||
[[view window] setBackgroundColor: [col colorWithAlphaComponent: alpha]];
|
||||
|
||||
- if (alpha != (EmacsCGFloat) 1.0)
|
||||
- [[view window] setOpaque: NO];
|
||||
- else
|
||||
- [[view window] setOpaque: YES];
|
||||
-
|
||||
face = FRAME_DEFAULT_FACE (f);
|
||||
if (face)
|
||||
{
|
||||
@@ -369,6 +364,12 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
||||
f->alpha_background = alpha;
|
||||
[[view window] setBackgroundColor: [f->output_data.ns->background_color
|
||||
colorWithAlphaComponent: alpha]];
|
||||
+
|
||||
+ if (alpha != (EmacsCGFloat) 1.0)
|
||||
+ [[view window] setOpaque: NO];
|
||||
+ else
|
||||
+ [[view window] setOpaque: YES];
|
||||
+
|
||||
recompute_basic_faces (f);
|
||||
SET_FRAME_GARBAGED (f);
|
||||
}
|
||||
diff --git a/src/nsterm.m b/src/nsterm.m
|
||||
index 9ab3ff8f783f..6feef6236449 100644
|
||||
--- a/src/nsterm.m
|
||||
+++ b/src/nsterm.m
|
||||
@@ -2648,9 +2648,11 @@ Hide the window (X11 semantics)
|
||||
|
||||
r = NSIntersectionRect (r, [view frame]);
|
||||
ns_focus (f, &r, 1);
|
||||
- [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
|
||||
+ colorWithAlphaComponent: f->alpha_background] set];
|
||||
|
||||
NSRectFill (r);
|
||||
+ [[view window] invalidateShadow];
|
||||
|
||||
ns_unfocus (f);
|
||||
return;
|
||||
@@ -2752,7 +2754,8 @@ Hide the window (X11 semantics)
|
||||
return;
|
||||
|
||||
ns_focus (f, NULL, 1);
|
||||
- [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)] colorWithAlphaComponent: f->alpha_background] set];
|
||||
+ [[[NSColor colorWithUnsignedLong:NS_FACE_BACKGROUND (face)]
|
||||
+ colorWithAlphaComponent: f->alpha_background] set];
|
||||
NSRectFill (NSMakeRect (0, margin, width, border));
|
||||
NSRectFill (NSMakeRect (0, 0, border, height));
|
||||
NSRectFill (NSMakeRect (0, margin, width, border));
|
||||
@@ -4106,7 +4109,6 @@ Function modeled after x_draw_glyph_string_box ().
|
||||
else
|
||||
[[[NSColor colorWithUnsignedLong: s->face->background]
|
||||
colorWithAlphaComponent: s->f->alpha_background] set];
|
||||
-
|
||||
NSRectFill (NSMakeRect (x, s->y, background_width, s->height));
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,11 @@ func (s *ReleaseInfo) Asset(needles ...string) *ReleaseAsset {
|
||||
return assets[i].Filename < assets[j].Filename
|
||||
})
|
||||
|
||||
assetsLoop:
|
||||
for _, a := range assets {
|
||||
for _, needle := range needles {
|
||||
if !strings.Contains(a.Filename, needle) {
|
||||
continue
|
||||
continue assetsLoop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
80
pkg/cask/release_info_test.go
Normal file
80
pkg/cask/release_info_test.go
Normal file
@@ -0,0 +1,80 @@
|
||||
package cask
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestAsset(t *testing.T) {
|
||||
// Define test cases
|
||||
tests := []struct {
|
||||
name string
|
||||
release ReleaseInfo
|
||||
needles []string
|
||||
want *ReleaseAsset
|
||||
}{
|
||||
{
|
||||
name: "single needle, exact match",
|
||||
release: ReleaseInfo{
|
||||
Assets: map[string]*ReleaseAsset{
|
||||
"asset1": {Filename: "asset1.zip"},
|
||||
"asset2": {Filename: "asset2.zip"},
|
||||
},
|
||||
},
|
||||
needles: []string{"asset1"},
|
||||
want: &ReleaseAsset{Filename: "asset1.zip"},
|
||||
},
|
||||
{
|
||||
name: "multiple needles, all",
|
||||
release: ReleaseInfo{
|
||||
Assets: map[string]*ReleaseAsset{
|
||||
"asset1": {Filename: "asset1.zip"},
|
||||
"asset2": {Filename: "asset2.zip"},
|
||||
},
|
||||
},
|
||||
needles: []string{"zip", "asset1"},
|
||||
want: &ReleaseAsset{Filename: "asset1.zip"},
|
||||
},
|
||||
{
|
||||
name: "multiple needles, one match",
|
||||
release: ReleaseInfo{
|
||||
Assets: map[string]*ReleaseAsset{
|
||||
"asset1": {Filename: "asset1.zip"},
|
||||
"asset2": {Filename: "asset2.zip"},
|
||||
},
|
||||
},
|
||||
needles: []string{"rar", "asset2"},
|
||||
want: nil,
|
||||
},
|
||||
{
|
||||
name: "multiple needles, no match",
|
||||
release: ReleaseInfo{
|
||||
Assets: map[string]*ReleaseAsset{
|
||||
"asset1": {Filename: "asset1.zip"},
|
||||
"asset2": {Filename: "asset2.zip"},
|
||||
},
|
||||
},
|
||||
needles: []string{"rar", "asset3"},
|
||||
want: nil,
|
||||
},
|
||||
{
|
||||
name: "no needles",
|
||||
release: ReleaseInfo{
|
||||
Assets: map[string]*ReleaseAsset{
|
||||
"asset1": {Filename: "asset1.zip"},
|
||||
"asset2": {Filename: "asset2.zip"},
|
||||
},
|
||||
},
|
||||
needles: nil,
|
||||
want: &ReleaseAsset{Filename: "asset1.zip"},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got := tt.release.Asset(tt.needles...)
|
||||
|
||||
assert.Equal(t, tt.want, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@ func (s *Updater) createRepoFile(
|
||||
s.logger.Info(
|
||||
"new commit created",
|
||||
"commit", contResp.GetSHA(), "message", contResp.GetMessage(),
|
||||
"url", contResp.Commit.GetHTMLURL(),
|
||||
"url", contResp.GetHTMLURL(),
|
||||
)
|
||||
|
||||
return nil
|
||||
@@ -354,12 +354,13 @@ func (s *Updater) updateRepoFile(
|
||||
s.logger.Info(
|
||||
"new commit created",
|
||||
"commit", contResp.GetSHA(), "message", contResp.GetMessage(),
|
||||
"url", contResp.Commit.GetHTMLURL(),
|
||||
"url", contResp.GetHTMLURL(),
|
||||
)
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
//nolint:funlen
|
||||
func (s *Updater) renderCask(
|
||||
ctx context.Context,
|
||||
chk *LiveCheck,
|
||||
@@ -433,12 +434,24 @@ func (s *Updater) renderCask(
|
||||
}
|
||||
}
|
||||
|
||||
templateFile := filepath.Join(s.TemplatesDir, chk.Cask+".rb.tpl")
|
||||
tplContent, err := os.ReadFile(templateFile)
|
||||
tplContent, err := os.ReadFile(
|
||||
filepath.Join(s.TemplatesDir, chk.Cask+".rb.tpl"),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
helperContent, err := os.ReadFile(
|
||||
filepath.Join(s.TemplatesDir, "_helpers.tpl"),
|
||||
)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(helperContent) > 0 {
|
||||
tplContent = append(helperContent, tplContent...)
|
||||
}
|
||||
|
||||
tpl, err := template.New(chk.Cask).Parse(string(tplContent))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -25,9 +25,9 @@ func notarizeCmd() *cli2.Command {
|
||||
EnvVars: []string{"AC_USERNAME"},
|
||||
},
|
||||
&cli2.StringFlag{
|
||||
Name: "ac-password",
|
||||
Usage: "Apple Connect password",
|
||||
Value: "@env:AC_PASSWORD",
|
||||
Name: "ac-password",
|
||||
Usage: "Apple Connect password",
|
||||
EnvVars: []string{"AC_PASSWORD"},
|
||||
},
|
||||
&cli2.StringFlag{
|
||||
Name: "ac-provider",
|
||||
|
||||
@@ -76,9 +76,9 @@ func packageCmd() *cli2.Command {
|
||||
EnvVars: []string{"AC_USERNAME"},
|
||||
},
|
||||
&cli2.StringFlag{
|
||||
Name: "ac-password",
|
||||
Usage: "(with --sign) Apple Connect password",
|
||||
Value: "@env:AC_PASSWORD",
|
||||
Name: "ac-password",
|
||||
Usage: "(with --sign) Apple Connect password",
|
||||
EnvVars: []string{"AC_PASSWORD"},
|
||||
},
|
||||
&cli2.StringFlag{
|
||||
Name: "ac-provider",
|
||||
|
||||
@@ -38,6 +38,10 @@ func planCmd() *cli2.Command {
|
||||
Name: "sha",
|
||||
Usage: "override commit SHA of specified git branch/tag",
|
||||
},
|
||||
&cli2.IntFlag{
|
||||
Name: "build-variant",
|
||||
Usage: "build variant to add to the end of the version string",
|
||||
},
|
||||
&cli2.StringFlag{
|
||||
Name: "format",
|
||||
Aliases: []string{"f"},
|
||||
@@ -90,6 +94,7 @@ func planAction(c *cli2.Context, opts *Options) error {
|
||||
EmacsRepo: c.String("emacs-repo"),
|
||||
Ref: ref,
|
||||
SHAOverride: c.String("sha"),
|
||||
BuildVariant: c.Int("build-variant"),
|
||||
OutputDir: c.String("output-dir"),
|
||||
TestBuild: c.String("test-build"),
|
||||
TestBuildType: plan.Prerelease,
|
||||
|
||||
@@ -110,6 +110,18 @@ func Create(ctx context.Context, opts *Options) (string, error) {
|
||||
})
|
||||
}
|
||||
|
||||
configureOutputFile := filepath.Join(sourceDir, "configure_output.txt")
|
||||
fi, err = os.Stat(configureOutputFile)
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return "", err
|
||||
} else if err == nil && fi.Mode().IsRegular() {
|
||||
settings.Files = append(settings.Files, &dmgbuild.File{
|
||||
Path: configureOutputFile,
|
||||
PosX: 340,
|
||||
PosY: 756,
|
||||
})
|
||||
}
|
||||
|
||||
if opts.Output != nil {
|
||||
settings.Stdout = opts.Output
|
||||
settings.Stderr = opts.Output
|
||||
|
||||
@@ -116,7 +116,6 @@ func NewLicense() License {
|
||||
return License{}
|
||||
}
|
||||
|
||||
//nolint:goconst
|
||||
func (s *License) Render() []string {
|
||||
var l []string
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/bearer/gon/notarize"
|
||||
"github.com/bearer/gon/staple"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/mitchellh/gon/notarize"
|
||||
"github.com/mitchellh/gon/staple"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
@@ -25,21 +25,23 @@ func Notarize(ctx context.Context, opts *Options) error {
|
||||
logger := hclog.FromContext(ctx).Named("notarize")
|
||||
|
||||
notarizeOpts := ¬arize.Options{
|
||||
File: opts.File,
|
||||
BundleId: opts.BundleID,
|
||||
Username: opts.Username,
|
||||
Password: opts.Password,
|
||||
Provider: opts.Provider,
|
||||
BaseCmd: exec.CommandContext(ctx, ""),
|
||||
File: opts.File,
|
||||
DeveloperId: opts.Username,
|
||||
Password: opts.Password,
|
||||
Provider: opts.Provider,
|
||||
BaseCmd: exec.CommandContext(ctx, ""),
|
||||
Status: &status{
|
||||
Lock: &sync.Mutex{},
|
||||
Logger: logger,
|
||||
},
|
||||
// Ensure we don't log anything from the notarize package, as it will
|
||||
// log the password. We'll handle logging ourselves.
|
||||
Logger: hclog.NewNullLogger(),
|
||||
}
|
||||
|
||||
logger.Info("notarizing", "file", filepath.Base(opts.File))
|
||||
|
||||
info, err := notarize.Notarize(ctx, notarizeOpts)
|
||||
info, _, err := notarize.Notarize(ctx, notarizeOpts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -68,9 +70,15 @@ type status struct {
|
||||
Lock *sync.Mutex
|
||||
Logger hclog.Logger
|
||||
|
||||
lastStatusTime time.Time
|
||||
lastinfoStatus string
|
||||
lastInfoStatusTime time.Time
|
||||
|
||||
lastLogStatus string
|
||||
lastLogStatusTime time.Time
|
||||
}
|
||||
|
||||
var _ notarize.Status = (*status)(nil)
|
||||
|
||||
func (s *status) Submitting() {
|
||||
s.Lock.Lock()
|
||||
defer s.Lock.Unlock()
|
||||
@@ -82,17 +90,34 @@ func (s *status) Submitted(uuid string) {
|
||||
s.Lock.Lock()
|
||||
defer s.Lock.Unlock()
|
||||
|
||||
s.Logger.Info("submitted")
|
||||
s.Logger.Debug("request", "uuid", uuid)
|
||||
s.Logger.Info("waiting for result from Apple...")
|
||||
msg := "submitted, waiting for result from Apple"
|
||||
if s.Logger.IsDebug() {
|
||||
s.Logger.Debug(msg, "uuid", uuid)
|
||||
} else {
|
||||
s.Logger.Info(msg)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *status) Status(info notarize.Info) {
|
||||
func (s *status) InfoStatus(info notarize.Info) {
|
||||
s.Lock.Lock()
|
||||
defer s.Lock.Unlock()
|
||||
|
||||
if time.Now().After(s.lastStatusTime.Add(60 * time.Second)) {
|
||||
s.lastStatusTime = time.Now()
|
||||
if s.lastinfoStatus != info.Status ||
|
||||
time.Now().After(s.lastInfoStatusTime.Add(60*time.Second)) {
|
||||
s.lastinfoStatus = info.Status
|
||||
s.lastInfoStatusTime = time.Now()
|
||||
s.Logger.Info("status update", "status", info.Status)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *status) LogStatus(log notarize.Log) {
|
||||
s.Lock.Lock()
|
||||
defer s.Lock.Unlock()
|
||||
|
||||
if s.lastLogStatus != log.Status ||
|
||||
time.Now().After(s.lastLogStatusTime.Add(60*time.Second)) {
|
||||
s.lastLogStatus = log.Status
|
||||
s.lastLogStatusTime = time.Now()
|
||||
s.Logger.Info("log status update", "status", log.Status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,50 +1,71 @@
|
||||
package osinfo
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type OSInfo struct {
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Version string `yaml:"version" json:"version"`
|
||||
Arch string `yaml:"arch" json:"arch"`
|
||||
Name string `yaml:"name" json:"name"`
|
||||
Version string `yaml:"version" json:"version"`
|
||||
SDKVersion string `yaml:"sdk_version" json:"sdk_version"`
|
||||
Arch string `yaml:"arch" json:"arch"`
|
||||
}
|
||||
|
||||
func New() (*OSInfo, error) {
|
||||
version, err := exec.Command("sw_vers", "-productVersion").CombinedOutput()
|
||||
version, err := exec.Command("sw_vers", "-productVersion").Output()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sdkVersion := os.Getenv("MACOSX_DEPLOYMENT_TARGET")
|
||||
if sdkVersion == "" {
|
||||
var ver []byte
|
||||
ver, err = exec.Command("xcrun", "--show-sdk-version").Output()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sdkVersion = string(ver)
|
||||
}
|
||||
|
||||
arch, err := exec.Command("uname", "-m").CombinedOutput()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &OSInfo{
|
||||
Name: "macOS",
|
||||
Version: strings.TrimSpace(string(version)),
|
||||
Arch: strings.TrimSpace(string(arch)),
|
||||
Name: "macOS",
|
||||
Version: strings.TrimSpace(string(version)),
|
||||
SDKVersion: strings.TrimSpace(sdkVersion),
|
||||
Arch: strings.TrimSpace(string(arch)),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DistinctVersion returns macOS version down to a distinct "major"
|
||||
// version. For macOS 10.x, this will include the first two numeric parts of the
|
||||
// version (10.15), while for 11.x and later, the first numeric part is enough
|
||||
// (11).
|
||||
// DistinctVersion returns macOS version down to a distinct "major" version. For
|
||||
// macOS 10.x, this will include the first two numeric parts of the version
|
||||
// (10.15), while for 11.x and later, the first numeric part is enough (11).
|
||||
func (s *OSInfo) DistinctVersion() string {
|
||||
parts := strings.Split(s.Version, ".")
|
||||
return s.distinctVersion(s.Version)
|
||||
}
|
||||
|
||||
// DistinctSDKVersion returns macOS version down to a distinct "major" version.
|
||||
// For macOS 10.x, this will include the first two numeric parts of the version
|
||||
// (10.15), while for 11.x and later, the first numeric part is enough (11).
|
||||
func (s *OSInfo) DistinctSDKVersion() string {
|
||||
return s.distinctVersion(s.SDKVersion)
|
||||
}
|
||||
|
||||
func (s *OSInfo) distinctVersion(version string) string {
|
||||
parts := strings.Split(version, ".")
|
||||
|
||||
if n, _ := strconv.Atoi(parts[0]); n >= 11 {
|
||||
return parts[0]
|
||||
}
|
||||
|
||||
max := len(parts)
|
||||
if max > 2 {
|
||||
max = 2
|
||||
}
|
||||
end := min(len(parts), 2)
|
||||
|
||||
return strings.Join(parts[0:max], ".")
|
||||
return strings.Join(parts[0:end], ".")
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ type Options struct {
|
||||
EmacsRepo string
|
||||
Ref string
|
||||
SHAOverride string
|
||||
BuildVariant int
|
||||
OutputDir string
|
||||
TestBuild string
|
||||
TestBuildType TestBuildType
|
||||
@@ -95,10 +96,23 @@ func Create(ctx context.Context, opts *Options) (*Plan, error) { //nolint:funlen
|
||||
releaseName = "Emacs." + version
|
||||
}
|
||||
|
||||
if opts.BuildVariant != 0 {
|
||||
variant := strconv.Itoa(opts.BuildVariant)
|
||||
absoluteVersion += "-" + variant
|
||||
releaseName += "-" + variant
|
||||
}
|
||||
|
||||
// Attempt to get the macOS SDK version from the environment, if it's not
|
||||
// available, use the version from the system.
|
||||
targetMacOSVersion := osInfo.DistinctSDKVersion()
|
||||
if targetMacOSVersion == "" {
|
||||
targetMacOSVersion = osInfo.DistinctVersion()
|
||||
}
|
||||
|
||||
buildName := fmt.Sprintf(
|
||||
"Emacs.%s.%s.%s",
|
||||
absoluteVersion,
|
||||
sanitize.String(osInfo.Name+"-"+osInfo.DistinctVersion()),
|
||||
sanitize.String(osInfo.Name+"-"+targetMacOSVersion),
|
||||
sanitize.String(osInfo.Arch),
|
||||
)
|
||||
diskImage := buildName + ".dmg"
|
||||
@@ -132,7 +146,7 @@ func Create(ctx context.Context, opts *Options) (*Plan, error) { //nolint:funlen
|
||||
|
||||
plan.Build.Name += ".test." + testName
|
||||
plan.Release.Title = "Test Builds (" + testName + ")"
|
||||
plan.Release.Name = "test-builds"
|
||||
plan.Release.Name = "test-builds-" + testName
|
||||
|
||||
plan.Release.Prerelease = false
|
||||
plan.Release.Draft = true
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Errors
|
||||
@@ -18,8 +17,9 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
stableVersion = regexp.MustCompile(`^\d+\.\d+(?:[a-z]+)?$`)
|
||||
stableGitRef = regexp.MustCompile(`^emacs-(\d+\.\d+(?:[a-z]+)?)$`)
|
||||
stableVersion = regexp.MustCompile(`^\d+\.\d+(?:[a-z]+)?(-\d+)?$`)
|
||||
pretestVersion = regexp.MustCompile(`-pretest(-\d+)?$`)
|
||||
stableGitRef = regexp.MustCompile(`^emacs-(\d+\.\d+(?:[a-z]+)?)$`)
|
||||
)
|
||||
|
||||
func VersionToName(version string) (string, error) {
|
||||
@@ -28,7 +28,7 @@ func VersionToName(version string) (string, error) {
|
||||
}
|
||||
|
||||
if stableVersion.MatchString(version) ||
|
||||
strings.HasSuffix(version, "-pretest") {
|
||||
pretestVersion.MatchString(version) {
|
||||
return "Emacs-" + version, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,27 @@ func TestVersionToName(t *testing.T) {
|
||||
},
|
||||
want: "Emacs.2021-07-01.1b88404.master",
|
||||
},
|
||||
{
|
||||
name: "nightly with variant",
|
||||
args: args{
|
||||
version: "2021-07-01.1b88404.master-1",
|
||||
},
|
||||
want: "Emacs.2021-07-01.1b88404.master-1",
|
||||
},
|
||||
{
|
||||
name: "pretest",
|
||||
args: args{
|
||||
version: "30.0.93-pretest",
|
||||
},
|
||||
want: "Emacs-30.0.93-pretest",
|
||||
},
|
||||
{
|
||||
name: "pretest with variant",
|
||||
args: args{
|
||||
version: "30.0.93-pretest-1",
|
||||
},
|
||||
want: "Emacs-30.0.93-pretest-1",
|
||||
},
|
||||
{
|
||||
name: "stable",
|
||||
args: args{
|
||||
@@ -44,6 +65,20 @@ func TestVersionToName(t *testing.T) {
|
||||
},
|
||||
want: "Emacs-23.3b",
|
||||
},
|
||||
{
|
||||
name: "stable with variant",
|
||||
args: args{
|
||||
version: "23.3-1",
|
||||
},
|
||||
want: "Emacs-23.3-1",
|
||||
},
|
||||
{
|
||||
name: "stable with letter and variant",
|
||||
args: args{
|
||||
version: "23.3b-1",
|
||||
},
|
||||
want: "Emacs-23.3b-1",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
@@ -123,7 +123,7 @@ func signCLIHelper(ctx context.Context, appBundle string, opts *Options) error {
|
||||
// app bundle itself.
|
||||
func elnFiles(emacsApp string) ([]string, error) {
|
||||
var files []string
|
||||
walkDirFunc := func(path string, d fs.DirEntry, _err error) error {
|
||||
walkDirFunc := func(path string, d fs.DirEntry, _ error) error {
|
||||
if d.Type().IsRegular() && strings.HasSuffix(path, ".eln") &&
|
||||
!strings.Contains(path, ".app/Contents/Frameworks/") {
|
||||
files = append(files, path)
|
||||
|
||||
Reference in New Issue
Block a user