1
0
Fork 0
mirror of synced 2024-06-28 19:21:05 +12:00

Merge pull request #302 from z-ffqq/main

feat: add freebsd support
This commit is contained in:
Dummerle 2023-07-17 23:28:19 +02:00 committed by GitHub
commit 74802eb1d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 3 deletions

View file

@ -93,7 +93,7 @@ In the [actions](https://github.com/Dummerle/Rare/actions) tab you can find pack
Execute `pip install Rare` for all users, or `pip install Rare --user` for the current user only.
Linux and Mac: execute `rare` in your terminal.
Linux, Mac and FreeBSD: execute `rare` in your terminal.
Windows: execute `pythonw -m rare` in cmd
@ -123,6 +123,7 @@ On Mac:
If you want to be able to use the automatic login, run `pip install -r optional_requirements.txt`
If you are on Arch you can
run `sudo pacman --needed -S python-wheel python-setuptools python-pyqt5 python-qtawesome python-requests python-psutil`
If you are on FreeBSD you have to install py39-qt5 from the packages: `sudo pkg install py39-qt5`
4. Run `python3 -m rare`
## Contributing

View file

@ -29,6 +29,7 @@ pywin32 = { version = "^304", markers = "platform_system == 'Windows'" }
pywebview = [
{ version = "^3.6.3", extras = ["cef"], platform = "windows", optional = true },
{ version = "^3.6.3", extras = ["gtk"], platform = "linux", optional = true },
{ version = "^3.6.3", extras = ["gtk"], platform = "freebsd", optional = true },
]
legendary-gl = "^0.20.32"
typing-extensions = "^4.3.0"

View file

@ -80,6 +80,10 @@ __link_suffix = {
"link": "lnk",
"icon": "ico",
},
"FreeBSD": {
"link": "desktop",
"icon": "png",
},
"Linux": {
"link": "desktop",
"icon": "png",
@ -128,7 +132,7 @@ def get_rare_executable() -> List[str]:
# lk: detect if nuitka
if "__compiled__" in globals():
executable = [sys.executable]
elif platform.system() == "Linux" or platform.system() == "Darwin":
elif platform.system() == "Linux" or platform.system() == "Darwin" or platform.system() == "FreeBSD":
if p := os.environ.get("APPIMAGE"):
executable = [p]
else:
@ -199,7 +203,7 @@ def create_desktop_link(app_name: str, app_title: str = "", link_name: str = "",
else:
logger.info(f"Creating shortcut for {app_title} at {shortcut_path}")
if platform.system() == "Linux":
if platform.system() == "Linux" or platform.system() == "FreeBSD":
executable = get_rare_executable()
executable = shlex.join(executable)
if not for_rare:

View file

@ -6,6 +6,7 @@ setuptools
legendary-gl
pywin32; platform_system == "Windows"
pywebview[qt]; platform_system == "Linux"
pywebview[qt]; platform_system == "FreeBSD"
pythonnet>=3.0.0rc4; platform_system == "Windows"
cefpython3; platform_system == "Windows"
pywebview[cef]; platform_system == "Windows"

View file

@ -1,4 +1,5 @@
pywebview[qt]; platform_system == "Linux"
pywebview[qt]; platform_system == "FreeBSD"
pythonnet>=3.0.0rc4; platform_system == "Windows"
cefpython3; platform_system == "Windows"
pywebview[cef]; platform_system == "Windows"

View file

@ -19,6 +19,7 @@ requirements = [
optional_reqs = dict(
webview=[
'pywebview[gtk]; platform_system == "Linux"',
'pywebview[gtk]; platform_system == "FreeBSD"',
'pywebview[cef]; platform_system == "Windows"',
],
pypresence=["pypresence"]