Unverified Commit 1482d00f authored by Bruno Bigras's avatar Bruno Bigras Committed by GitHub
Browse files

gamma-launcher: init at 2.5 (#430510)

parents 5908cc46 f8acacb9
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
{
  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;
  };
}
+46 −0
Original line number Diff line number Diff line
{
  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;
  };
}
+13 −0
Original line number Diff line number Diff line
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
+2 −0
Original line number Diff line number Diff line
@@ -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 { };