62 Commits

Author SHA1 Message Date
Mitchell Hashimoto
89728070e9 pkg/harfbuzz: update 8.4 => 11.0
This updates our bundled Harfbuzz from 8.4 to 11.0. The changes from 8
to 11 include a number of correctness and performance improvements.
Packaged releases tend to dynamically link so this won't affect
existing users, but build-from-source users hopefully get an
improvement.
2025-03-24 10:04:11 -07:00
Mitchell Hashimoto
cfea2ea12c build: mark most dependencies as lazy
Lazy dependencies are only fetched if the build script would actually
reach a usage of that dependency at runtime (when the `lazyDependency`
function is called). This can save a lot of network traffic, disk uage,
and time because we don't have to fetch and build dependencies that we
don't actually need.

Prior to this commit, Ghostty fetched almost everything for all
platforms and configurations all the time. This commit reverses that to
fetching almost nothing until it's actually needed.

There are very little downsides to doing this[1]. One downside is `zig
build --fetch` doesn't fetch lazy dependencies, but we don't rely on
this command for packaging and suggest using our custom shell script
that downloads a cached list of URLs (`build.zig.zon.txt`).

This commit doesn't cover 100% of dependencies, since some provide no
benefit to make lazy while the complexity to make them lazy is higher
(in code style typically).

Conversely, some simple dependencies are marked lazy even if they're
almost always needed if they don't introduce any real complexity to the
code, because there is very little downside to do so.

[1]: https://ziggit.dev/t/lazy-dependencies-best-dependencies/5509/5
2025-03-14 13:32:19 -07:00
Mitchell Hashimoto
2466de4556 pkg: update to new build.zig.zon format and hash values 2025-03-11 15:00:47 -07:00
Mitchell Hashimoto
7e2286eb8c Zig 0.14 2025-03-11 14:39:04 -07:00
Mitchell Hashimoto
8231ebb770 build: mirror most of our direct dependencies
This adds a new script `update-mirror.sh` which generates the proper
blob format for R2 (or any blob storage) to mirror all of our
dependencies.

It doesn't automate updating build.zig.zon but on an ongoing basis this
should be easy to do manually, and we can strive to automate it in the
future.

I omitted iTerm2 color themes because we auto-update that via CI and
updating all of the machinery to send it to our mirror and so on is a
pain. Additionally, this doesn't mirror transitive dependencies because
Zig doesn't have a way to fetch those from a mirror instead (unless you
pre-generate a full cache like packagers but that's not practical for
day to day development).

It's hugely beneficial just to get most of our dependencies mirrored.
2025-02-14 10:06:15 -08:00
Jan200101
0493b79caf don't make library building logic public 2025-01-03 22:42:29 +01:00
Jan200101
1dc9157727 always link system freetype2 using pkg-config 2025-01-03 22:42:01 +01:00
Jan200101
5957e1101c don't build harfbuzz when system integration is enabled 2024-12-31 21:09:13 +01:00
Nyaa97
7eb5563e9c Fix linking freetype and glslang 2024-10-30 16:43:41 -04:00
Mitchell Hashimoto
8bb8b01e54 build: use Zig system packaging options
This allows dynamically linking against system libraries, which is
particularly useful for packaging.
2024-10-24 14:46:37 -07:00
Mitchell Hashimoto
fd37e6a351 pkg/harfbuzz: yeet usingns 2024-08-16 17:00:58 -07:00
Mitchell Hashimoto
ea73edaf7f pkg/harfbuzz: fix c.zig 2024-08-16 15:38:18 -07:00
Mitchell Hashimoto
a30e791c85 begin 0.13 update process -- very broken 2024-06-24 15:16:22 -07:00
Mitchell Hashimoto
6672568473 pkg/harfbuzz: update 2024-05-09 20:55:02 -07:00
Qwerasd
fb913f0d9e Enable libpng in harfbuzz freetype dep
Without this, this replaces the dep on the main level, breaking color glyphs
2024-05-09 00:03:40 -04:00
Mitchell Hashimoto
595f24585e working on more zig breaking changes 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
8d4416995b build: no more resolved target hack
This was necessary to fix `zig build test` but since #1305 this is not
necessary anymore.
2024-01-15 14:33:56 -08:00
Mitchell Hashimoto
3360a008cd build: build produces a broken object file for iOS
This gets `zig build -Dtarget=aarch64-ios` working. By "working" I mean
it produces an object file without compiler errors. However, the object
file certainly isn't useful since it uses a number of features that will
not work in the iOS sandbox.

