mirror of
https://github.com/jimeh/build-emacs-for-macos.git
synced 2026-02-19 13:06:38 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
387c2c40aa
|
|||
|
527f855fbf
|
|||
|
aafac57b1d
|
|||
|
|
4367d6b80e | ||
|
b5ed3887c1
|
|||
|
607076a91b
|
|||
|
1cda2cc3ff
|
|||
|
|
39a4868313 | ||
|
2086a773ae
|
|||
|
|
68ecce6158 | ||
|
7aa4058128
|
|||
|
|
67ad73e500 | ||
| 8ac1f946dd | |||
|
|
cc38319b40 | ||
| e8885400e6 | |||
|
|
00015d861f | ||
| ca8b874be2 | |||
|
5d36f02cca
|
|||
|
5c37e8b0a2
|
|||
| 28ff28b29a | |||
| 3cf1977def | |||
|
bc2a45767e
|
|||
|
|
2320030121 | ||
| c53c398cac | |||
|
|
f7b2baa363 | ||
|
d396165808
|
|||
| 66ccd9c6fd | |||
|
|
907f7babbc | ||
|
e030fee670
|
|||
|
|
0ea0596f69 | ||
| 03ed54ca78 |
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
".": "0.6.53"
|
".": "0.6.63"
|
||||||
}
|
}
|
||||||
|
|||||||
1
.github/release-please-config.json
vendored
1
.github/release-please-config.json
vendored
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"bootstrap-sha": "3d6c7fff64bda8ba0dbea181c9f94fb9716dd188",
|
"bootstrap-sha": "3d6c7fff64bda8ba0dbea181c9f94fb9716dd188",
|
||||||
|
"always-update": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
".": {
|
".": {
|
||||||
"release-type": "simple",
|
"release-type": "simple",
|
||||||
|
|||||||
23
.github/workflows/ci.yml
vendored
23
.github/workflows/ci.yml
vendored
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
name: CI
|
name: CI
|
||||||
on: [push]
|
on: [push]
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@@ -10,11 +12,11 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.23"
|
go-version-file: go.mod
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v6
|
uses: golangci/golangci-lint-action@v8
|
||||||
with:
|
with:
|
||||||
version: v1.61
|
version: v2.1
|
||||||
env:
|
env:
|
||||||
VERBOSE: "true"
|
VERBOSE: "true"
|
||||||
|
|
||||||
@@ -25,7 +27,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.23"
|
go-version-file: go.mod
|
||||||
- name: Check if mods are tidy
|
- name: Check if mods are tidy
|
||||||
run: make check-tidy
|
run: make check-tidy
|
||||||
|
|
||||||
@@ -36,14 +38,21 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.23"
|
go-version-file: go.mod
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: make test
|
run: make test
|
||||||
env:
|
env:
|
||||||
VERBOSE: "true"
|
VERBOSE: "true"
|
||||||
|
|
||||||
release-please:
|
release-please:
|
||||||
|
name: Release Please
|
||||||
runs-on: ubuntu-latest
|
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:
|
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 }}
|
||||||
|
|||||||
123
.golangci.yml
123
.golangci.yml
@@ -1,25 +1,9 @@
|
|||||||
linters-settings:
|
version: "2"
|
||||||
funlen:
|
run:
|
||||||
lines: 100
|
modules-download-mode: readonly
|
||||||
statements: 150
|
allow-parallel-runners: true
|
||||||
goconst:
|
|
||||||
min-occurrences: 5
|
|
||||||
gocyclo:
|
|
||||||
min-complexity: 20
|
|
||||||
govet:
|
|
||||||
enable-all: true
|
|
||||||
disable:
|
|
||||||
- fieldalignment
|
|
||||||
lll:
|
|
||||||
line-length: 80
|
|
||||||
tab-width: 4
|
|
||||||
maligned:
|
|
||||||
suggest-new: true
|
|
||||||
misspell:
|
|
||||||
locale: US
|
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
default: none
|
||||||
enable:
|
enable:
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- copyloopvar
|
- copyloopvar
|
||||||
@@ -30,12 +14,8 @@ linters:
|
|||||||
- goconst
|
- goconst
|
||||||
- gocritic
|
- gocritic
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- gofumpt
|
|
||||||
- goimports
|
|
||||||
- goprintffuncname
|
|
||||||
- goprintffuncname
|
- goprintffuncname
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- lll
|
- lll
|
||||||
@@ -47,36 +27,69 @@ linters:
|
|||||||
- revive
|
- revive
|
||||||
- sqlclosecheck
|
- sqlclosecheck
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- typecheck
|
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
- unused
|
||||||
- whitespace
|
- whitespace
|
||||||
|
settings:
|
||||||
issues:
|
funlen:
|
||||||
exclude:
|
lines: 100
|
||||||
- Using the variable on range scope `tt` in function literal
|
statements: 150
|
||||||
- Using the variable on range scope `tc` in function literal
|
goconst:
|
||||||
exclude-rules:
|
min-occurrences: 5
|
||||||
- path: "_test\\.go"
|
gocyclo:
|
||||||
linters:
|
min-complexity: 20
|
||||||
- funlen
|
govet:
|
||||||
- dupl
|
disable:
|
||||||
- goconst
|
- fieldalignment
|
||||||
- source: "^//go:generate "
|
enable-all: true
|
||||||
linters:
|
lll:
|
||||||
- lll
|
line-length: 80
|
||||||
- source: "`json:"
|
tab-width: 4
|
||||||
linters:
|
misspell:
|
||||||
- lll
|
locale: US
|
||||||
- source: "`yaml:"
|
exclusions:
|
||||||
linters:
|
generated: lax
|
||||||
- lll
|
presets:
|
||||||
exclude-dirs:
|
- comments
|
||||||
- builds
|
- common-false-positives
|
||||||
- sources
|
- legacy
|
||||||
- tarballs
|
- std-error-handling
|
||||||
|
rules:
|
||||||
run:
|
- linters:
|
||||||
timeout: 2m
|
- dupl
|
||||||
allow-parallel-runners: true
|
- funlen
|
||||||
modules-download-mode: readonly
|
- 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$
|
||||||
|
|||||||
81
CHANGELOG.md
81
CHANGELOG.md
@@ -1,5 +1,86 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.6.63](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.62...v0.6.63) (2025-09-14)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **icon:** add support for custom application icons via --icon-uri option ([607076a](https://github.com/jimeh/build-emacs-for-macos/commit/607076a91bf0f227d16c9404f01a64144290685a))
|
||||||
|
* **icon:** add support for Tahoe icons with --tahoe-icon-uri and --tahoe-icon-name options ([b5ed388](https://github.com/jimeh/build-emacs-for-macos/commit/b5ed3887c172540de4a6190072b1e15f5d5efe2c))
|
||||||
|
|
||||||
|
## [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)
|
## [0.6.53](https://github.com/jimeh/build-emacs-for-macos/compare/v0.6.52...v0.6.53) (2024-12-01)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
80
CLAUDE.md
Normal file
80
CLAUDE.md
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with
|
||||||
|
code in this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
macOS Emacs building system with Ruby and Go components:
|
||||||
|
|
||||||
|
- **Ruby script** (`build-emacs-for-macos`): Main build script for creating
|
||||||
|
self-contained Emacs.app bundles
|
||||||
|
- **Go CLI tool** (`emacs-builder`): Packaging, signing, notarization, and
|
||||||
|
release management
|
||||||
|
- **Dual dependency management**: Nix (preferred) or Homebrew
|
||||||
|
|
||||||
|
## Common Commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Environment setup (Nix preferred)
|
||||||
|
nix develop # Default macOS 11 SDK
|
||||||
|
nix develop .#macos{11-15,26} # Target specific SDK version
|
||||||
|
|
||||||
|
# Go development
|
||||||
|
make build # Build emacs-builder CLI
|
||||||
|
make test # Run tests with race detection
|
||||||
|
make lint # Run golangci-lint
|
||||||
|
make format # Format with gofumpt
|
||||||
|
|
||||||
|
# Ruby development
|
||||||
|
bundle exec rubocop # Lint (with development group)
|
||||||
|
|
||||||
|
# Build Emacs
|
||||||
|
./build-emacs-for-macos # Build from master
|
||||||
|
./build-emacs-for-macos emacs-29.4
|
||||||
|
```
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Ruby Build Script (`build-emacs-for-macos`)
|
||||||
|
|
||||||
|
Single-file Ruby script (~2500 lines) that:
|
||||||
|
|
||||||
|
- Downloads source tarballs from emacs-mirror/emacs on GitHub
|
||||||
|
- Configures and compiles Emacs with native-comp, tree-sitter support
|
||||||
|
- Creates self-contained .app bundles by embedding/relinking dependencies
|
||||||
|
- Uses `ruby-macho` gem for Mach-O binary manipulation (RPATH handling)
|
||||||
|
|
||||||
|
### Go CLI (`cmd/emacs-builder/`)
|
||||||
|
|
||||||
|
Uses `urfave/cli/v2` framework. Key packages in `pkg/`:
|
||||||
|
|
||||||
|
- `cli/`: Commands (plan, sign, sign-files, notarize, package, release, cask)
|
||||||
|
- `sign/`: macOS code signing via `codesign`
|
||||||
|
- `notarize/`: Apple notarization workflow via `notarytool`
|
||||||
|
- `release/`: GitHub release management
|
||||||
|
- `dmgbuild/`: DMG creation using Python dmgbuild
|
||||||
|
- `plan/`: Build plan JSON parsing and management
|
||||||
|
|
||||||
|
### Nix Environment (`flake.nix`)
|
||||||
|
|
||||||
|
- Multi-SDK support: macOS 11-15, 26 via `.#macos{11,12,13,14,15,26}`
|
||||||
|
- Excludes ncurses intentionally (links against system version for TUI)
|
||||||
|
- Sets `MACOSX_DEPLOYMENT_TARGET`, `DEVELOPER_DIR`, `NIX_LIBGCCJIT_*`
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
```bash
|
||||||
|
make test # All Go tests
|
||||||
|
go test ./pkg/release/... # Single package
|
||||||
|
go test -run TestName ./pkg/... # Single test
|
||||||
|
```
|
||||||
|
|
||||||
|
Tests use `_test.go` suffix alongside source files.
|
||||||
|
|
||||||
|
## Working Directories
|
||||||
|
|
||||||
|
- `sources/`: Downloaded/extracted Emacs source (gitignored)
|
||||||
|
- `builds/`: Build outputs and .app bundles (gitignored)
|
||||||
|
- `patches/`: Emacs patches applied during build
|
||||||
|
- `bin/`: Built Go binaries (gitignored)
|
||||||
2
Gemfile
2
Gemfile
@@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
source 'http://rubygems.org/'
|
source 'https://rubygems.org/'
|
||||||
|
|
||||||
gem 'ruby-macho'
|
gem 'ruby-macho'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: http://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
json (2.8.2)
|
json (2.8.2)
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -71,7 +71,7 @@ $(TOOLDIR)/$(1): Makefile
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest))
|
$(eval $(call tool,gofumpt,mvdan.cc/gofumpt@latest))
|
||||||
$(eval $(call tool,golangci-lint,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61))
|
$(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))
|
$(eval $(call tool,gomod,github.com/Helcaraxan/gomod@latest))
|
||||||
|
|
||||||
.PHONY: tools
|
.PHONY: tools
|
||||||
@@ -141,10 +141,10 @@ nix-flake-update:
|
|||||||
|
|
||||||
.SILENT: flake-package-versions
|
.SILENT: flake-package-versions
|
||||||
flake-package-versions:
|
flake-package-versions:
|
||||||
nix develop --command -- bash -c \
|
nix develop --command bash -c \
|
||||||
'nix derivation show \
|
'nix derivation show \
|
||||||
$$(echo $$PATH | tr ":" "\n" | grep "/nix/store" | sort -u) \
|
$$(echo $$PATH | tr ":" "\n" | grep "/nix/store" | sort -u) \
|
||||||
| jq -r ".[].name" | sort -u'
|
| jq -r ".derivations[].name" | sort -u'
|
||||||
|
|
||||||
flake.pkgs: flake.nix flake.lock
|
flake.pkgs: flake.nix flake.lock
|
||||||
$(MAKE) flake-package-versions > "$@"
|
$(MAKE) flake-package-versions > "$@"
|
||||||
|
|||||||
14
README.md
14
README.md
@@ -131,7 +131,6 @@ Options:
|
|||||||
-j, --parallel COUNT Compile using COUNT parallel processes (detected: 16)
|
-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
|
--git-sha SHA Override detected git SHA of specified branch allowing builds of old commits
|
||||||
--[no-]use-nix Use Nix instead of Homebrew to find dependencies (default: enabled if IN_NIX_SHELL is set)
|
--[no-]use-nix Use Nix instead of Homebrew to find dependencies (default: enabled if IN_NIX_SHELL is set)
|
||||||
--[no-]xwidgets Enable/disable XWidgets if supported (default: enabled)
|
|
||||||
--[no-]tree-sitter Enable/disable tree-sitter if supported (default: enabled)
|
--[no-]tree-sitter Enable/disable tree-sitter if supported (default: enabled)
|
||||||
--[no-]native-comp Enable/disable native-comp (default: enabled if supported)
|
--[no-]native-comp Enable/disable native-comp (default: enabled if supported)
|
||||||
--optimize Shorthand for --native-march --native-mtune --fomit-frame-pointer (default: disabled)
|
--optimize Shorthand for --native-march --native-mtune --fomit-frame-pointer (default: disabled)
|
||||||
@@ -142,10 +141,13 @@ Options:
|
|||||||
--[no-]relink-eln-files Enable/disable re-linking shared libraries in bundled *.eln files (default: enabled)
|
--[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-]rsvg Enable/disable SVG image support via librsvg (default: enabled)
|
||||||
--[no-]dbus Enable/disable dbus support (default: enabled)
|
--[no-]dbus Enable/disable dbus support (default: enabled)
|
||||||
--no-titlebar Apply no-titlebar patch (default: disabled)
|
--alpha-background Apply experimental alpha-background patch when building Emacs 30.x - 31.x (default: disabled)
|
||||||
--posix-spawn Apply posix-spawn patch (deprecated)
|
--no-frame-refocus Apply no-frame-refocus patch when building Emacs 27.x - 31.x (default: disabled)
|
||||||
--no-frame-refocus Apply no-frame-refocus patch (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)
|
--[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)
|
--[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)
|
--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)
|
--[no-]github-auth Make authenticated GitHub API requests if GITHUB_TOKEN environment variable is set.(default: enabled)
|
||||||
@@ -153,12 +155,16 @@ Options:
|
|||||||
-o, --output DIR Output directory for finished builds (default: <work-dir>/builds)
|
-o, --output DIR Output directory for finished builds (default: <work-dir>/builds)
|
||||||
--build-name NAME Override generated build name
|
--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)
|
--dist-include x,y,z List of extra files to copy from Emacs source into build folder/archive (default: COPYING)
|
||||||
|
--icon-uri URI Local path or URL to a .icns file to replace the default app icon
|
||||||
|
--tahoe-icon-uri URI Local path or URL to an Assets.car file for macOS 26 icons. Requires --tahoe-icon-name.
|
||||||
|
--tahoe-icon-name NAME Name of the icon in Assets.car to set as CFBundleIconName
|
||||||
--[no-]self-sign Enable/disable self-signing of Emacs.app (default: enabled)
|
--[no-]self-sign Enable/disable self-signing of Emacs.app (default: enabled)
|
||||||
--[no-]archive Enable/disable creating *.tbz archive (default: enabled)
|
--[no-]archive Enable/disable creating *.tbz archive (default: enabled)
|
||||||
--[no-]archive-keep-build-dir
|
--[no-]archive-keep-build-dir
|
||||||
Enable/disable keeping source folder for archive (default: disabled)
|
Enable/disable keeping source folder for archive (default: disabled)
|
||||||
--log-level LEVEL Build script log level (default: info)
|
--log-level LEVEL Build script log level (default: info)
|
||||||
--plan FILE Follow given plan file, instead of using given git ref/sha
|
--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
|
Resulting applications are saved to the `builds` directory in a bzip2 compressed
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
8
flake.lock
generated
8
flake.lock
generated
@@ -20,16 +20,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731603435,
|
"lastModified": 1767313136,
|
||||||
"narHash": "sha256-CqCX4JG7UiHvkrBTpYC3wcEurvbtTADLbo3Ns2CEoL8=",
|
"narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8b27c1239e5c421a2bbc2c65d52e4a6fbf2ff296",
|
"rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "24.11-beta",
|
"ref": "nixos-25.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|||||||
164
flake.nix
164
flake.nix
@@ -2,88 +2,104 @@
|
|||||||
description = "Development environment flake";
|
description = "Development environment flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/24.11-beta";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs =
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
{
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
flake-utils,
|
||||||
|
}:
|
||||||
|
flake-utils.lib.eachDefaultSystem (
|
||||||
|
system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
# List of supported macOS SDK versions.
|
# List of supported macOS SDK versions.
|
||||||
sdk_versions = [ "11" "12" "13" "14" "15" ];
|
sdk_versions = [
|
||||||
|
"11"
|
||||||
|
"12"
|
||||||
|
"13"
|
||||||
|
"14"
|
||||||
|
"15"
|
||||||
|
"26"
|
||||||
|
];
|
||||||
default_sdk_version = "11";
|
default_sdk_version = "11";
|
||||||
|
|
||||||
mkDevShell = { macos_version ? default_sdk_version }:
|
mkDevShell =
|
||||||
|
{
|
||||||
|
macos_version ? default_sdk_version,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
apple_sdk = pkgs.${"apple-sdk_${macos_version}"};
|
apple_sdk = pkgs.${"apple-sdk_${macos_version}"};
|
||||||
in
|
in
|
||||||
pkgs.mkShell {
|
pkgs.mkShell {
|
||||||
# Package list specifically excludes ncurses, so that we link
|
# Package list specifically excludes ncurses, so that we link
|
||||||
# against the system version of ncurses. This ensures emacs' TUI
|
# against the system version of ncurses. This ensures emacs' TUI
|
||||||
# works out of the box without the user having to manually set
|
# works out of the box without the user having to manually set
|
||||||
# TERMINFO in the shell before launching emacs.
|
# TERMINFO in the shell before launching emacs.
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
apple_sdk
|
apple_sdk
|
||||||
autoconf
|
autoconf
|
||||||
bash
|
bash
|
||||||
cairo
|
cairo
|
||||||
clang
|
clang
|
||||||
coreutils
|
coreutils
|
||||||
curl
|
curl
|
||||||
darwin.DarwinTools # sw_vers
|
darwin.DarwinTools # sw_vers
|
||||||
dbus
|
dbus
|
||||||
expat
|
expat
|
||||||
findutils
|
findutils
|
||||||
gcc
|
gcc
|
||||||
gettext
|
gettext
|
||||||
giflib
|
giflib
|
||||||
git
|
git
|
||||||
gmp
|
gmp
|
||||||
gnumake
|
gnumake
|
||||||
gnupatch
|
gnupatch
|
||||||
gnused
|
gnused
|
||||||
gnutar
|
gnutar
|
||||||
gnutls
|
gnutls
|
||||||
harfbuzz
|
harfbuzz
|
||||||
jansson
|
jansson
|
||||||
jq
|
jq
|
||||||
lcms2
|
lcms2
|
||||||
libffi
|
libffi
|
||||||
libgccjit
|
libgccjit
|
||||||
libiconv
|
libiconv
|
||||||
libjpeg
|
libjpeg
|
||||||
libpng
|
libpng
|
||||||
librsvg
|
librsvg
|
||||||
libtasn1
|
libtasn1
|
||||||
libunistring
|
libunistring
|
||||||
libwebp
|
libwebp
|
||||||
libxml2
|
libxml2
|
||||||
mailutils
|
mailutils
|
||||||
nettle
|
nettle
|
||||||
pkg-config
|
pkg-config
|
||||||
python3
|
python313Packages.dmgbuild
|
||||||
rsync
|
rsync
|
||||||
ruby_3_3
|
ruby
|
||||||
sqlite
|
sqlite
|
||||||
texinfo
|
texinfo
|
||||||
time
|
time
|
||||||
tree-sitter
|
tree-sitter
|
||||||
which
|
which
|
||||||
xcbuild
|
xcbuild
|
||||||
zlib
|
zlib
|
||||||
];
|
];
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
export CC=clang
|
export CC=clang
|
||||||
export MACOSX_DEPLOYMENT_TARGET="${macos_version}.0"
|
export MACOSX_DEPLOYMENT_TARGET="${macos_version}.0"
|
||||||
export DEVELOPER_DIR="${apple_sdk}"
|
export DEVELOPER_DIR="${apple_sdk}"
|
||||||
export NIX_LIBGCCJIT_VERSION="${pkgs.libgccjit.version}"
|
export NIX_LIBGCCJIT_VERSION="${pkgs.libgccjit.version}"
|
||||||
export NIX_LIBGCCJIT_ROOT="${pkgs.libgccjit.outPath}"
|
export NIX_LIBGCCJIT_ROOT="${pkgs.libgccjit.outPath}"
|
||||||
export BUNDLE_WITHOUT=development
|
export BUNDLE_WITHOUT=development
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Generate an attrset of shells for each macOS SDK version.
|
# Generate an attrset of shells for each macOS SDK version.
|
||||||
versionShells = builtins.listToAttrs (
|
versionShells = builtins.listToAttrs (
|
||||||
@@ -93,10 +109,10 @@
|
|||||||
}) sdk_versions
|
}) sdk_versions
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells = versionShells // {
|
devShells = versionShells // {
|
||||||
default = mkDevShell {};
|
default = mkDevShell { };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
83
flake.pkgs
83
flake.pkgs
@@ -1,67 +1,72 @@
|
|||||||
DarwinTools-1
|
DarwinTools-1
|
||||||
autoconf-2.72
|
autoconf-2.72
|
||||||
bash-5.2p37
|
bash-5.2p37
|
||||||
|
bash-interactive-5.2p37
|
||||||
brotli-1.1.0
|
brotli-1.1.0
|
||||||
bzip2-1.0.8
|
bzip2-1.0.8
|
||||||
cairo-1.18.2
|
cairo-1.18.2
|
||||||
cctools-binutils-darwin-1010.6
|
cctools-binutils-darwin-1010.6
|
||||||
cctools-binutils-darwin-wrapper-1010.6
|
cctools-binutils-darwin-wrapper-1010.6
|
||||||
clang-16.0.6
|
clang-19.1.7
|
||||||
clang-wrapper-16.0.6
|
clang-wrapper-19.1.7
|
||||||
coreutils-9.5
|
coreutils-9.7
|
||||||
curl-8.11.0
|
curl-8.14.1
|
||||||
dbus-1.14.10
|
dbus-1.14.10
|
||||||
diffutils-3.10
|
diffutils-3.12
|
||||||
expat-2.6.4
|
expat-2.7.3
|
||||||
file-5.45
|
file-5.45
|
||||||
findutils-4.10.0
|
findutils-4.10.0
|
||||||
fontconfig-2.15.0
|
fontconfig-2.16.0
|
||||||
freetype-2.13.3
|
freetype-2.13.3
|
||||||
gawk-5.3.1
|
gawk-5.3.2
|
||||||
gcc-13.3.0
|
gcc-14.3.0
|
||||||
gcc-wrapper-13.3.0
|
gcc-wrapper-14.3.0
|
||||||
gdk-pixbuf-2.42.12
|
gdk-pixbuf-2.42.12
|
||||||
gettext-0.21.1
|
gettext-0.22.5
|
||||||
giflib-5.2.2
|
giflib-5.2.2
|
||||||
git-2.47.0
|
git-2.50.1
|
||||||
glib-2.82.1
|
glib-2.84.3
|
||||||
gnugrep-3.11
|
gnugrep-3.11
|
||||||
gnumake-4.4.1
|
gnumake-4.4.1
|
||||||
gnused-4.9
|
gnused-4.9
|
||||||
gnutar-1.35
|
gnutar-1.35
|
||||||
gnutls-3.8.6
|
gnutls-3.8.9
|
||||||
graphite2-1.3.14
|
graphite2-1.3.14
|
||||||
gzip-1.13
|
gzip-1.14
|
||||||
harfbuzz-10.0.1
|
harfbuzz-10.2.0
|
||||||
jq-1.7.1
|
jq-1.7.1
|
||||||
krb5-1.21.3
|
krb5-1.21.3
|
||||||
lcms2-2.16
|
lcms2-2.17
|
||||||
libdeflate-1.22
|
libdeflate-1.23
|
||||||
libgccjit-13.3.0
|
libgccjit-14.3.0
|
||||||
libiconv-107
|
libiconv-1.17
|
||||||
libidn2-2.3.7
|
libiconv-109
|
||||||
|
libidn2-2.3.8
|
||||||
libjpeg-turbo-3.0.4
|
libjpeg-turbo-3.0.4
|
||||||
libpng-apng-1.6.43
|
libpng-apng-1.6.46
|
||||||
libpsl-0.21.5
|
libpsl-0.21.5
|
||||||
librsvg-2.58.3
|
librsvg-2.60.0
|
||||||
libtasn1-4.19.0
|
libtasn1-4.20.0
|
||||||
libtiff-4.7.0
|
libtiff-4.7.0
|
||||||
libwebp-1.4.0
|
libwebp-1.5.0
|
||||||
libxml2-2.13.4
|
libxml2-2.13.8
|
||||||
mailutils-3.17
|
mailutils-3.18
|
||||||
nettle-3.10
|
nettle-3.10.1
|
||||||
nghttp2-1.64.0
|
nghttp2-1.65.0
|
||||||
openssl-3.3.2
|
openssl-3.4.3
|
||||||
patch-2.7.6
|
patch-2.7.6
|
||||||
pkg-config-wrapper-0.29.2
|
pkg-config-wrapper-0.29.2
|
||||||
python3-3.12.7
|
python3-3.13.5
|
||||||
rsync-3.3.0
|
python3.13-dmgbuild-1.6.2
|
||||||
ruby-3.3.5
|
python3.13-ds-store-1.3.1
|
||||||
sqlite-3.46.1
|
python3.13-mac-alias-2.2.2
|
||||||
texinfo-7.1.1
|
rsync-3.4.1
|
||||||
|
ruby-3.3.9
|
||||||
|
sqlite-3.48.0
|
||||||
|
texinfo-7.2
|
||||||
time-1.9
|
time-1.9
|
||||||
tree-sitter-0.24.3
|
tree-sitter-0.25.3
|
||||||
which-2.21
|
which-2.23
|
||||||
xcbuild-0.1.1-unstable-2019-11-20
|
xcbuild-0.1.1-unstable-2019-11-20
|
||||||
xz-5.6.3
|
xz-5.8.1
|
||||||
zstd-1.5.6
|
zstd-1.5.7
|
||||||
|
|||||||
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -287,7 +287,7 @@ func (s *Updater) createRepoFile(
|
|||||||
s.logger.Info(
|
s.logger.Info(
|
||||||
"new commit created",
|
"new commit created",
|
||||||
"commit", contResp.GetSHA(), "message", contResp.GetMessage(),
|
"commit", contResp.GetSHA(), "message", contResp.GetMessage(),
|
||||||
"url", contResp.Commit.GetHTMLURL(),
|
"url", contResp.GetHTMLURL(),
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -354,7 +354,7 @@ func (s *Updater) updateRepoFile(
|
|||||||
s.logger.Info(
|
s.logger.Info(
|
||||||
"new commit created",
|
"new commit created",
|
||||||
"commit", contResp.GetSHA(), "message", contResp.GetMessage(),
|
"commit", contResp.GetSHA(), "message", contResp.GetMessage(),
|
||||||
"url", contResp.Commit.GetHTMLURL(),
|
"url", contResp.GetHTMLURL(),
|
||||||
)
|
)
|
||||||
|
|
||||||
return true, nil
|
return true, nil
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ func planCmd() *cli2.Command {
|
|||||||
Name: "sha",
|
Name: "sha",
|
||||||
Usage: "override commit SHA of specified git branch/tag",
|
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{
|
&cli2.StringFlag{
|
||||||
Name: "format",
|
Name: "format",
|
||||||
Aliases: []string{"f"},
|
Aliases: []string{"f"},
|
||||||
@@ -90,6 +94,7 @@ func planAction(c *cli2.Context, opts *Options) error {
|
|||||||
EmacsRepo: c.String("emacs-repo"),
|
EmacsRepo: c.String("emacs-repo"),
|
||||||
Ref: ref,
|
Ref: ref,
|
||||||
SHAOverride: c.String("sha"),
|
SHAOverride: c.String("sha"),
|
||||||
|
BuildVariant: c.Int("build-variant"),
|
||||||
OutputDir: c.String("output-dir"),
|
OutputDir: c.String("output-dir"),
|
||||||
TestBuild: c.String("test-build"),
|
TestBuild: c.String("test-build"),
|
||||||
TestBuildType: plan.Prerelease,
|
TestBuildType: plan.Prerelease,
|
||||||
|
|||||||
@@ -65,10 +65,7 @@ func (s *OSInfo) distinctVersion(version string) string {
|
|||||||
return parts[0]
|
return parts[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
max := len(parts)
|
end := min(len(parts), 2)
|
||||||
if max > 2 {
|
|
||||||
max = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
return strings.Join(parts[0:max], ".")
|
return strings.Join(parts[0:end], ".")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ type Options struct {
|
|||||||
EmacsRepo string
|
EmacsRepo string
|
||||||
Ref string
|
Ref string
|
||||||
SHAOverride string
|
SHAOverride string
|
||||||
|
BuildVariant int
|
||||||
OutputDir string
|
OutputDir string
|
||||||
TestBuild string
|
TestBuild string
|
||||||
TestBuildType TestBuildType
|
TestBuildType TestBuildType
|
||||||
@@ -95,6 +96,12 @@ func Create(ctx context.Context, opts *Options) (*Plan, error) { //nolint:funlen
|
|||||||
releaseName = "Emacs." + version
|
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
|
// Attempt to get the macOS SDK version from the environment, if it's not
|
||||||
// available, use the version from the system.
|
// available, use the version from the system.
|
||||||
targetMacOSVersion := osInfo.DistinctSDKVersion()
|
targetMacOSVersion := osInfo.DistinctSDKVersion()
|
||||||
@@ -139,7 +146,7 @@ func Create(ctx context.Context, opts *Options) (*Plan, error) { //nolint:funlen
|
|||||||
|
|
||||||
plan.Build.Name += ".test." + testName
|
plan.Build.Name += ".test." + testName
|
||||||
plan.Release.Title = "Test Builds (" + testName + ")"
|
plan.Release.Title = "Test Builds (" + testName + ")"
|
||||||
plan.Release.Name = "test-builds"
|
plan.Release.Name = "test-builds-" + testName
|
||||||
|
|
||||||
plan.Release.Prerelease = false
|
plan.Release.Prerelease = false
|
||||||
plan.Release.Draft = true
|
plan.Release.Draft = true
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Errors
|
// Errors
|
||||||
@@ -18,8 +17,9 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
stableVersion = regexp.MustCompile(`^\d+\.\d+(?:[a-z]+)?$`)
|
stableVersion = regexp.MustCompile(`^\d+\.\d+(?:[a-z]+)?(-\d+)?$`)
|
||||||
stableGitRef = regexp.MustCompile(`^emacs-(\d+\.\d+(?:[a-z]+)?)$`)
|
pretestVersion = regexp.MustCompile(`-pretest(-\d+)?$`)
|
||||||
|
stableGitRef = regexp.MustCompile(`^emacs-(\d+\.\d+(?:[a-z]+)?)$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
func VersionToName(version string) (string, error) {
|
func VersionToName(version string) (string, error) {
|
||||||
@@ -28,7 +28,7 @@ func VersionToName(version string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if stableVersion.MatchString(version) ||
|
if stableVersion.MatchString(version) ||
|
||||||
strings.HasSuffix(version, "-pretest") {
|
pretestVersion.MatchString(version) {
|
||||||
return "Emacs-" + version, nil
|
return "Emacs-" + version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,27 @@ func TestVersionToName(t *testing.T) {
|
|||||||
},
|
},
|
||||||
want: "Emacs.2021-07-01.1b88404.master",
|
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",
|
name: "stable",
|
||||||
args: args{
|
args: args{
|
||||||
@@ -44,6 +65,20 @@ func TestVersionToName(t *testing.T) {
|
|||||||
},
|
},
|
||||||
want: "Emacs-23.3b",
|
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 {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user