-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add manjaro installation instructions (#102)
- Loading branch information
1 parent
2595804
commit b82ac53
Showing
4 changed files
with
101 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
setuptools | ||
pyyaml | ||
cpplint | ||
raccoonlab-tools==0.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Install.py | ||
""" | ||
|
||
import sys | ||
import platform | ||
import subprocess | ||
|
||
|
||
def run_command(command): | ||
try: | ||
print(f"$ {command}") | ||
subprocess.run(command, shell=True, check=True) | ||
except subprocess.CalledProcessError: | ||
print("Error: Command execution failed") | ||
sys.exit(1) | ||
except KeyboardInterrupt: | ||
print("KeyboardInterrupt") | ||
|
||
def main(): | ||
system_name = platform.system().lower() | ||
|
||
if system_name == "windows": | ||
print("Detected Windows. Installing packages...") | ||
run_command("choco install -y gcc-arm-embedded make cmake") | ||
|
||
elif system_name == "linux": | ||
try: | ||
# Detect Linux distribution | ||
with open("/etc/os-release", "r") as f: | ||
os_info = f.read().lower() | ||
|
||
if "ubuntu" in os_info or "debian" in os_info: | ||
print("Detected Ubuntu/Debian. Installing packages...") | ||
run_command("sudo apt-get install -y gcc-arm-none-eabi") | ||
|
||
elif "manjaro" in os_info: | ||
print("Detected Manjaro. Installing packages...") | ||
run_command("sudo pacman -S cmake arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib") | ||
|
||
else: | ||
print("Unknown Linux distribution.") | ||
sys.exit(1) | ||
|
||
except FileNotFoundError: | ||
print("Could not determine Linux distribution.") | ||
sys.exit(1) | ||
|
||
elif system_name == "darwin": | ||
print("macOS is not supported at the moment.") | ||
sys.exit(1) | ||
|
||
else: | ||
print("Unknown platform.") | ||
sys.exit(1) | ||
|
||
if __name__ == "__main__": | ||
main() |