This is just an experiment more than anything to see how hard it would be to
get libghostty working within iOS to render a terminal. Note iOS doesn't
support ptys so this wouldn't be a true on-device terminal. The
challenge right now is to just get a terminal rendering (not usable).
2024-01-13 21:38:58 -08:00
Mitchell Hashimoto
c24d7d6de6 pkg/harfbuzz: get zig build test working on macOS 2024-01-10 20:26:41 -08:00
Mitchell Hashimoto
22648d60e7 pkg/apple-sdk: detect apple sdk based on target 2024-01-09 22:24:34 -08:00
Mitchell Hashimoto
829776bebd pkg/apple-sdk: always require a module 2024-01-09 22:11:03 -08:00
Mitchell Hashimoto
c0722b3652 build: use Xcode for the macOS SDK 2024-01-09 21:53:01 -08:00
Krzysztof Wolicki
3c78df70fb Maybe this will help macos 2024-01-07 21:39:53 +01:00
Krzysztof Wolicki
2f5bcf2e27 Attempt to fix building on macos 2024-01-07 21:17:17 +01:00
Krzysztof Wolicki
ddebb31b8a Add include paths to more modules in pkg/ 2024-01-07 19:07:16 +01:00
Krzysztof Wolicki
9e14a7ea62 Add include paths to modules in pkg/ 2024-01-07 17:39:39 +01:00
Krzysztof Wolicki
1913243c35 WIP: Update to new build module API after Zig PR #18160
Temporarily change dependency sources to forks until they update
2024-01-03 21:50:32 +01:00
Mitchell Hashimoto
489ed57e2f font/harfbuzz: track x/y offsets 2023-12-11 21:41:13 -08:00
Mitchell Hashimoto
4cb185c593 pkg/harfbuzz: update to 8.2.2 2023-10-20 09:10:34 -07:00
Mitchell Hashimoto
01a8013533 pkg/harfbuzz: remove accidentally committed archive file 2023-10-09 16:05:55 -07:00
Mitchell Hashimoto
8ec6828713 pkg/harfbuzz: download source using zig package manager 2023-10-07 14:51:25 -07:00
Mitchell Hashimoto
0021b290cf pkg: add test targets 2023-10-01 18:43:25 -07:00
Mitchell Hashimoto
f0d4e9c7c3 pkg: remove all old build.zig files 2023-10-01 18:35:31 -07:00
Mitchell Hashimoto
4e1b3b3224 fix failing test, freetype needs libpng 2023-10-01 18:33:37 -07:00
Mitchell Hashimoto
2237b43df0 pkg/freetype, harfbuzz modules 2023-10-01 16:57:45 -07:00
Mitchell Hashimoto
b9cc763a3a pkg/harfbuzz needs to use apple sdk for coretext 2023-10-01 15:33:40 -07:00
Mitchell Hashimoto
2312c465c6 use package manager for font stack 2023-10-01 12:32:17 -07:00
Mitchell Hashimoto
6aef48288a pkg/harfbuzz 2023-10-01 12:23:38 -07:00
Jonathan Marler
a2e881ff4e windows: initial support for zig build test
Makes progress getting "zig build test" to work on windows.  Mostly
fixed issues around build configuration and added some branches throughout
the Zig code to return/throw errors for unimplemented parts.

I also added an initial implementation for getting the home dir.
2023-09-14 03:15:40 -06:00
Mitchell Hashimoto
d649b3f6d4 update zig 2023-08-02 14:39:19 -07:00
Mitchell Hashimoto
314f9287b1 Update Zig (#164)
* update zig

* pkg/fontconfig: clean up @as

* pkg/freetype,harfbuzz: clean up @as

* pkg/imgui: clean up @as

* pkg/macos: clean up @as

* pkg/pixman,utf8proc: clean up @as

* clean up @as

* lots more @as cleanup

* undo flatpak changes

* clean up @as
2023-06-30 12:15:31 -07:00
Mitchell Hashimoto
56f8e39e5b Update zig, mach, fmt 2023-06-25 11:08:20 -07:00
Mitchell Hashimoto
2b73fbaa0d iterating on the new for loop syntax 2023-02-27 21:53:09 -08:00
Mitchell Hashimoto
be75109a1d new build system 2023-02-14 20:58:33 -08:00
Mitchell Hashimoto
c8252133a3 update zig version 2022-12-12 22:10:52 -08:00
Mitchell Hashimoto
939e6e7a65 pkg/harfbuzz: add coretext compilation on macOS 2022-10-02 11:05:40 -07:00
Mitchell Hashimoto
53f5739eca use meta.FnPtr to prep for stage2 2022-09-23 13:20:43 -07:00
Mitchell Hashimoto
953f1aeb29 pkg/harfbuzz: fixing some APIs 2022-08-30 10:02:40 -07:00
Mitchell Hashimoto
39376feae0 font: shape API, calls shape and outputs some debug 2022-08-29 20:15:29 -07:00
Mitchell Hashimoto
dafc99746d font: Face initializes a hb_font alongside every face 2022-08-29 16:46:53 -07:00