-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xp-pen-artist-pro-14-gen-2-driver: init at 4.0.4-240815
- Loading branch information
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
pkgs/by-name/xp/xp-pen-artist-pro-14-gen-2-driver/package.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
}; | ||
}) |