diff --git a/pkgs/by-name/ga/gamma-launcher/package.nix b/pkgs/by-name/ga/gamma-launcher/package.nix new file mode 100644 index 000000000000..c1559f169a43 --- /dev/null +++ b/pkgs/by-name/ga/gamma-launcher/package.nix @@ -0,0 +1,45 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + versionCheckHook, +}: +python3Packages.buildPythonApplication rec { + pname = "gamma-launcher"; + version = "2.5"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Mord3rca"; + repo = "gamma-launcher"; + tag = "v${version}"; + hash = "sha256-qzjfgDFimEL6vtsJBubY6fHsokilDB248WwHJt3F7fI="; + }; + + build-system = [ python3Packages.setuptools ]; + + dependencies = with python3Packages; [ + beautifulsoup4 + cloudscraper + gitpython + platformdirs + py7zr + python-unrar + requests + tenacity + tqdm + ]; + + nativeCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + meta = { + description = "Python cli to download S.T.A.L.K.E.R. GAMMA"; + changelog = "https://github.com/Mord3rca/gamma-launcher/releases/tag/v${version}"; + homepage = "https://github.com/Mord3rca/gamma-launcher"; + mainProgram = "gamma-launcher"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ DrymarchonShaun ]; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/development/python-modules/python-unrar/default.nix b/pkgs/development/python-modules/python-unrar/default.nix new file mode 100644 index 000000000000..1b1244d90e59 --- /dev/null +++ b/pkgs/development/python-modules/python-unrar/default.nix @@ -0,0 +1,46 @@ +{ + stdenv, + lib, + replaceVars, + buildPythonPackage, + fetchPypi, + unrar, + pytestCheckHook, + setuptools, +}: +buildPythonPackage rec { + pname = "python-unrar"; + version = "0.4"; + pyproject = true; + + src = fetchPypi { + pname = "unrar"; + inherit version; + hash = "sha256-skRHpbkwJL5gDvglVmi6I6MPRRF2V3tpFVnqE1n30WQ="; + }; + + build-system = [ + setuptools + ]; + + patches = [ + (replaceVars ./use_nix_unrar_path.patch { + unrar_lib_path = "${unrar}/lib/libunrar${stdenv.hostPlatform.extensions.sharedLibrary}"; + }) + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + doCheck = true; + + pythonImportsCheck = [ "unrar" ]; + + meta = { + homepage = "http://github.com/matiasb/python-unrar"; + changelog = "https://github.com/matiasb/python-unrar/releases/tag/v${version}"; + description = "Wrapper for UnRAR library, plus a rarfile module on top of it"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ DrymarchonShaun ]; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/development/python-modules/python-unrar/use_nix_unrar_path.patch b/pkgs/development/python-modules/python-unrar/use_nix_unrar_path.patch new file mode 100644 index 000000000000..590315038abd --- /dev/null +++ b/pkgs/development/python-modules/python-unrar/use_nix_unrar_path.patch @@ -0,0 +1,13 @@ +diff --git a/unrar/unrarlib.py b/unrar/unrarlib.py +index 06df081..22c1dde 100644 +--- a/unrar/unrarlib.py ++++ b/unrar/unrarlib.py +@@ -31,7 +31,7 @@ __all__ = ["RAROpenArchiveDataEx", "RARHeaderDataEx", "RAROpenArchiveEx", + "dostime_to_timetuple"] + + +-lib_path = os.environ.get('UNRAR_LIB_PATH', None) ++lib_path = "@unrar_lib_path@" + + # find and load unrar library + unrarlib = None diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bcace84c7fdc..7858f2552348 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15367,6 +15367,8 @@ self: super: with self; { python-ulid = callPackage ../development/python-modules/python-ulid { }; + python-unrar = callPackage ../development/python-modules/python-unrar { inherit (pkgs) unrar; }; + python-utils = callPackage ../development/python-modules/python-utils { }; python-vagrant = callPackage ../development/python-modules/python-vagrant { };