key-mapper: Hack the derivation path more cleanly
This commit is contained in:
parent
d8189c1b89
commit
44b9e944c5
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, lib, python3Packages, python3, gtk3, gobject-introspection, git, wrapGAppsHook, gnome }:
|
{ pkgs, lib, python3Packages, python3, gtk3, gobject-introspection, git, wrapGAppsHook, gnome, makeDesktopItem }:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "key-mapper";
|
pname = "key-mapper";
|
||||||
@ -23,12 +23,25 @@ python3Packages.buildPythonApplication rec {
|
|||||||
./hack-data-dir.patch
|
./hack-data-dir.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Fix keymapper not finding its data files
|
||||||
|
preBuild = ''
|
||||||
|
sed -e "s|NIXOS_OUT_PATH|$out/usr/share/key-mapper|" --in-place keymapper/data.py
|
||||||
|
'';
|
||||||
|
|
||||||
# Required as we otherwise don't get the dbus policy installed
|
# Required as we otherwise don't get the dbus policy installed
|
||||||
# correctly
|
# correctly
|
||||||
preInstall = ''
|
preInstall = ''
|
||||||
# see https://github.com/pypa/setuptools/issues/130
|
# see https://github.com/pypa/setuptools/issues/130
|
||||||
${python3}/bin/${python3.executable} setup.py install_data --install-dir=$out --root=$out
|
${python3}/bin/${python3.executable} setup.py install_data --install-dir=$out --root=$out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
desktopItem = makeDesktopItem {
|
||||||
|
name = "key-mapper";
|
||||||
|
exec = "$out/bin/key-mapper-gtk";
|
||||||
|
icon = "$out/usr/share/key-mapper/key-mapper.svg";
|
||||||
|
desktopName = "key-mapper";
|
||||||
|
genericName = "key-mapper";
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/sezanzeb/key-mapper";
|
homepage = "https://github.com/sezanzeb/key-mapper";
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
diff --git a/keymapper/data.py b/keymapper/data.py
|
diff --git a/keymapper/data.py b/keymapper/data.py
|
||||||
index d909399..f7716ac 100644
|
index d909399..7e4aad0 100644
|
||||||
--- a/keymapper/data.py
|
--- a/keymapper/data.py
|
||||||
+++ b/keymapper/data.py
|
+++ b/keymapper/data.py
|
||||||
@@ -68,6 +68,7 @@ def get_data_path(filename=''):
|
@@ -68,6 +68,7 @@ def get_data_path(filename=''):
|
||||||
'/usr/share/key-mapper',
|
'/usr/share/key-mapper',
|
||||||
'/usr/local/share/key-mapper',
|
'/usr/local/share/key-mapper',
|
||||||
os.path.join(site.USER_BASE, 'share/key-mapper'),
|
os.path.join(site.USER_BASE, 'share/key-mapper'),
|
||||||
+ os.environ["KEYMAPPER_DATA"],
|
+ 'NIXOS_OUT_PATH',
|
||||||
]
|
]
|
||||||
|
|
||||||
if data is None:
|
if data is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user