Skip to content

Commit

Permalink
Merge pull request vikingsoftware-com#2 from vikingsoftware-com/debia…
Browse files Browse the repository at this point in the history
…n_12_support

Fix broken Debian 12 suppoer
  • Loading branch information
VikingGuenter authored Jul 8, 2024
2 parents 5e47d8e + d068ba2 commit fbc8a6e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pytastewidgets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Prerequisites

Have Python3 and PySide installed.
PySyde is needed to use detect the correct version of PySide and Qt.
PySide is needed to use detect the correct version of PySide and Qt.

### Do the installation

Expand Down
29 changes: 20 additions & 9 deletions pytastewidgets/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

def module_version(moduleName):
"""
Returns the version of the module moduleName.
Otherwise returns the string "N/A"
Returns the version of the module moduleName.
Otherwise returns the string "N/A"
"""
try:
try:
if sys.version_info >= (3, 8):
return(version(moduleName))
else:
Expand Down Expand Up @@ -60,7 +60,7 @@ def __init__(self):

def python_version_str(self):
return str(self.python_version[0]) + "." + str(self.python_version[1]) + "." + str(self.python_version[2])

def print_info(self):
print("Python version : " + self.python_version_str())
print("Qt/PySide version : " + self.qt_version)
Expand Down Expand Up @@ -136,8 +136,8 @@ def distro_check(info):
apt_install(["llvm-13", "llvm-13-dev", "libclang-13-dev", "clang-13", "patchelf", "ninja-build"])
check_ssl(info)
elif distro.version() == "12":
config_file += '13'
apt_install(["llvm-13", "llvm-13-dev", "libclang-13-dev", "clang-13", "libgl-dev", "patchelf", "ninja-build"])
config_file += '14'
apt_install(["llvm-14", "llvm-14-dev", "libclang-14-dev", "clang-14", "libgl-dev", "patchelf", "ninja-build"])
check_ssl(info)
else:
print("Warning: untested Debian version!")
Expand All @@ -152,12 +152,24 @@ def distro_check(info):
print("Warning: untested operating system!")

#Create symlink to llvm-config on /usr/bin
config_link = "/usr/bin/llvm-config"
# First check for a broken link
if os.path.islink(config_link):
target_path = os.readlink(config_link)
# Resolve relative symlinks
if not os.path.isabs(target_path):
target_path = os.path.join(os.path.dirname(config_link),target_path)
if not os.path.exists(target_path):
print("Remove broken llvm-config symlink")
run_command(['sudo', 'rm', config_link])
# Check if the link needs to be created
try:
os.symlink(config_file, "/usr/bin/llvm-config")
os.symlink(config_file, config_link)
except FileExistsError:
print ("The symlink already exists")
except OSError:
run_command(['sudo', 'ln', '-s', config_file, '/usr/bin/llvm-config'])
print ("Creating symlink '/usr/bin/llvm-config'")
run_command(['sudo', 'ln', '-s', config_file, config_link])


def cmake_prepare(info, environ=os.environ):
Expand Down Expand Up @@ -234,4 +246,3 @@ def check_install_qt_dev(info):

print("** Install module")
cmake_install(info)

0 comments on commit fbc8a6e

Please sign in to comment.