Skip to content

Commit

Permalink
Merge pull request #34167 from rasendubi/screenkey
Browse files Browse the repository at this point in the history
screenkey: init at 0.9
  • Loading branch information
Mic92 authored Feb 27, 2018
2 parents e41ca3b + 40389db commit 1beee1c
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 32 deletions.
60 changes: 60 additions & 0 deletions pkgs/applications/video/screenkey/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ lib
, substituteAll
, buildPythonApplication
, fetchFromGitHub
, distutils_extra
, setuptools-git
, intltool
, pygtk
, libX11
, libXtst
, wrapGAppsHook
, defaultIconTheme
, hicolor_icon_theme
}:
buildPythonApplication rec {
pname = "screenkey";
version = "0.9";

src = fetchFromGitHub {
owner = "wavexx";
repo = "screenkey";
rev = "screenkey-${version}";
sha256 = "14g7fiv9n7m03djwz1pp5034pffi87ssvss9bc1q8vq0ksn23vrw";
};

patches = [
(substituteAll {
src = ./paths.patch;
inherit libX11 libXtst;
})
];

nativeBuildInputs = [
distutils_extra
setuptools-git
intltool

wrapGAppsHook
];

buildInputs = [
defaultIconTheme
hicolor_icon_theme
];

propagatedBuildInputs = [
pygtk
];

# screenkey does not have any tests
doCheck = false;

meta = with lib; {
homepage = https://www.thregr.org/~wavexx/software/screenkey/;
description = "A screencast tool to display your keys inspired by Screenflick";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = [ maintainers.rasendubi ];
};
}
20 changes: 20 additions & 0 deletions pkgs/applications/video/screenkey/paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/Screenkey/xlib.py
+++ b/Screenkey/xlib.py
@@ -6,7 +6,7 @@
from ctypes import *

## base X11
-libX11 = CDLL('libX11.so.6')
+libX11 = CDLL('@libX11@/lib/libX11.so.6')

# types
Atom = c_ulong
@@ -278,7 +278,7 @@


## record extensions
-libXtst = CDLL('libXtst.so.6')
+libXtst = CDLL('@libXtst@/lib/libXtst.so.6')

# types
XPointer = String
4 changes: 4 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4620,6 +4620,10 @@ with pkgs;
quazip = quazip_qt4;
};

screenkey = python2Packages.callPackage ../applications/video/screenkey {
inherit (gnome3) defaultIconTheme;
};

quazip_qt4 = libsForQt5.quazip.override {
qtbase = qt4; qmake = qmake4Hook;
};
Expand Down
32 changes: 0 additions & 32 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18400,38 +18400,6 @@ EOF
};
};

screenkey = buildPythonPackage rec {
version = "0.2-b3634a2c6eb6d6936c3b2c1ef5078bf3a84c40c6";
name = "screenkey-${version}";

propagatedBuildInputs = with self; [ pygtk distutils_extra xlib pkgs.xorg.xmodmap ];

preConfigure = ''
substituteInPlace setup.py --replace "/usr/share" "./share"

# disable the feature that binds a shortcut to turning on/off
# screenkey. This is because keybinder is not packages in Nix as
# of today.
substituteInPlace Screenkey/screenkey.py \
--replace "import keybinder" "" \
--replace " keybinder.bind(self.options['hotkey'], self.hotkey_cb, show_item)" ""
'';

src = pkgs.fetchgit {
url = https://github.com/scs3jb/screenkey.git;
rev = "b3634a2c6eb6d6936c3b2c1ef5078bf3a84c40c6";
sha256 = "1535mpm5x6v85d4ghxhdiianhjrsz280dwvs61ss0yyjx4kivx3s";
};

meta = {
homepage = https://github.com/scs3jb/screenkey;
description = "A screencast tool to show your keys";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
};

tarman = buildPythonPackage rec {
version = "0.1.3";
name = "tarman-${version}";
Expand Down

0 comments on commit 1beee1c

Please sign in to comment.