xppen_{3,4}: init at 3.4.9-240607 and 4.0.7-250117

Co-authored-by: yakrobat <yakrobat@protonmail.com>
This commit is contained in:
Gutyina Gergő
2025-08-08 09:30:37 +02:00
parent 44da664db5
commit 70469150c9
3 changed files with 95 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
{
callPackage,
}:
# to update: try to find the latest 3.x.x or 4.x.x .tar.gz on https://www.xp-pen.com/download
{
xppen_3 = callPackage ./generic.nix {
pname = "xppen_3";
version = "3.4.9-240607";
url = "https://www.xp-pen.com/download/file.html?id=2901&pid=819&ext=gz";
hash = "sha256-ZXeTlDjhryXamb7x2LxDdOtf8R9rgKPyUsdx96XchWM=";
};
xppen_4 = callPackage ./generic.nix {
pname = "xppen_4";
version = "4.0.7-250117";
url = "https://www.xp-pen.com/download/file.html?id=3652&pid=1211&ext=gz";
hash = "sha256-sH05Qquo2u0npSlv8Par/mn1w/ESO9g42CCGwBauHhU=";
};
}
+71
View File
@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchzip,
autoPatchelfHook,
qt5,
libusb1,
pname,
version,
url,
hash,
}:
stdenv.mkDerivation {
inherit pname version;
src = fetchzip {
name = "XPPenLinux${version}.tar.gz";
extension = "tar.gz";
inherit url hash;
};
nativeBuildInputs = [
autoPatchelfHook
qt5.wrapQtAppsHook
];
buildInputs = [
qt5.qtbase
libusb1
];
dontConfigure = true;
dontBuild = true;
dontCheck = true;
installPhase = ''
runHook preInstall
rm -r App/usr/lib/pentablet/{lib,platforms,PenTablet.sh}
mkdir -p $out/{bin,usr}
cp -r App/lib $out/lib
cp -r App/usr/share $out/share
cp -r App/usr/lib $out/usr/lib
# hack: edit the binary directly
# TODO: replace it with buildFHSEnv if possible? last time it caused other issues
sed -i 's#/usr/lib/pentablet#/var/lib/pentablet#g' $out/usr/lib/pentablet/PenTablet
ln -s $out/usr/lib/pentablet/PenTablet $out/bin/PenTablet
substituteInPlace $out/share/applications/xppentablet.desktop \
--replace-fail "/usr/lib/pentablet/PenTablet.sh" "PenTablet" \
--replace-fail "/usr/share/icons/hicolor/256x256/apps/xppentablet.png" "xppentablet"
runHook postInstall
'';
meta = {
description = "XPPen driver";
downloadPage = "https://www.xp-pen.com/download/";
homepage = "https://www.xp-pen.com/";
license = lib.licenses.unfree;
mainProgram = "PenTablet";
maintainers = with lib.maintainers; [
gepbird
nasrally
];
platforms = [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
}
+5
View File
@@ -14077,6 +14077,11 @@ with pkgs;
libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix { };
inherit (callPackage ../applications/misc/xppen { })
xppen_3
xppen_4
;
xygrib = libsForQt5.callPackage ../applications/misc/xygrib { };
ydiff = with python3.pkgs; toPythonApplication ydiff;