Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

84 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchzip,
libusb1,
glibc,
libGL,
xorg,
makeWrapper,
qtx11extras,
wrapQtAppsHook,
autoPatchelfHook,
libX11,
libXtst,
libXi,
libXrandr,
libXinerama,
}:
let
dataDir = "var/lib/xppend1v2";
in
stdenv.mkDerivation rec {
pname = "xp-pen-deco-01-v2-driver";
version = "3.4.9-231023";
src = fetchzip {
url = "https://www.xp-pen.com/download/file/id/1936/pid/440/ext/gz.html#.tar.gz";
name = "xp-pen-deco-01-v2-driver-${version}.tar.gz";
sha256 = "sha256-A/dv6DpelH0NHjlGj32tKv37S+9q3F8cYByiYlMuqLg=";
};
nativeBuildInputs = [
wrapQtAppsHook
autoPatchelfHook
makeWrapper
];
dontBuild = true;
dontWrapQtApps = true; # this is done manually
buildInputs = [
libusb1
libX11
libXtst
libXi
libXrandr
libXinerama
glibc
libGL
(lib.getLib stdenv.cc.cc)
qtx11extras
];
installPhase = ''
runHook preInstall
mkdir -p $out/{opt,bin}
cp -r App/usr/lib/pentablet/{PenTablet,resource.rcc,conf} $out/opt
chmod +x $out/opt/PenTablet
cp -r App/lib $out/lib
sed -i 's#usr/lib/pentablet#${dataDir}#g' $out/opt/PenTablet
runHook postInstall
'';
postFixup = ''
makeWrapper $out/opt/PenTablet $out/bin/xp-pen-deco-01-v2-driver \
"''${qtWrapperArgs[@]}" \
--run 'if [ "$EUID" -ne 0 ]; then echo "Please run as root."; exit 1; fi' \
--run 'if [ ! -d /${dataDir} ]; then mkdir -p /${dataDir}; cp -r '$out'/opt/conf /${dataDir}; chmod u+w -R /${dataDir}; fi'
'';
meta = with lib; {
homepage = "https://www.xp-pen.com/product/461.html";
description = "Drivers for the XP-PEN Deco 01 v2 drawing tablet";
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
maintainers = with maintainers; [ virchau13 ];
license = licenses.unfree;
};
}