#!/usr/bin/env python3 """Package a built horizon-client with its prepared resources into a private tarball for one of your own Linux or macOS machines. The resources are Mojang assets: keep the archive in ignored .local/ and never publish or commit it. cargo build --release -p horizon-client --bins python3 tools/package_native_client.py """ import argparse import hashlib import io import json import platform import subprocess import tarfile from pathlib import Path try: from . import lab except ImportError: import lab ROOT = Path(__file__).resolve().parent.parent LOCAL = ROOT / '.local' # Inputs of the exporters, not read by the game at runtime. SKIP = {'classes', 'client-classes', 'export.log', 'model-state-export.log'} LAUNCHER = r'''#!/bin/sh # Starts Horizon. Saves and options.txt live in $HORIZON_HOME # (default ~/.local/share/horizon), so unpacking an update keeps them. here=$(cd "$(dirname "$0")" && pwd) if [ "$1" = "--install" ]; then apps="${XDG_DATA_HOME:-$HOME/.local/share}/applications" mkdir -p "$apps" cat > "$apps/horizon.desktop" <