-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·155 lines (139 loc) · 5.47 KB
/
install.sh
File metadata and controls
executable file
·155 lines (139 loc) · 5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash
#===============================================================================
# ChimeraX 3decision Plugin Installer
# Follows official ChimeraX bundle development guidelines
# https://www.cgl.ucsf.edu/chimerax/docs/devel/writing_bundles.html
#===============================================================================
set -e # Exit on any error
echo "========================================"
echo "ChimeraX 3decision Plugin Installer"
echo "Official ChimeraX Bundle Format"
echo "========================================"
# Function to find ChimeraX
find_chimerax() {
local chimerax_paths=(
"/Applications/ChimeraX-*.app/Contents/bin/ChimeraX" # macOS
"/Applications/ChimeraX.app/Contents/bin/ChimeraX"
"/usr/local/bin/ChimeraX" # Linux
"/usr/bin/ChimeraX"
"/opt/ChimeraX*/bin/ChimeraX"
"$HOME/ChimeraX*/bin/ChimeraX"
"$(which ChimeraX 2>/dev/null)"
)
# Also check Windows paths if we're in a Windows-like environment
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]] || [[ -n "$WINDIR" ]]; then
chimerax_paths+=(
"/c/Program Files/ChimeraX*/bin/ChimeraX.exe"
"/c/Program Files (x86)/ChimeraX*/bin/ChimeraX.exe"
)
fi
for pattern in "${chimerax_paths[@]}"; do
if [[ "$pattern" == *"*"* ]]; then
# Handle glob patterns
for path in $pattern; do
if [[ -x "$path" ]]; then
echo "$path"
return 0
fi
done
else
# Direct path check
if [[ -x "$pattern" ]]; then
echo "$pattern"
return 0
fi
fi
done
return 1
}
# Main installation function following official guidelines
main() {
echo "Starting installation using official ChimeraX method..."
echo "Plugin directory: $(pwd)"
echo
# Check if we're in the correct directory
if [[ ! -f "bundle_info.xml" ]]; then
echo "❌ bundle_info.xml not found. Please run from the plugin directory."
echo "Expected files: bundle_info.xml, setup.py, src/ directory"
exit 1
fi
# Find ChimeraX
if CHIMERAX_PATH=$(find_chimerax); then
echo "✅ Found ChimeraX: $CHIMERAX_PATH"
CHIMERAX_VERSION=$("$CHIMERAX_PATH" --version 2>/dev/null | head -n 1 | sed 's/ChimeraX //' || echo "unknown")
echo " Version: $CHIMERAX_VERSION"
else
echo "❌ ChimeraX not found."
echo ""
echo "Please install ChimeraX from: https://www.rbvi.ucsf.edu/chimerax/download.html"
echo ""
echo "Or specify ChimeraX path manually:"
echo " export CHIMERAX_PATH='/path/to/ChimeraX'"
echo " $0"
exit 1
fi
echo
echo "Building and installing bundle using official ChimeraX method..."
echo "Command: $CHIMERAX_PATH --nogui --cmd \"devel install $(pwd); exit\""
echo
# Use the official ChimeraX devel install command
# This is the recommended method from the official documentation
if "$CHIMERAX_PATH" --nogui --cmd "devel install $(pwd); exit"; then
echo
echo "✅ Bundle installed successfully!"
else
echo
echo "❌ Installation failed!"
echo
echo "Troubleshooting tips:"
echo "1. Ensure ChimeraX version is 1.8 or later"
echo "2. Check that you have write permissions to ChimeraX bundle directory"
echo "3. On Linux, install build dependencies: sudo apt-get install python3-dev build-essential"
echo "4. Try running ChimeraX with debug output: $CHIMERAX_PATH --debug"
exit 1
fi
echo
echo "Testing installation..."
# Test the installation
if "$CHIMERAX_PATH" --nogui --cmd "python 'import chimerax.threedecision; print(\"✅ Module import successful\")'; exit" 2>/dev/null | grep -q "Module import successful"; then
echo "✅ Installation verified successfully"
else
echo "⚠️ Installation completed but verification failed"
echo "Try restarting ChimeraX and check for error messages"
fi
echo
echo "========================================"
echo "INSTALLATION COMPLETED!"
echo "========================================"
echo
echo "The 3decision plugin has been installed as a ChimeraX bundle."
echo
echo "To use the plugin:"
echo "1. Start ChimeraX"
echo "2. Use menu: Tools → Structure Analysis → Discngine 3decision"
echo "3. Or use command: threedecision"
echo
echo "For configuration, click the Settings (⚙️) button in the plugin interface."
echo
echo "Bundle location: Check with 'toolshed list' command in ChimeraX"
echo "========================================"
}
# Show help if requested
if [[ "$1" == "--help" ]] || [[ "$1" == "-h" ]]; then
echo "ChimeraX 3decision Plugin Installer"
echo
echo "This installer follows the official ChimeraX bundle development guidelines."
echo "It uses the 'devel install' command which is the recommended method for"
echo "building and installing ChimeraX bundles."
echo
echo "Usage: $0 [--help]"
echo
echo "Environment variables:"
echo " CHIMERAX_PATH Path to ChimeraX executable (if not in standard locations)"
echo
echo "Official documentation:"
echo " https://www.cgl.ucsf.edu/chimerax/docs/devel/writing_bundles.html"
exit 0
fi
# Run main installation
main "$@"