p/minecraft-overviewer: cleanup, fixes, and more fixes

This commit is contained in:
Ari Gato 2025-01-08 20:15:20 +01:00
parent e3c01d2644
commit c4d48bea03
5 changed files with 63 additions and 61 deletions

View file

@ -188,8 +188,8 @@
systemd.services.minecraft-overviewer = {
script = ''
${pkgs.python311Packages.minecraft-overviewer}/bin/overviewer.py -p 12 -c "/srv/minecraft-overviewer/survival/config.py"
${pkgs.python311Packages.minecraft-overviewer}/bin/overviewer.py -p 12 -c "/srv/minecraft-overviewer/survival/config.py" --genpoi
${pkgs.minecraft-overviewer}/bin/overviewer.py -p 12 -c "/srv/minecraft-overviewer/survival/config.py"
${pkgs.minecraft-overviewer}/bin/overviewer.py -p 12 -c "/srv/minecraft-overviewer/survival/config.py" --genpoi
'';
serviceConfig = {
User = "minecraft";

View file

@ -1,7 +1,5 @@
self: super:
let
inherit (self) lib;
emptyDir = self.emptyDirectory;
let inherit (self) lib;
in {
cass = super.callPackage ../pkgs/cass.nix { };
notbot = super.callPackage ../pkgs/notbot.nix { };
@ -23,27 +21,17 @@ in {
inherit (emoji-reactions) patches;
};
python311 = super.python311.override {
python311ForMCOverviewer = super.python311.override {
packageOverrides = self: super: {
pillow_with_headers =
self.callPackage ../pkgs/pillow-with-headers.nix { };
minecraft-overviewer =
self.callPackage ../pkgs/minecraft-overviewer.nix { };
numpy = super.numpy.overrideAttrs
(super: { patches = super.patches ++ [ ../pkgs/numpy-gcc-14.patch ]; });
};
};
python311Packages = self.python311.pkgs;
python312 = super.python312.override {
packageOverrides = self: super: { pysaml2 = self.toPythonModule emptyDir; };
};
matrix-synapse-unwrapped = super.matrix-synapse-unwrapped.overrideAttrs
(old: {
postPatch = (old.postPatch or "") + ''
substituteInPlace tests/storage/databases/main/test_events_worker.py --replace-fail \
$' def test_recovery(' \
$' from tests.unittest import skip_unless\n'\
$' @skip_unless(False, "broken")\n'\
$' def test_recovery('
'';
});
py311MCOPackages = self.python311ForMCOverviewer.pkgs;
minecraft-overviewer =
self.py311MCOPackages.callPackage ../pkgs/minecraft-overviewer.nix { };
}

View file

@ -1,52 +1,45 @@
{ callPackage, fetchFromGitHub, pkgs, buildPythonPackage, python311, pythonOlder
, ... }:
{ fetchFromGitHub, pipreqs, pillow_with_headers, buildPythonApplication, python3
, altgraph, certifi, charset-normalizer, distutils, docopt, idna
, importlib-metadata, nbtlib, numpy, packaging, pefile, requests, setuptools
, urllib3, yarg, zipp, ... }:
let
python3 = python311;
python3Packages = pkgs.python311Packages;
pillow_with_headers =
callPackage ./pillow-with-headers.nix { inherit python3Packages; };
in buildPythonPackage {
buildPythonApplication {
pname = "Minecraft-Overviewer";
version = "2024-03-15";
version = "2024-12-08";
format = "other";
propagatedBuildInputs =
[ (pkgs.pipreqs.override { inherit python3; }) pillow_with_headers ]
++ (with python3Packages; [
altgraph
certifi
charset-normalizer
docopt
idna
importlib-metadata
nbtlib
numpy
packaging
pefile
requests
urllib3
yarg
zipp
]);
build-system = [ setuptools ];
buildInputs = with python3Packages; [ setuptools ];
dependencies = [
pipreqs
pillow_with_headers
altgraph
certifi
charset-normalizer
distutils
docopt
idna
importlib-metadata
nbtlib
numpy
packaging
pefile
requests
urllib3
yarg
zipp
];
buildPhase = ''
export CFLAGS="-I${pillow_with_headers}/include/libImaging"
${python3.interpreter} setup.py build
'';
env.NIX_CFLAGS_COMPILE = "-I${pillow_with_headers}/include/libImaging";
installPhase = ''
${python3.interpreter} setup.py install --prefix=$out --install-lib=$out/${python3.sitePackages}
python setup.py install --prefix=$out --install-lib=$out/${python3.sitePackages}
'';
doCheck = pythonOlder "3.12";
src = fetchFromGitHub {
owner = "GregoryAM-SP";
repo = "The-Minecraft-Overviewer";
rev = "4deb15d2cfbaaff7327a39b1e24d03eb4f7878ec";
sha256 = "sha256-8YCZ7pk0Rj7wAT5DqGZmNsSI5qQWx5By+1G73yUsAQw=";
rev = "bd53129ac47434bc78ca25518a45d927fb1df032";
sha256 = "sha256-6jcReRuWBVmOp3vCwEV9B5B08/O6MDB1hUFqhSu1V0s=";
};
}

21
pkgs/numpy-gcc-14.patch Normal file
View file

@ -0,0 +1,21 @@
diff --git a/numpy/_core/code_generators/generate_numpy_api.py b/numpy/_core/code_generators/generate_numpy_api.py
index af3a275ce9..43a1b83f46 100644
--- a/numpy/_core/code_generators/generate_numpy_api.py
+++ b/numpy/_core/code_generators/generate_numpy_api.py
@@ -65,6 +65,7 @@
{
int st;
PyObject *numpy = PyImport_ImportModule("numpy._core._multiarray_umath");
+ PyObject *c_api;
if (numpy == NULL && PyErr_ExceptionMatches(PyExc_ModuleNotFoundError)) {
PyErr_Clear();
numpy = PyImport_ImportModule("numpy.core._multiarray_umath");
@@ -74,7 +75,7 @@
return -1;
}
- PyObject *c_api = PyObject_GetAttrString(numpy, "_ARRAY_API");
+ c_api = PyObject_GetAttrString(numpy, "_ARRAY_API");
Py_DECREF(numpy);
if (c_api == NULL) {
return -1;

View file

@ -1,6 +1,6 @@
{ python3Packages, ... }:
{ python311Packages, ... }:
python3Packages.pillow.overrideAttrs (_: {
python311Packages.pillow.overrideAttrs (_: {
postInstall = ''
mkdir -p $out/include/libImaging
cp src/libImaging/*.h $out/include/libImaging