1{
2 stdenv,
3 lib,
4 fetchFromGitLab,
5 fetchurl,
6 fixDarwinDylibNames,
7 qtbase,
8 qmake,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "qcustomplot";
13 version = "2.1.1";
14
15 srcs = [
16 (fetchFromGitLab {
17 owner = "ecme2";
18 repo = "QCustomPlot";
19 tag = "v${finalAttrs.version}";
20 hash = "sha256-BW8H/vDbhK3b8t8oB92icEBemzcdRdrIz2aKqlUi6UU=";
21 })
22 (fetchurl {
23 url = "https://www.qcustomplot.com/release/${finalAttrs.version}/QCustomPlot-source.tar.gz";
24 hash = "sha256-Xi0i3sd5248B81fL2yXlT7z5ca2u516ujXrSRESHGC8=";
25 })
26 ];
27
28 sourceRoot = ".";
29
30 buildInputs = [ qtbase ];
31
32 nativeBuildInputs = [
33 qmake
34 ]
35 ++ lib.optionals stdenv.hostPlatform.isDarwin [
36 fixDarwinDylibNames
37 ];
38
39 env.LANG = "C.UTF-8";
40
41 qmakeFlags = [ "sharedlib/sharedlib-compilation/sharedlib-compilation.pro" ];
42
43 dontWrapQtApps = true;
44
45 postUnpack = ''
46 cp -rv source/* .
47 cp -rv qcustomplot-source/* .
48 '';
49
50 installPhase = ''
51 runHook preInstall
52
53 install -vDm 644 "qcustomplot.h" -t "$out/include/"
54 install -vdm 755 "$out/lib/"
55 cp -av libqcustomplot*${stdenv.hostPlatform.extensions.sharedLibrary}* "$out/lib/"
56
57 runHook postInstall
58 '';
59
60 meta = {
61 homepage = "https://qtcustomplot.com/";
62 description = "Qt C++ widget for plotting and data visualization";
63 license = lib.licenses.gpl3Plus;
64 platforms = lib.platforms.unix;
65 maintainers = with lib.maintainers; [ Cryolitia ];
66 };
67})