This project automatically generates desktop integration files during the build process to make Linux and macOS experience more frictionless.
The integration system consists of:
- Templates (
templates/): Go template files for desktop integrations - Generator (
scripts/gen-integrations.go): Script that processes templates and generates integration files - Makefile targets: Build automation for different platforms
Generates a .desktop file for Linux desktop environments following the Desktop Entry Specification.
Template variables:
{{.AppName}}: Application display name{{.BinaryName}}: Executable name{{.Description}}: Application description{{.InstallPath}}: Installation directory path
Generates an Info.plist file for macOS app bundles following Apple's Information Property List Key Reference.
Template variables:
{{.AppName}}: Application display name{{.BinaryName}}: Executable name{{.Version}}: Application version{{.BundleID}}: Unique bundle identifier{{.Signature}}: 4-character application signature{{.IconName}}: Icon file name{{.MinOSVersion}}: Minimum supported macOS version
Generates integration files from templates into build/integrations/:
- Creates Linux desktop file
- Creates macOS Info.plist
- Copies icon files to appropriate locations
Builds the application binary and generates integration files:
- Compiles the Go application
- Generates desktop integration files
- Copies binary to macOS app bundle
Creates a Linux distribution package:
- Generates a proper directory structure for system installation
- Creates desktop file with correct system paths (
/usr/local/bin,/usr/share/pixmaps) - Packages everything into a
.tar.gzarchive
Creates a macOS app bundle:
- Generates complete
.appbundle structure - Includes binary, icons, and metadata
- Creates a
.ziparchive for distribution
The generator script accepts the following command-line options:
-output: Output directory (default:build/integrations)-install: Installation path (default:/usr/local/bin)-version: Application version (default:dev)
Environment variables:
VERSION: Application version (auto-detected from git tags)
The original manual integration files in __integrations/ are preserved for reference but are no longer used in the build process. The new system provides:
- Consistency: All integration files use the same configuration values
- Maintainability: Single source of truth for application metadata
- Automation: No manual updates required when version or paths change
- Flexibility: Easy to customise for different distribution scenarios
# Generate integrations for development
make generate-integrations
# Build application with integrations
make build-with-integrations
# Create distribution packages
make package-linux
make package-macos
# Custom installation path
VERSION=1.0.0 make package-linux
# Development build with custom version
make generate-integrations VERSION=dev-$(git rev-parse --short HEAD)After running make build-with-integrations, the generated structure is:
build/integrations/
├── Linux/
│ ├── usm.desktop
│ └── usm.png
└── MacOS/
└── USM.app/
├── Contents/
│ ├── Info.plist
│ └── MacOS/
│ └── usm
└── Resources/
└── icon.icns