Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ jobs:
test -x dist/TLEscope.app/Contents/MacOS/TLEscope.bin
test -f dist/TLEscope.app/Contents/Resources/themes/default/theme.json
test -f dist/TLEscope.app/Contents/Resources/themes/default/font.ttf
test -f dist/TLEscope.app/Contents/Resources/AppIcon.icns
plutil -lint dist/TLEscope.app/Contents/Info.plist

- name: Verify architecture
Expand Down
18 changes: 13 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ HOST_CXX ?= g++
EXE_EXT := $(if $(filter Windows_NT,$(OS)),.exe,)
ICON_GEN := build/gen_icon$(EXE_EXT)
ICON_OUT := build/logo.ico
# macOS needs a .icns, not the .ico: same generator, PNG representations.
ICNS_OUT := build/AppIcon.icns

CURL_FIX_RAW := $(shell $(PKG_CONFIG_WIN) --libs --static libcurl 2>/dev/null)
ifeq ($(strip $(CURL_FIX_RAW)),)
Expand Down Expand Up @@ -120,12 +122,12 @@ linux: $(ICON_OUT) raylib bin/TLEscope
@echo "Linux build bundled in $(DIST_LINUX)/"
@echo "Run it with: cd $(DIST_LINUX)/ && ./TLEscope"

macos: $(ICON_OUT) raylib bin/TLEscope-macos
macos: $(ICNS_OUT) raylib bin/TLEscope-macos
rm -rf $(DIST_MACOS)
@mkdir -p $(DIST_MACOS)
cp bin/TLEscope-macos $(DIST_MACOS)/TLEscope
cp -r themes $(DIST_MACOS)/
cp $(ICON_OUT) $(DIST_MACOS)/
cp $(ICNS_OUT) $(DIST_MACOS)/AppIcon.icns
@echo "macOS build bundled in $(DIST_MACOS)/"
@echo "Run it with: cd $(DIST_MACOS)/ && ./TLEscope"
@echo "To make a MacOS bundle: ./macos_bundle.sh"
Expand Down Expand Up @@ -206,13 +208,19 @@ build_win/versioninfo.o: src/versioninfo.rc.in scripts/gen_versioninfo.sh script
@scripts/gen_versioninfo.sh "$(GIT_VERSION_NUM)" "$(GIT_VERSION)" build_win/versioninfo.rc "$(ICON_OUT)"
@$(RC_WIN) -O coff -i build_win/versioninfo.rc -o $@

# Rasterize the hardcoded logo into a multi-size .ico (build artifact, never
# committed). Reuses src/ui/logo_raster.h, the same code the app renders with.
$(ICON_OUT): scripts/gen_icon.cpp src/ui/logo_raster.h | build
# Rasterize the hardcoded logo into the platform icon containers (build
# artifacts, never committed). Reuses src/ui/logo_raster.h, the same code the
# app renders with; scripts/gen_icon.cpp picks .ico or .icns by extension.
$(ICON_GEN): scripts/gen_icon.cpp src/ui/logo_raster.h | build
@mkdir -p $(@D)
@$(HOST_CXX) -std=c++17 -O2 -Isrc -o $(ICON_GEN) scripts/gen_icon.cpp

$(ICON_OUT): $(ICON_GEN)
@$(ICON_GEN) $(ICON_OUT)

$(ICNS_OUT): $(ICON_GEN)
@$(ICON_GEN) $(ICNS_OUT)

build:
mkdir -p build

Expand Down
Binary file removed bundle/Contents/Resources/AppIcon.icns
Binary file not shown.
5 changes: 5 additions & 0 deletions macos_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ if [[ ! -d "$PORTABLE_DIR/themes" ]]; then
exit 1
fi

if [[ ! -f "$PORTABLE_DIR/AppIcon.icns" ]]; then
echo "Missing app icon: $PORTABLE_DIR/AppIcon.icns (run: make macos)" >&2
exit 1
fi

rm -rf "$APP_DIR"
cp -R bundle "$APP_DIR"
mkdir -p "$APP_DIR/Contents/Resources"
Expand Down
Loading
Loading