Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkgs/by-name/pa/packet/nautilus-extension-locale.patch
Original file line number Diff line number Diff line change
@@ -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
21 changes: 18 additions & 3 deletions pkgs/by-name/pa/packet/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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";
Expand Down