summary refs log tree commit diff
path: root/pkgs/os-specific/linux/xp-pen-drivers
diff options
context:
space:
mode:
authorVir Chaudhury <virchau13@hexular.net>2022-07-20 22:35:35 +0800
committerVir Chaudhury <virchau13@hexular.net>2022-08-08 15:20:38 +0800
commit7761d8aa56009f01a4ff06782c9ce4ceb3727bec (patch)
tree86c8b35011689152961a7931e1964f93e57da1f4 /pkgs/os-specific/linux/xp-pen-drivers
parent2a6b51e3618a80ea17eec65a9753bb4d50e2d708 (diff)
downloadnixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.tar
nixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.tar.gz
nixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.tar.bz2
nixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.tar.lz
nixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.tar.xz
nixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.tar.zst
nixpkgs-7761d8aa56009f01a4ff06782c9ce4ceb3727bec.zip
xp-pen-deco-01-v2-driver: init at 3.2.3.220323-1
Diffstat (limited to 'pkgs/os-specific/linux/xp-pen-drivers')
-rw-r--r--pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix b/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix
new file mode 100644
index 00000000000..32804afa9ff
--- /dev/null
+++ b/pkgs/os-specific/linux/xp-pen-drivers/deco-01-v2/default.nix
@@ -0,0 +1,81 @@
+{ lib
+, stdenv
+, fetchzip
+, libusb1
+, glibc
+, libGL
+, xorg
+, 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.2.3.220323-1";
+
+  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-n/yutkRsjcIRRhB4q1yqEmaa03/1SO8RigJi/ZkfLbk=";
+  };
+
+  nativeBuildInputs = [
+    wrapQtAppsHook
+    autoPatchelfHook
+  ];
+
+  dontBuild = true;
+
+  dontWrapQtApps = true; # this is done manually
+
+  buildInputs = [
+    libusb1
+    libX11
+    libXtst
+    libXi
+    libXrandr
+    libXinerama
+    glibc
+    libGL
+    stdenv.cc.cc.lib
+    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;
+  };
+}
+