Skip to content

Commit

Permalink
xp-pen-artist-pro-14-gen-2-driver: init at 4.0.4-240815
Browse files Browse the repository at this point in the history
  • Loading branch information
gepbird committed Oct 12, 2024
1 parent 73f76c9 commit d6c3f80
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions pkgs/by-name/xp/xp-pen-artist-pro-14-gen-2-driver/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
makeWrapper,
libusb1,
qt5,
}:

let
dataDir = "var/lib/xppenap14";
in
stdenv.mkDerivation (finalAttrs: {
pname = "xp-pen-artist-pro-14-gen-2-driver";
version = "4.0.4-240815";

src = fetchurl {
url = "https://download01.xp-pen.com/file/2024/08/XPPenLinux${finalAttrs.version}.tar.gz";
hash = "sha256-Fd3Q3Z6UTmxU0DPfeyvf2hiNbiesIcl305NHmsjh1pk=";
};

buildInputs = [
libusb1
qt5.qtbase
];

nativeBuildInputs = [
autoPatchelfHook
qt5.wrapQtAppsHook
makeWrapper
];

dontConfigure = true;
dontBuild = true;
dontWrapQtApps = true;

installPhase = ''
runHook preInstall
mkdir -p $out/{opt,bin}
cp -r App/usr/lib/pentablet/{PenTablet,conf,doc,UI} $out/opt
cp -r App/lib $out/lib
sed -i 's#usr/lib/pentablet#${dataDir}#g' $out/opt/PenTablet
makeWrapper $out/opt/PenTablet $out/bin/PenTablet \
"''${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'
runHook postInstall
'';

meta = {
homepage = "https://www.xp-pen.com/product/artist-pro-14-gen-2.html";
description = "Driver for XP-PEN Artist Pro 14 (Gen 2) drawing tablet";
platforms = [ "x86_64-linux" ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ gepbird ];
license = lib.licenses.unfree;
mainProgram = "PenTablet";
};
})

0 comments on commit d6c3f80

Please sign in to comment.