feat: move git to app bundle

This commit is contained in:
daniel committed 2026-10-01 10:47:28 +02:00
1 parent 35e3d1a0bb
commit 46be13a60a
5 files changed
+69 -35

No files matched your search

+5 -4
View File
@@ -44,14 +44,15 @@ PORTS := \
# Bundle directories are keyed by port name, not category path. # Bundle directories are keyed by port name, not category path.
PORT_NAMES := $(notdir $(PORTS)) PORT_NAMES := $(notdir $(PORTS))
# Ports that install themselves rather than producing an app bundle: command # Ports that install themselves rather than producing an app bundle.
# line tools, which land in 0:/os/ with no manifest and no launcher icon. # `install` below delegates to their own install target. None at the moment:
# `install` below delegates to their own install target. # even command line tools (dev-vcs/git) ship as bundles, with a manifest that
# hides them from the menu.
# #
# www-client/netsurf is deliberately NOT here: it also has an install target, # www-client/netsurf is deliberately NOT here: it also has an install target,
# but it drops a resource tree next to the binary and is not something every # but it drops a resource tree next to the binary and is not something every
# image should carry, so it stays a manual `make -C www-client/netsurf install`. # image should carry, so it stays a manual `make -C www-client/netsurf install`.
SELF_INSTALL_PORTS := dev-vcs/git SELF_INSTALL_PORTS :=
.PHONY: all clean install $(PORTS) $(PORT_NAMES) .PHONY: all clean install $(PORTS) $(PORT_NAMES)
+1 -1
View File
@@ -38,4 +38,4 @@ make ramdisk
| libnsbmp | [netsurf-browser/libnsbmp](https://github.com/netsurf-browser/libnsbmp) | BMP/ICO decoder. | | libnsbmp | [netsurf-browser/libnsbmp](https://github.com/netsurf-browser/libnsbmp) | BMP/ICO decoder. |
| netsurf | [netsurf-browser/netsurf](https://github.com/netsurf-browser/netsurf) | Native browser app built on NetSurf, with BearSSL HTTP/HTTPS, tabs, downloads, bookmarks, find, common image formats, and system TrueType fonts. | | netsurf | [netsurf-browser/netsurf](https://github.com/netsurf-browser/netsurf) | Native browser app built on NetSurf, with BearSSL HTTP/HTTPS, tabs, downloads, bookmarks, find, common image formats, and system TrueType fonts. |
| doom | [ozkl/doomgeneric](https://github.com/ozkl/doomgeneric) | `doom1.wad` is proprietary and deliberately not bundled. | | doom | [ozkl/doomgeneric](https://github.com/ozkl/doomgeneric) | `doom1.wad` is proprietary and deliberately not bundled. |
| git | [git/git](https://github.com/git/git) | v2.39.5. WIP - installs to `0:/os/git.elf`. Local repositories only. See [dev-vcs/git/README.md](dev-vcs/git/README.md). | | git | [git/git](https://github.com/git/git) | v2.39.5. WIP - installs to `0:/apps/git/`. Local repositories only. See [dev-vcs/git/README.md](dev-vcs/git/README.md). |
+33 -22
View File
@@ -3,8 +3,10 @@
# Upstream: https://github.com/git/git (submodule at upstream/, pinned to # Upstream: https://github.com/git/git (submodule at upstream/, pinned to
# v2.39.5). # v2.39.5).
# #
# git is built as a plain system program (0:/os/git.elf), not an app bundle: # git is installed as an app bundle (0:/apps/git/) so it carries a manifest
# it is a command-line tool driven from the terminal. # and a .port marker like every other port, but its manifest keeps it out of
# the menu and the Apps folder: it is a command-line tool driven from the
# terminal, with no window to show.
# #
# CONFIGURATION # CONFIGURATION
# The build must not pick up any host defaults. git derives its platform # The build must not pick up any host defaults. git derives its platform
@@ -32,10 +34,14 @@ PORT_NAME := git
include ../../mk/port.mk include ../../mk/port.mk
GIT_BIN := $(UPSTREAM)/git GIT_BIN := $(UPSTREAM)/git
GIT_INSTALL := $(MONTAUKOS)/programs/bin/os APP_INSTALL := $(MONTAUKOS)/programs/bin/apps/git
# Where git's compiled-in paths point on the target. programs/bin/os is the # Earlier versions of this port installed into 0:/os; install and uninstall
# staging directory for 0:/os, so GIT_PREFIX and GIT_STAGE are two names for # both sweep those files away so an old copy cannot shadow the bundle.
LEGACY_INSTALL := $(MONTAUKOS)/programs/bin/os
# Where git's compiled-in paths point on the target. The bundle directory is
# 0:/apps/git once installed, so GIT_PREFIX and BUNDLE_DIR are two names for
# the same place -- one as the OS sees it, one as the build host does. # the same place -- one as the OS sees it, one as the build host does.
# RUNTIME_PREFIX is off (it wants /proc/self/exe), so these are baked in: # RUNTIME_PREFIX is off (it wants /proc/self/exe), so these are baked in:
# #
@@ -45,8 +51,7 @@ GIT_INSTALL := $(MONTAUKOS)/programs/bin/os
# every command in this build is a # every command in this build is a
# builtin, which is what makes git # builtin, which is what makes git
# usable without fork/exec) # usable without fork/exec)
GIT_PREFIX := 0:/os/git GIT_PREFIX := 0:/apps/git
GIT_STAGE := $(GIT_INSTALL)/git
# `git version` string. Without an override GIT-VERSION-GEN runs `git # `git version` string. Without an override GIT-VERSION-GEN runs `git
# describe` on the checkout and, because the patch series is applied in the # describe` on the checkout and, because the patch series is applied in the
@@ -165,7 +170,7 @@ GIT_MAKE := MAKEFLAGS= $(MAKE)
.PHONY: all clean git-build install uninstall .PHONY: all clean git-build install uninstall
all: git-build all: bundle
$(COMPAT_LIB): $(wildcard compat/*.c) $(wildcard compat/*.h) $(COMPAT_LIB): $(wildcard compat/*.c) $(wildcard compat/*.h)
$(CC) $(GIT_CFLAGS) -c compat/montauk-compat.c -o compat/montauk-compat.o $(CC) $(GIT_CFLAGS) -c compat/montauk-compat.c -o compat/montauk-compat.o
@@ -195,24 +200,30 @@ git-build: $(COMPAT_LIB)
@test -f $(GIT_BIN) || { echo "git: expected $(GIT_BIN)" >&2; exit 1; } @test -f $(GIT_BIN) || { echo "git: expected $(GIT_BIN)" >&2; exit 1; }
@echo "Built: $(GIT_BIN) ($$(stat -c%s $(GIT_BIN)) bytes)" @echo "Built: $(GIT_BIN) ($$(stat -c%s $(GIT_BIN)) bytes)"
# Installed as a system program, not an app bundle: git is a command line # The binary is STRIPPED on the way into the bundle -- the debug info is five
# tool with no window. It carries no manifest and no .port marker, so # sixths of its size (17 MB -> 3 MB), and it all has to fit in the ramdisk.
# remember to uninstall before cutting a release ISO. # The templates sit under share/git-core in the bundle, which is where
# # GIT_PREFIX tells git to look for them.
# The binary is STRIPPED on the way in -- the debug info is five sixths of $(TARGET): git-build | $(BUNDLE_DIR)
# its size (17 MB -> 3 MB), and it all has to fit in the ramdisk. $(TOOLCHAIN_PREFIX)strip -o $@ $(GIT_BIN)
install: git-build mkdir -p $(BUNDLE_DIR)/share/git-core
mkdir -p $(GIT_INSTALL) rm -rf $(BUNDLE_DIR)/share/git-core/templates
$(TOOLCHAIN_PREFIX)strip -o $(GIT_INSTALL)/git.elf $(GIT_BIN) cp -rL $(UPSTREAM)/templates/blt $(BUNDLE_DIR)/share/git-core/templates
mkdir -p $(GIT_STAGE)/share/git-core
rm -rf $(GIT_STAGE)/share/git-core/templates # The top-level `make install` copies the bundle like any other; this target
cp -rL $(UPSTREAM)/templates/blt $(GIT_STAGE)/share/git-core/templates # is the standalone equivalent, plus the sweep of a pre-bundle 0:/os install.
@echo "installed: 0:/os/git.elf + $(GIT_PREFIX)/share/git-core/templates" install: bundle
rm -rf $(LEGACY_INSTALL)/git.elf $(LEGACY_INSTALL)/git
rm -rf $(APP_INSTALL)
mkdir -p $(dir $(APP_INSTALL))
cp -r $(BUNDLE_DIR) $(APP_INSTALL)
@echo "installed: $(GIT_PREFIX)/git.elf + $(GIT_PREFIX)/share/git-core/templates"
uninstall: uninstall:
rm -rf $(GIT_INSTALL)/git.elf $(GIT_STAGE) rm -rf $(APP_INSTALL) $(LEGACY_INSTALL)/git.elf $(LEGACY_INSTALL)/git
clean: clean:
@$(GIT_MAKE) -C $(UPSTREAM) $(GIT_ARGS) clean >/dev/null 2>&1 || true @$(GIT_MAKE) -C $(UPSTREAM) $(GIT_ARGS) clean >/dev/null 2>&1 || true
@git -C $(UPSTREAM) checkout -- . 2>/dev/null || true @git -C $(UPSTREAM) checkout -- . 2>/dev/null || true
rm -f $(COMPAT_LIB) compat/*.o rm -f $(COMPAT_LIB) compat/*.o
rm -rf $(BUNDLE_DIR)
+14 -8
View File
@@ -3,21 +3,27 @@
Upstream [git/git](https://github.com/git/git), pinned at **v2.39.5** Upstream [git/git](https://github.com/git/git), pinned at **v2.39.5**
(`upstream/`, submodule). Reports itself as `2.39.5-montauk`. (`upstream/`, submodule). Reports itself as `2.39.5-montauk`.
Installs as a system program, not an app bundle: Installs as an app bundle with no menu entry -- the manifest sets
`menu.visible = false` and `desktop.section = "hidden"`, since git has no
window:
| Path | What | | Path | What |
|------|------| |------|------|
| `0:/os/git.elf` | the binary (~3 MB stripped) | | `0:/apps/git/git.elf` | the binary (~3 MB stripped) |
| `0:/os/git/share/git-core/templates` | `git init` skeleton | | `0:/apps/git/share/git-core/templates` | `git init` skeleton |
| `0:/os/git/etc/gitconfig` | system config (not created by the install) | | `0:/apps/git/etc/gitconfig` | system config (not created by the install) |
```bash ```bash
make -C dev-vcs/git # build make -C dev-vcs/git # build the bundle into out/apps/git/
make -C dev-vcs/git install # -> MontaukOS/programs/bin/os/ make -C dev-vcs/git install # -> MontaukOS/programs/bin/apps/git/
``` ```
`make ports` from the MontaukOS tree does both (git is in the top-level `make ports` from the MontaukOS tree does both. The standalone `install` (and
Makefile's `SELF_INSTALL_PORTS`). `uninstall`) also removes a leftover `0:/os/git.elf` from before the move.
The shell only searches `0:/os` (and the SDK and games directories) for bare
command names, so from the terminal git is run by path:
`0:/apps/git/git status`.
## Status ## Status
+16
View File
@@ -0,0 +1,16 @@
[app]
name = "Git"
binary = "git.elf"
# git is a command line tool with no window: it is bundled so it installs and
# uninstalls like any other port, but launching it from the desktop would do
# nothing useful, so it appears neither in the menu nor in the Apps folder.
[menu]
category = "Development"
visible = false
[desktop]
section = "hidden"
[launch]
pass_home_dir = false