@@ -0,0 +1,31 @@
1+{ mkDerivation, lib, fetchFromGitHub, makeWrapper, cmake, qtbase, qttools, fftw, libusb1, libglvnd }:
2+
3+mkDerivation rec {
4+ pname = "openhantek6022";
5+ version = "3.1.1";
6+
7+ src = fetchFromGitHub {
8+ owner = "OpenHantek";
9+ repo = "OpenHantek6022";
10+ rev = version;
11+ sha256 = "17b0qmz7g0nk7n7jhbh5xhs135dpj9kv41n42vvpdzwr6z5rk4qm";
12+ };
13+
14+ nativeBuildInputs = [ cmake makeWrapper ];
15+ buildInputs = [ fftw libusb1 libglvnd qtbase qttools ];
16+
17+ postPatch = ''
18+ # Fix up install paths & checks
19+ sed -i 's#if(EXISTS ".*")#if(1)#g' CMakeLists.txt
20+ sed -i 's#/lib/udev#lib/udev#g' CMakeLists.txt
21+ sed -i 's#/usr/share#share#g' CMakeLists.txt
22+ '';
23+
24+ meta = with lib; {
25+ description = "Free software for Hantek and compatible (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes";
26+ homepage = "https://github.com/OpenHantek/OpenHantek6022";
27+ license = licenses.gpl3;
28+ maintainers = with maintainers; [ baracoder ];
29+ platforms = qtbase.meta.platforms;
30+ };
31+}