2022-12-05 22:04:59 +01:00
|
|
|
{ lib
|
|
|
|
, bubblewrap
|
|
|
|
, cacert
|
|
|
|
, callPackage
|
|
|
|
, fetchFromGitLab
|
|
|
|
, fetchurl
|
|
|
|
, fetchzip
|
|
|
|
, git
|
|
|
|
, imagemagick
|
|
|
|
, jre
|
|
|
|
, makeWrapper
|
|
|
|
, openmw
|
|
|
|
, perlPackages
|
|
|
|
, python3Packages
|
|
|
|
, rustPlatform
|
|
|
|
, tes3cmd
|
|
|
|
, tr-patcher
|
|
|
|
}:
|
2020-10-17 10:50:51 +02:00
|
|
|
|
|
|
|
let
|
2021-11-11 15:00:32 +01:00
|
|
|
version = "2.1.0";
|
2020-10-17 10:50:51 +02:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "portmod";
|
|
|
|
repo = "Portmod";
|
|
|
|
rev = "v${version}";
|
2022-12-05 22:04:59 +01:00
|
|
|
hash = "sha256-b/ENApFovMPNUMbJhwY+TZCnSzpr1e/IKJ/5XAGTQjE=";
|
2020-10-17 10:50:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
portmod-rust = rustPlatform.buildRustPackage rec {
|
|
|
|
inherit src version;
|
|
|
|
pname = "portmod-rust";
|
|
|
|
|
2021-11-11 15:00:32 +01:00
|
|
|
cargoHash = "sha256-3EfMMpSWSYsB3nXaoGGDuKQ9duyCKzbrT6oeATnzqLE=";
|
2020-10-17 10:50:51 +02:00
|
|
|
|
2022-12-05 22:04:59 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
python3Packages.python
|
|
|
|
];
|
2020-10-17 10:50:51 +02:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
bin-programs = [
|
|
|
|
bubblewrap
|
|
|
|
git
|
|
|
|
python3Packages.virtualenv
|
|
|
|
tr-patcher
|
|
|
|
tes3cmd
|
2021-02-27 18:36:56 +01:00
|
|
|
imagemagick
|
2021-11-11 15:00:32 +01:00
|
|
|
openmw
|
2020-10-17 10:50:51 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
inherit src version;
|
|
|
|
|
|
|
|
pname = "portmod";
|
|
|
|
|
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
# build the rust library independantly
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "from setuptools_rust import Binding, RustExtension" "" \
|
2021-08-10 11:55:15 +02:00
|
|
|
--replace "RustExtension(\"portmodlib.portmod\", binding=Binding.PyO3, strip=True)" ""
|
2020-10-17 10:50:51 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2021-06-03 12:09:11 +02:00
|
|
|
setuptools-scm
|
2020-10-17 10:50:51 +02:00
|
|
|
setuptools
|
|
|
|
requests
|
|
|
|
chardet
|
|
|
|
colorama
|
|
|
|
restrictedpython
|
|
|
|
appdirs
|
2022-12-05 22:04:59 +01:00
|
|
|
gitpython
|
2020-10-17 10:50:51 +02:00
|
|
|
progressbar2
|
|
|
|
python-sat
|
|
|
|
redbaron
|
|
|
|
patool
|
|
|
|
packaging
|
2021-08-10 11:55:15 +02:00
|
|
|
fasteners
|
2020-10-17 10:50:51 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ bin-programs;
|
|
|
|
|
|
|
|
preCheck = ''
|
2021-08-10 11:55:15 +02:00
|
|
|
cp ${portmod-rust}/lib/libportmod.so portmodlib/portmod.so
|
2020-10-17 10:50:51 +02:00
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
# some test require network access
|
|
|
|
disabledTests = [
|
|
|
|
"test_masters_esp"
|
|
|
|
"test_logging"
|
|
|
|
"test_execute_network_permissions"
|
|
|
|
"test_execute_permissions_bleed"
|
|
|
|
"test_git"
|
2021-08-10 11:55:15 +02:00
|
|
|
"test_sync"
|
|
|
|
"test_manifest"
|
|
|
|
"test_add_repo"
|
2020-10-17 10:50:51 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
# for some reason, installPhase doesn't copy the compiled binary
|
|
|
|
postInstall = ''
|
2021-08-10 11:55:15 +02:00
|
|
|
cp ${portmod-rust}/lib/libportmod.so $out/${python3Packages.python.sitePackages}/portmodlib/portmod.so
|
2020-10-17 10:50:51 +02:00
|
|
|
|
|
|
|
makeWrapperArgs+=("--prefix" "GIT_SSL_CAINFO" ":" "${cacert}/etc/ssl/certs/ca-bundle.crt" \
|
|
|
|
"--prefix" "PATH" ":" "${lib.makeBinPath bin-programs }")
|
|
|
|
'';
|
|
|
|
|
2022-12-05 22:04:59 +01:00
|
|
|
meta = with lib; {
|
2020-10-17 10:50:51 +02:00
|
|
|
description = "mod manager for openMW based on portage";
|
|
|
|
homepage = "https://gitlab.com/portmod/portmod";
|
2022-12-05 22:04:59 +01:00
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ marius851000 ];
|
2020-10-17 10:50:51 +02:00
|
|
|
};
|
|
|
|
}
|