1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 nix-update-script,
6 testers,
7 qmake,
8 qtmultimedia,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "qzxing";
13 version = "3.3.0";
14
15 src = fetchFromGitHub {
16 owner = "ftylitak";
17 repo = "qzxing";
18 rev = "v${finalAttrs.version}";
19 hash = "sha256-ASgsF5ocNWAiIy2jm6ygpDkggBcEpno6iVNWYkuWcVI=";
20 };
21
22 # QMake can't find qtmultimedia in buildInputs
23 strictDeps = false;
24
25 nativeBuildInputs = [
26 qmake
27 ];
28
29 buildInputs = [
30 qtmultimedia
31 ];
32
33 dontWrapQtApps = true;
34
35 preConfigure = ''
36 cd src
37 '';
38
39 qmakeFlags = [
40 "CONFIG+=qzxing_qml"
41 "CONFIG+=qzxing_multimedia"
42 "QMAKE_PKGCONFIG_PREFIX=${placeholder "out"}"
43 ];
44
45 passthru = {
46 tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
47 updateScript = nix-update-script { };
48 };
49
50 meta = with lib; {
51 description = "Qt/QML wrapper library for the ZXing library";
52 homepage = "https://github.com/ftylitak/qzxing";
53 license = licenses.asl20;
54 maintainers = with maintainers; [ OPNA2608 ];
55 platforms = platforms.unix;
56 pkgConfigModules = [
57 "QZXing"
58 ];
59 };
60})