maubot: switch to ensureNewerSourcesForZipFilesHook

This commit is contained in:
chayleaf 2023-11-20 05:02:23 +07:00
parent 00070cf866
commit 352d3a3ad9
No known key found for this signature in database
GPG Key ID: 78171AD46227E68E
3 changed files with 5 additions and 16 deletions

View File

@ -1,13 +0,0 @@
diff --git a/maubot/cli/commands/build.py b/maubot/cli/commands/build.py
index ec3ac26..4de85f2 100644
--- a/maubot/cli/commands/build.py
+++ b/maubot/cli/commands/build.py
@@ -84,7 +84,7 @@ def read_output_path(output: str, meta: PluginMeta) -> str | None:
def write_plugin(meta: PluginMeta, output: str | IO) -> None:
- with zipfile.ZipFile(output, "w") as zip:
+ with zipfile.ZipFile(output, "w", strict_timestamps=False) as zip:
meta_dump = BytesIO()
yaml.dump(meta.serialize(), meta_dump)
zip.writestr("maubot.yaml", meta_dump.getvalue())

View File

@ -56,8 +56,6 @@ let
url = "https://github.com/maubot/maubot/commit/283f0a3ed5dfae13062b6f0fd153fbdc477f4381.patch";
sha256 = "0yn5357z346qzy5v5g124mgiah1xsi9yyfq42zg028c8paiw8s8x";
})
# allow running "mbc build" in a nix derivation
./allow-building-plugins-from-nix-store.patch
];
propagatedBuildInputs = with python.pkgs; [

View File

@ -5,6 +5,7 @@
, fetchFromGitea
, stdenvNoCC
, callPackage
, ensureNewerSourcesForZipFilesHook
, maubot
, python3
, poetry
@ -18,7 +19,10 @@ let
buildMaubotPlugin = attrs@{ version, pname, base_config ? null, ... }:
stdenvNoCC.mkDerivation (builtins.removeAttrs attrs [ "base_config" ] // {
pluginName = "${pname}-v${version}.mbp";
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ maubot ];
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [
ensureNewerSourcesForZipFilesHook
maubot
];
buildPhase = ''
runHook preBuild