packet: 0.4.0 → 0.5.1 (#416076)

This commit is contained in:
Aleksana
2025-06-14 10:36:19 +08:00
committed by GitHub
2 changed files with 44 additions and 3 deletions

View File

@@ -0,0 +1,26 @@
diff --git a/data/resources/plugins/meson.build b/data/resources/plugins/meson.build
index ac60edd..9e055b8 100644
--- a/data/resources/plugins/meson.build
+++ b/data/resources/plugins/meson.build
@@ -1,6 +1,7 @@
plugins_conf = configuration_data()
plugins_conf.set('APP_ID', application_id)
plugins_conf.set('LOCALE_DOMAIN', gettext_package)
+plugins_conf.set('LOCALE_DIR', localedir)
configure_file(
input: 'packet_nautilus.py.in',
diff --git a/data/resources/plugins/packet_nautilus.py.in b/data/resources/plugins/packet_nautilus.py.in
index 9c5e71e..7288ee9 100755
--- a/data/resources/plugins/packet_nautilus.py.in
+++ b/data/resources/plugins/packet_nautilus.py.in
@@ -23,7 +23,8 @@ def log(*vals: Any):
# TODO: Maybe have a separate gettext package for plugin scripts that gets
# copied over alongside the script. Seems more robust?
def init_i18n() -> gettext.NullTranslations | gettext.GNUTranslations:
- locale_dirs: List[Path | None] = [None] # None for system default locale dir
+ # `None` is for system default locale dir
+ locale_dirs: List[Path | None] = [None, Path("@LOCALE_DIR@")]
(lang, enc) = locale.getlocale()
flatpak_info = None

View File

@@ -20,21 +20,27 @@
blueprint-compiler,
desktop-file-utils,
appstream,
python3Packages,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "packet";
version = "0.4.0";
version = "0.5.1";
src = fetchFromGitHub {
owner = "nozwock";
repo = "packet";
tag = finalAttrs.version;
hash = "sha256-MnDXwgzSnz8bLEAZE4PORKKIP8Ao5ZiImRqRzlQzYU8=";
hash = "sha256-MZdZf4fLtUd30LncPLVkcNdjuzw+Wi33A1MJqQbEurk=";
};
patches = [
# let nautilus find the locale directory
./nautilus-extension-locale.patch
];
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-LlqJoxAWHAQ47VlYB/sOtk/UkNa+E5CQS/3FQnAYFsI=";
hash = "sha256-ODrM8oGQpi+DpG4YQYibtVHbicuHOjZAlZ1wW2Gulec=";
};
nativeBuildInputs = [
@@ -59,8 +65,17 @@ stdenv.mkDerivation (finalAttrs: {
gdk-pixbuf
libadwaita
pango
python3Packages.wrapPython
];
postFixup = ''
buildPythonPath ${python3Packages.dbus-python}
patchPythonScript $out/share/packet/plugins/packet_nautilus.py
# install the nautilus extension in the expected location
mkdir -p $out/share/nautilus-python
ln -s $out/share/packet/plugins $out/share/nautilus-python/extensions
'';
meta = {
description = "Quick Share client for Linux";
homepage = "https://github.com/nozwock/packet";