screenkey: 0.9 -> 1.2
- Use Python 3. - Switch to gobject-introspection and other more maintained libraries (vs PyGTK). - Use `fetchFromGitLab`. - Replace the non absolute paths fix in `xlib.py` with `substituteInPlace`.gstqt5
parent
800d9e77fe
commit
b5caca265e
|
@ -1,53 +1,66 @@
|
||||||
{ lib
|
{ lib
|
||||||
, substituteAll
|
, fetchFromGitLab
|
||||||
, buildPythonApplication
|
# native
|
||||||
, fetchFromGitHub
|
|
||||||
, distutils_extra
|
|
||||||
, setuptools-git
|
|
||||||
, intltool
|
, intltool
|
||||||
, pygtk
|
|
||||||
, libX11
|
|
||||||
, libXtst
|
|
||||||
, wrapGAppsHook
|
, wrapGAppsHook
|
||||||
, gnome3
|
, file
|
||||||
|
# not native
|
||||||
|
, xorg
|
||||||
|
, gobject-introspection
|
||||||
|
, gtk3
|
||||||
|
, python3
|
||||||
}:
|
}:
|
||||||
buildPythonApplication rec {
|
|
||||||
pname = "screenkey";
|
|
||||||
version = "0.9";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
python3.pkgs.buildPythonApplication rec {
|
||||||
owner = "wavexx";
|
pname = "screenkey";
|
||||||
|
version = "1.2";
|
||||||
|
|
||||||
|
src = fetchFromGitLab {
|
||||||
|
owner = "screenkey";
|
||||||
repo = "screenkey";
|
repo = "screenkey";
|
||||||
rev = "screenkey-${version}";
|
rev = "v${version}";
|
||||||
sha256 = "14g7fiv9n7m03djwz1pp5034pffi87ssvss9bc1q8vq0ksn23vrw";
|
sha256 = "1x13n57iy2pg3h3r994q3g5nbmh2gwk3qidmmcv0g7qa89n2gwbj";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
|
||||||
(substituteAll {
|
|
||||||
src = ./paths.patch;
|
|
||||||
inherit libX11 libXtst;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
distutils_extra
|
python3.pkgs.distutils_extra
|
||||||
setuptools-git
|
# Shouldn't be needed once https://gitlab.com/screenkey/screenkey/-/issues/122 is fixed.
|
||||||
intltool
|
intltool
|
||||||
|
# We are not sure why is this needed, but without it we get "file: command
|
||||||
|
# not found" errors during build.
|
||||||
|
file
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
|
# for setup hook
|
||||||
|
gobject-introspection
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
gnome3.adwaita-icon-theme
|
gtk3
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
pygtk
|
pycairo
|
||||||
|
pygobject3
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Prevent double wrapping because of wrapGAppsHook
|
||||||
|
dontWrapGApps = true;
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/56943
|
||||||
|
strictDeps = false;
|
||||||
|
preFixup = ''
|
||||||
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
||||||
|
'';
|
||||||
|
|
||||||
# screenkey does not have any tests
|
# screenkey does not have any tests
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
# Fix CDLL python calls for non absolute paths of xorg libraries
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace Screenkey/xlib.py \
|
||||||
|
--replace libX11.so.6 ${lib.getLib xorg.libX11}/lib/libX11.so.6 \
|
||||||
|
--replace libXtst.so.6 ${lib.getLib xorg.libXtst}/lib/libXtst.so.6
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://www.thregr.org/~wavexx/software/screenkey/";
|
homepage = "https://www.thregr.org/~wavexx/software/screenkey/";
|
||||||
description = "A screencast tool to display your keys inspired by Screenflick";
|
description = "A screencast tool to display your keys inspired by Screenflick";
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
--- 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
|
|
|
@ -6680,7 +6680,7 @@ in
|
||||||
quazip = quazip_qt4;
|
quazip = quazip_qt4;
|
||||||
};
|
};
|
||||||
|
|
||||||
screenkey = python2Packages.callPackage ../applications/video/screenkey { };
|
screenkey = callPackage ../applications/video/screenkey { };
|
||||||
|
|
||||||
quazip_qt4 = libsForQt5.quazip.override {
|
quazip_qt4 = libsForQt5.quazip.override {
|
||||||
qtbase = qt4;
|
qtbase = qt4;
|
||||||
|
|
Loading…
Reference in New Issue