
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253. This wasn't tested for correctness with something like fodwatch [0], and should not have been (self-)merged so quickly, especially without further review. It also resulted in the breakage of at least one package [1] (and that's the one we know of and was caught). A few packages that were updated in between this commit and this revert were not reverted back to using `rev`, but other than that, this is a 1:1 revert. [0]: https://codeberg.org/raphaelr/fodwatch [1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
131 lines
2.7 KiB
Nix
131 lines
2.7 KiB
Nix
{
|
|
lib,
|
|
bubblewrap,
|
|
cacert,
|
|
fetchFromGitLab,
|
|
git,
|
|
imagemagick,
|
|
openmw,
|
|
python3Packages,
|
|
rustPlatform,
|
|
tes3cmd,
|
|
tr-patcher,
|
|
}:
|
|
|
|
let
|
|
version = "2.8.1";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "portmod";
|
|
repo = "Portmod";
|
|
rev = "v${version}";
|
|
hash = "sha256-d5XNfjDgtBkNkUMhShYTjKtMbwVa2tLXdvYi6sXQmIA=";
|
|
};
|
|
|
|
portmod-rust = rustPlatform.buildRustPackage {
|
|
inherit src version;
|
|
pname = "portmod-rust";
|
|
|
|
useFetchCargoVendor = true;
|
|
cargoHash = "sha256-hLci2O+eliCgscvvC4ejn6ZDtFQnM5K6f0luu2cYIHM=";
|
|
|
|
nativeBuildInputs = [
|
|
python3Packages.python
|
|
];
|
|
|
|
doCheck = false;
|
|
};
|
|
|
|
bin-programs = [
|
|
bubblewrap
|
|
git
|
|
python3Packages.virtualenv
|
|
tr-patcher
|
|
tes3cmd
|
|
imagemagick
|
|
openmw
|
|
];
|
|
|
|
in
|
|
python3Packages.buildPythonApplication {
|
|
inherit src version;
|
|
|
|
pname = "portmod";
|
|
format = "pyproject";
|
|
|
|
# build the rust library independently
|
|
prePatch = ''
|
|
substituteInPlace setup.py \
|
|
--replace "from setuptools_rust import Binding, RustExtension, Strip" "" \
|
|
--replace "RustExtension(\"portmodlib.portmod\", binding=Binding.PyO3, strip=Strip.Debug)" ""
|
|
|
|
substituteInPlace pyproject.toml \
|
|
--replace '"setuptools-rust"' ""
|
|
'';
|
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
setuptools
|
|
wheel
|
|
];
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
setuptools-scm
|
|
setuptools
|
|
requests
|
|
chardet
|
|
colorama
|
|
deprecated
|
|
restrictedpython
|
|
appdirs
|
|
gitpython
|
|
progressbar2
|
|
python-sat
|
|
redbaron
|
|
patool
|
|
packaging
|
|
fasteners
|
|
];
|
|
|
|
nativeCheckInputs =
|
|
with python3Packages;
|
|
[
|
|
pytestCheckHook
|
|
]
|
|
++ bin-programs;
|
|
|
|
preCheck = ''
|
|
cp ${portmod-rust}/lib/libportmod.so portmodlib/portmod.so
|
|
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"
|
|
"test_sync"
|
|
"test_manifest"
|
|
"test_add_repo"
|
|
"test_init_prefix_interactive"
|
|
"test_scan_sources"
|
|
"test_unpack"
|
|
];
|
|
|
|
# for some reason, installPhase doesn't copy the compiled binary
|
|
postInstall = ''
|
|
cp ${portmod-rust}/lib/libportmod.so $out/${python3Packages.python.sitePackages}/portmodlib/portmod.so
|
|
|
|
makeWrapperArgs+=("--prefix" "GIT_SSL_CAINFO" ":" "${cacert}/etc/ssl/certs/ca-bundle.crt" \
|
|
"--prefix" "PATH" ":" "${lib.makeBinPath bin-programs}")
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "mod manager for openMW based on portage";
|
|
homepage = "https://gitlab.com/portmod/portmod";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ marius851000 ];
|
|
};
|
|
}
|