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
5 changes: 3 additions & 2 deletions nixos/tests/input-remapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ import ./make-test-python.nix ({ pkgs, ... }:
machine.execute("su - sybil -c input-remapper-gtk >&2 &")

machine.wait_for_text("Input Remapper")
machine.wait_for_text("Preset")
machine.wait_for_text("Change Key")
machine.wait_for_text("Device")
machine.wait_for_text("Presets")
machine.wait_for_text("Editor")
'';
})
10 changes: 5 additions & 5 deletions pkgs/tools/inputmethods/input-remapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@
let
maybeXmodmap = lib.optional withXmodmap xmodmap;
in
(buildPythonApplication {
(buildPythonApplication rec {
pname = "input-remapper";
version = "1.5.0";
version = "2.0.1";

src = fetchFromGitHub {
rev = "e31a1b2bc5d23fe13130afcc242063196335399f";
owner = "sezanzeb";
repo = "input-remapper";
hash = "sha256-KPQLgXSonuOgphagYN2JN+CMIpmjTIPUTCqOPDk0UYU=";
rev = version;
hash = "sha256-rwlVGF/cWSv6Bsvhrs6nMDQ8avYT80aasrhWyQv55/A=";
};

postPatch = ''
# fix FHS paths
substituteInPlace inputremapper/configs/data.py \
--replace "/usr/share/input-remapper" "$out/usr/share/input-remapper"
--replace "/usr/share" "$out/usr/share"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it $out/usr/share instead of $out/share?

Just notice this when resolving merge conflicts for #271387.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, the default path in nixpkgs would be just $out/share

Copy link
Member Author

@LunNova LunNova Dec 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setup.py in the input-remapper repo ends up placing data there. Could change it, means patching more places.

https://github.com/sezanzeb/input-remapper/blob/8f79c25bd966f2ea0fd60c8928df6773911c49f9/setup.py#L115-L130

*these are absolute paths in setup.py, the way nixpkgs buildPythonApplication builds these results in them going under $out rather than the build failing.

'' + lib.optionalString withDebugLogLevel ''
# if debugging
substituteInPlace inputremapper/logger.py --replace "logger.setLevel(logging.INFO)" "logger.setLevel(logging.DEBUG)"
Expand Down