-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from t0xic0der/poetry-restructuring
Restructuring with Poetry + Modularity + Bug fixes
- Loading branch information
Showing
44 changed files
with
1,936 additions
and
964 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,11 +1,11 @@ | ||
%global srcname nvidia-auto-installer-for-fedora | ||
%global srcname nvidia-auto-installer-for-fedora-linux | ||
|
||
Name: nvautoinstall | ||
Version: 0.3.9 | ||
Release: 1%{?dist} | ||
Summary: NVIDIA Auto Installer for Fedora | ||
Version: 0.4.0 | ||
Release: 0%{?dist} | ||
Summary: NVIDIA Auto Installer for Fedora Linux | ||
|
||
License: GPLv3 | ||
License: GPLv3+ | ||
Url: https://github.com/t0xic0der/%{srcname} | ||
Source0: https://github.com/t0xic0der/%{srcname}/releases/download/v%{version}/%{name}-%{version}.tar.gz | ||
|
||
|
@@ -16,7 +16,7 @@ BuildRequires: python3-devel | |
Requires: dnf-plugins-core | ||
|
||
%description | ||
A CLI tool which lets you install proprietary NVIDIA drivers and much more | ||
A CLI tool which lets you install proprietary NVIDIA drivers and much more easily on Fedora Linux (32 or above, ELN or Rawhide) | ||
|
||
%prep | ||
%autosetup | ||
|
@@ -38,6 +38,17 @@ A CLI tool which lets you install proprietary NVIDIA drivers and much more | |
|
||
%changelog | ||
|
||
* Thu Dec 16 2021 Akashdeep Dhar <[email protected]> - 0.4.0-0 | ||
- v0.4.0 | ||
- Restructured the project to make the codebase more modular | ||
- Performed repository clean up and removal of static files | ||
- Reworked the dependency management with the use of Poetry | ||
- Deprecated COPR build updates for Mageia, EPEL and OpenSUSE | ||
- Reimplimented CLI compositing to make use of commands over options | ||
- Removed dedicated installation of x86 NVIDIA libraries due to inclusion | ||
- Fixed RPM Fusion Non-free repo detection by force installation | ||
- Updated official CUDA repositories to point to Fedora 34 or later | ||
|
||
* Thu Aug 12 2021 Akashdeep Dhar <[email protected]> - 0.3.9-1 | ||
- v0.3.9 | ||
- Reworked RPM specfile with pyproject directives | ||
|
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,33 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
from .interfaces.check_superuser_permissions import CheckSuperuserPermissions | ||
from .interfaces.handle_compatibility_check import HandleCompatibilityCheck | ||
from .interfaces.handle_drivers_installation import HandleDriverInstallation | ||
from .interfaces.handle_prime_support import HandlePrimeSupport | ||
from .interfaces.handle_rpmfusion_repositories import \ | ||
HandleRPMFusionRepositories | ||
from .interfaces.install_cuda_support import InstallCudaSupport | ||
from .interfaces.install_everything import InstallEverything | ||
from .interfaces.install_ffmpeg_support import InstallFfmpegSupport | ||
from .interfaces.install_nvidia_repositories import InstallNvidiaRepositories | ||
from .interfaces.install_video_acceleration import InstallVideoAcceleration | ||
from .interfaces.install_vulkan_support import InstallVulkanSupport | ||
|
||
__version__ = "0.4.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,20 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
from .status import failure, general, section, success, warning |
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,46 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
from click import echo, style | ||
|
||
PASS = style("[ \u2713 ]", fg="green", bold=True) | ||
FAIL = style("[ \u2717 ]", fg="red", bold=True) | ||
WARN = style("[ ! ]", fg="yellow", bold=True) | ||
HEAD = style("[ \u2605 ]", fg="magenta", bold=True) | ||
STDS = " " | ||
|
||
|
||
def success(message): | ||
echo(PASS + " " + message) | ||
|
||
|
||
def failure(message): | ||
echo(FAIL + " " + message) | ||
|
||
|
||
def warning(message): | ||
echo(WARN + " " + message) | ||
|
||
|
||
def section(message): | ||
echo(HEAD + " " + style(message, fg="magenta", bold=True)) | ||
|
||
|
||
def general(message): | ||
echo(STDS + " " + message) |
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,35 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
from ..decoration import failure, general, section, success, warning | ||
from ..operations import (CheckSuperuserPermissions, HandleCompatibilityCheck, | ||
HandleCudaInstallation, HandleDriversInstallation, | ||
HandlePrimeSupport, HandleRPMFusionRepositories, | ||
InstallFfmpegSupport, InstallVideoAcceleration, | ||
InstallVulkanSupport) | ||
|
||
Objc_CheckSuperuserPermissions = CheckSuperuserPermissions() | ||
Objc_HandlePrimeSupport = HandlePrimeSupport() | ||
Objc_HandleCompatibilityCheck = HandleCompatibilityCheck() | ||
Objc_HandleCudaInstallation = HandleCudaInstallation() | ||
Objc_HandleRPMFusionRepositories = HandleRPMFusionRepositories() | ||
Objc_InstallFfmpegSupport = InstallFfmpegSupport() | ||
Objc_HandleDriversInstallation = HandleDriversInstallation() | ||
Objc_InstallVideoAcceleration = InstallVideoAcceleration() | ||
Objc_InstallVulkanSupport = InstallVulkanSupport() |
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,36 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
import sys | ||
|
||
from . import (Objc_CheckSuperuserPermissions, failure, general, section, | ||
success) | ||
|
||
|
||
class CheckSuperuserPermissions: | ||
def __init__(self): | ||
section("CHECKING SUPERUSER PERMISSIONS...") | ||
if Objc_CheckSuperuserPermissions.main(): | ||
success("Superuser permission is available") | ||
general("This tool is expected to work correctly here") | ||
else: | ||
failure("Superuser permission is not available") | ||
general("This tool cannot be used here") | ||
failure("Leaving installer") | ||
sys.exit(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,62 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
import sys | ||
|
||
from . import (Objc_HandleCompatibilityCheck, failure, general, section, | ||
success, warning) | ||
|
||
|
||
class HandleCompatibilityCheck: | ||
def __init__(self): | ||
section("CHECKING FOR GPU COMPATIBILITY...") | ||
data = Objc_HandleCompatibilityCheck.gpuc() | ||
warning("Compatibility infomation was obtained") | ||
if data is False: | ||
failure("No supported NVIDIA GPU was detected") | ||
else: | ||
success("One or more active NVIDIA GPUs were detected") | ||
supprt = data["supprt"] | ||
gpulst = data["gpulst"] | ||
for indx in gpulst: | ||
if indx != "": | ||
general(indx) | ||
if supprt == "single": | ||
success("An single dedicated GPU setup was detected") | ||
else: | ||
success("An Optimus Dual GPU setup was detected") | ||
section("GATHERING CURRENT HOST INFORMATION...") | ||
data = Objc_HandleCompatibilityCheck.main() | ||
warning("Host information was gathered") | ||
for indx in data.keys(): | ||
general(indx + ": " + data[indx]) | ||
section("CHECKING FOR HOST COMPATIBILITY...") | ||
data = Objc_HandleCompatibilityCheck.avbl() | ||
if data is False: | ||
failure("Unsupported OS detected") | ||
general("This tool cannot be used here") | ||
else: | ||
if data == "full": | ||
success("Supported OS detected") | ||
general("This tool is expected to work correctly here") | ||
elif data == "half": | ||
warning("Minimally supported OS detected") | ||
general("Discretion is advised while using this tool") | ||
failure("Leaving installer") | ||
sys.exit(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,68 @@ | ||
""" | ||
NVIDIA Auto Installer for Fedora Linux | ||
Copyright (C) 2019-2021 Akashdeep Dhar | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
|
||
import sys | ||
|
||
from . import (Objc_CheckSuperuserPermissions, Objc_HandleDriversInstallation, | ||
Objc_HandleRPMFusionRepositories, failure, general, section, | ||
success, warning) | ||
|
||
|
||
class HandleDriverInstallation: | ||
def __init__(self): | ||
section("CHECKING SUPERUSER PERMISSIONS...") | ||
if Objc_CheckSuperuserPermissions.main(): | ||
success("Superuser privilege acquired") | ||
section("CHECKING AVAILABILITY OF RPM FUSION NVIDIA REPOSITORY...") | ||
if Objc_HandleRPMFusionRepositories.avbl(): | ||
warning( | ||
"RPM Fusion repository for Proprietary NVIDIA Driver was detected" | ||
) | ||
section("ATTEMPTING CONNECTION TO RPM FUSION SERVERS...") | ||
if Objc_HandleRPMFusionRepositories.conn(): | ||
success("Connection to RPM Fusion servers was established") | ||
section("LOOKING FOR EXISTING DRIVER PACKAGES...") | ||
data = Objc_HandleDriversInstallation.avbl() | ||
if data is False: | ||
warning("No existing NVIDIA driver packages were detected") | ||
section("INSTALLING PROPRIETARY DRIVERS...") | ||
else: | ||
qant = 0 | ||
for indx in data: | ||
if indx != "": | ||
qant += 1 | ||
general(indx) | ||
warning( | ||
"A total of " + str(qant) + " driver packages were detected" | ||
) | ||
section("REINSTALLING PROPRIETARY DRIVERS...") | ||
if Objc_HandleDriversInstallation.main(): | ||
success("Driver package installation completed") | ||
else: | ||
failure("Proprietary drivers could not be installed") | ||
else: | ||
failure("Connection to RPM Fusion servers could not be established") | ||
else: | ||
failure( | ||
"RPM Fusion repository for Proprietary NVIDIA Driver was not detected" | ||
) | ||
else: | ||
failure("Superuser privilege could not be acquired") | ||
failure("Leaving installer") | ||
sys.exit(0) |
Oops, something went wrong.