From 1a270ec36ca5ef7c4a91dd2b0a078cd652419198 Mon Sep 17 00:00:00 2001 From: Cryolitia PukNgae Date: Wed, 7 May 2025 02:00:28 +0800 Subject: [PATCH] {libsForQt5,kdePackages}.qcustomplot: init at 2.1.1 --- .../libraries/qcustomplot/default.nix | 68 +++++++++++++++++++ pkgs/top-level/qt5-packages.nix | 2 + pkgs/top-level/qt6-packages.nix | 1 + 3 files changed, 71 insertions(+) create mode 100644 pkgs/development/libraries/qcustomplot/default.nix diff --git a/pkgs/development/libraries/qcustomplot/default.nix b/pkgs/development/libraries/qcustomplot/default.nix new file mode 100644 index 000000000000..6ecaacfe6bfc --- /dev/null +++ b/pkgs/development/libraries/qcustomplot/default.nix @@ -0,0 +1,68 @@ +{ + stdenv, + lib, + fetchFromGitLab, + fetchurl, + fixDarwinDylibNames, + qtbase, + qmake, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "qcustomplot"; + version = "2.1.1"; + + srcs = [ + (fetchFromGitLab { + owner = "ecme2"; + repo = "QCustomPlot"; + tag = "v${finalAttrs.version}"; + hash = "sha256-BW8H/vDbhK3b8t8oB92icEBemzcdRdrIz2aKqlUi6UU="; + }) + (fetchurl { + url = "https://www.qcustomplot.com/release/${finalAttrs.version}/QCustomPlot-source.tar.gz"; + hash = "sha256-Xi0i3sd5248B81fL2yXlT7z5ca2u516ujXrSRESHGC8="; + }) + ]; + + sourceRoot = "."; + + buildInputs = [ qtbase ]; + + nativeBuildInputs = + [ + qmake + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + fixDarwinDylibNames + ]; + + env.LANG = "C.UTF-8"; + + qmakeFlags = [ "sharedlib/sharedlib-compilation/sharedlib-compilation.pro" ]; + + dontWrapQtApps = true; + + postUnpack = '' + cp -rv source/* . + cp -rv qcustomplot-source/* . + ''; + + installPhase = '' + runHook preInstall + + install -vDm 644 "qcustomplot.h" -t "$out/include/" + install -vdm 755 "$out/lib/" + cp -av libqcustomplot*${stdenv.hostPlatform.extensions.sharedLibrary}* "$out/lib/" + + runHook postInstall + ''; + + meta = { + homepage = "https://qtcustomplot.com/"; + description = "Qt C++ widget for plotting and data visualization"; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ Cryolitia ]; + }; +}) diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 1555a92859f7..0ca29f61a4e4 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -247,6 +247,8 @@ makeScopeWithSplicing' { qcsxcad = callPackage ../development/libraries/science/electronics/qcsxcad { }; + qcustomplot = callPackage ../development/libraries/qcustomplot { }; + qjson = callPackage ../development/libraries/qjson { }; qmltermwidget = callPackage ../development/libraries/qmltermwidget { }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index d7f144f0d5df..5efa85cfec65 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -86,6 +86,7 @@ makeScopeWithSplicing' { inherit (qt6) qtbase qt5compat; }; qcoro = callPackage ../development/libraries/qcoro { }; + qcustomplot = callPackage ../development/libraries/qcustomplot { }; qgpgme = callPackage ../development/libraries/gpgme { }; qmlbox2d = callPackage ../development/libraries/qmlbox2d { }; packagekit-qt = callPackage ../tools/package-management/packagekit/qt.nix { };