diff --git a/pkgs/applications/misc/xppen/default.nix b/pkgs/applications/misc/xppen/default.nix new file mode 100644 index 0000000000000..5d5157574e23e --- /dev/null +++ b/pkgs/applications/misc/xppen/default.nix @@ -0,0 +1,18 @@ +{ + callPackage, +}: + +{ + xppen_3 = callPackage ./generic.nix { + pname = "xppen_3"; + version = "3.4.9-240131"; + url = "https://www.xp-pen.com/download/file.html?id=2829&pid=1016&ext=gz"; + hash = "sha256-udUjkOW6nGo8zvMhVl6Iepa6OzCVz/M9m+DMqNKrfFg="; + }; + xppen_4 = callPackage ./generic.nix { + pname = "xppen_4"; + version = "4.0.4-240815"; + url = "https://www.xp-pen.com/download/file.html?id=3325&pid=1016&ext=gz"; + hash = "sha256-NVO9VaUmcQDI4rL76BBQDmII8vpmmo9qgcGetv6CIFE="; + }; +} diff --git a/pkgs/by-name/xp/xppen_3/package.nix b/pkgs/applications/misc/xppen/generic.nix similarity index 82% rename from pkgs/by-name/xp/xppen_3/package.nix rename to pkgs/applications/misc/xppen/generic.nix index 4132eda63da0a..0d7952841b7ff 100644 --- a/pkgs/by-name/xp/xppen_3/package.nix +++ b/pkgs/applications/misc/xppen/generic.nix @@ -5,17 +5,18 @@ autoPatchelfHook, qt5, libusb1, + pname, + version, + url, + hash, }: stdenv.mkDerivation { - pname = "xppen_3"; - version = "3.4.9-240131"; + inherit pname version; - # to update: try to find the latest 3.x.x .tar.gz on https://www.xp-pen.com/download src = fetchzip { extension = "tar.gz"; - url = "https://www.xp-pen.com/download/file.html?id=2829&pid=1016&ext=gz"; - hash = "sha256-udUjkOW6nGo8zvMhVl6Iepa6OzCVz/M9m+DMqNKrfFg="; + inherit url hash; }; nativeBuildInputs = [ diff --git a/pkgs/by-name/xp/xppen_4/package.nix b/pkgs/by-name/xp/xppen_4/package.nix deleted file mode 100644 index 0ac2e10aa97c7..0000000000000 --- a/pkgs/by-name/xp/xppen_4/package.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ - lib, - stdenv, - fetchzip, - autoPatchelfHook, - qt5, - libusb1, -}: - -stdenv.mkDerivation { - pname = "xppen_4"; - version = "4.0.4-240815"; - - # to update: try to find the latest 4.x.x .tar.gz on https://www.xp-pen.com/download - src = fetchzip { - extension = "tar.gz"; - url = "https://www.xp-pen.com/download/file.html?id=3325&pid=1016&ext=gz"; - hash = "sha256-NVO9VaUmcQDI4rL76BBQDmII8vpmmo9qgcGetv6CIFE="; - }; - - 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 - - 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 ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b7d3dfb911546..2be7856f2d6f7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33708,6 +33708,9 @@ with pkgs; xpano = callPackage ../applications/graphics/xpano { }; + inherit (callPackage ../applications/misc/xppen { }) + xppen_3 xppen_4; + xv = callPackage ../applications/graphics/xv { }; xygrib = libsForQt5.callPackage ../applications/misc/xygrib { };