Try to make Cthulhu python 3.9 compatible. Fixed keybinding and notifications bugs.
This commit is contained in:
+22
-35
@@ -6,85 +6,72 @@
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Colors for output (only if stdout is a terminal)
|
||||
if [[ -t 1 ]]; then
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # No Color
|
||||
else
|
||||
RED=''
|
||||
GREEN=''
|
||||
YELLOW=''
|
||||
BLUE=''
|
||||
NC=''
|
||||
fi
|
||||
|
||||
echo -e "${BLUE}Cthulhu Meson Local Build Script${NC}"
|
||||
echo "Cthulhu Meson Local Build Script"
|
||||
echo "Building and installing Cthulhu to ~/.local"
|
||||
echo "================================================"
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [[ ! -f "meson.build" ]] || [[ ! -f "src/cthulhu/cthulhu.py" ]]; then
|
||||
echo -e "${RED}Error: This script must be run from the Cthulhu source directory${NC}"
|
||||
echo "Error: This script must be run from the Cthulhu source directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check for required dependencies
|
||||
echo -e "${YELLOW}Checking dependencies...${NC}"
|
||||
echo "Checking dependencies..."
|
||||
for cmd in meson ninja python3; do
|
||||
if ! command -v "$cmd" &> /dev/null; then
|
||||
echo -e "${RED}Error: $cmd is not installed${NC}"
|
||||
echo "Error: $cmd is not installed"
|
||||
echo "Please install: meson ninja python"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Check for optional dependencies
|
||||
missing_optional=()
|
||||
for module in gi speech; do
|
||||
if ! python3 -c "import $module" 2>/dev/null; then
|
||||
missing_optional+=("python-$module")
|
||||
fi
|
||||
done
|
||||
missingOptional=()
|
||||
if ! python3 -c "import gi" 2>/dev/null; then
|
||||
missingOptional+=("python-gi")
|
||||
fi
|
||||
|
||||
if [[ ${#missing_optional[@]} -gt 0 ]]; then
|
||||
echo -e "${YELLOW}Warning: Optional dependencies missing: ${missing_optional[*]}${NC}"
|
||||
if [[ ${#missingOptional[@]} -gt 0 ]]; then
|
||||
echo "Warning: Optional dependencies missing: ${missingOptional[*]}"
|
||||
echo "Cthulhu may not function properly without these."
|
||||
fi
|
||||
|
||||
# Clean any cached bytecode
|
||||
echo "Removing __pycache__ directories..."
|
||||
find . -type d -name "__pycache__" -prune -exec rm -rf {} +
|
||||
|
||||
# Clean any existing build directory
|
||||
if [[ -d "_build" ]]; then
|
||||
echo -e "${YELLOW}Removing existing build directory...${NC}"
|
||||
echo "Removing existing build directory..."
|
||||
rm -rf _build
|
||||
fi
|
||||
|
||||
# Setup Meson build
|
||||
echo -e "${YELLOW}Setting up Meson build...${NC}"
|
||||
echo "Setting up Meson build..."
|
||||
meson setup _build --prefix="$HOME/.local" --buildtype=debugoptimized
|
||||
|
||||
# Build
|
||||
echo -e "${YELLOW}Building Cthulhu...${NC}"
|
||||
echo "Building Cthulhu..."
|
||||
meson compile -C _build
|
||||
|
||||
# Install
|
||||
echo -e "${YELLOW}Installing Cthulhu to ~/.local...${NC}"
|
||||
echo "Installing Cthulhu to ~/.local..."
|
||||
meson install -C _build
|
||||
|
||||
# Update desktop database and icon cache
|
||||
if command -v update-desktop-database &> /dev/null; then
|
||||
echo -e "${YELLOW}Updating desktop database...${NC}"
|
||||
echo "Updating desktop database..."
|
||||
update-desktop-database "$HOME/.local/share/applications" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
if command -v gtk-update-icon-cache &> /dev/null; then
|
||||
echo -e "${YELLOW}Updating icon cache...${NC}"
|
||||
echo "Updating icon cache..."
|
||||
gtk-update-icon-cache -f -t "$HOME/.local/share/icons/hicolor" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
echo
|
||||
echo -e "${GREEN}Build completed successfully!${NC}"
|
||||
echo "Build completed successfully!"
|
||||
echo
|
||||
echo "To run Cthulhu:"
|
||||
echo " ~/.local/bin/cthulhu"
|
||||
@@ -93,4 +80,4 @@ echo "To run Cthulhu setup:"
|
||||
echo " ~/.local/bin/cthulhu -s"
|
||||
echo
|
||||
echo "Build artifacts are in: _build/"
|
||||
echo -e "${BLUE}To clean build artifacts, run: ${YELLOW}rm -rf _build${NC}"
|
||||
echo "To clean build artifacts, run: rm -rf _build"
|
||||
|
||||
Reference in New Issue
Block a user