Unverified Commit bb40b711 authored by K900's avatar K900 Committed by GitHub
Browse files

qtcreator: added function to compose package with plugins (#438322)

parents 1b48c6e9 958ff5d3
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  stdenv,
  lib,
  fetchFromGitHub,
  runCommand,
  cmake,
  pkg-config,
  qttools,
@@ -50,6 +51,15 @@ stdenv.mkDerivation (finalAttrs: {

  installPhase = "mkdir -p $out; cp -R lib $out/";

  passthru.tests = {
    test-version = runCommand "${finalAttrs.pname}-test" { } ''
      QT_QPA_PLATFORM="offscreen" ${
        lib.getExe (qtcreator.withPackages [ finalAttrs.finalPackage ])
      } --version > $out
      cat $out | grep 'qodeassist ${finalAttrs.version}'
    '';
  };

  meta = {
    description = "AI-powered coding assistant plugin for Qt Creator";
    longDescription = ''
@@ -62,6 +72,6 @@ stdenv.mkDerivation (finalAttrs: {
    homepage = "https://github.com/Palm1r/QodeAssist";
    license = lib.licenses.gpl3Only;
    maintainers = [ lib.maintainers.zatm8 ];
    platforms = lib.platforms.linux;
    platforms = qtcreator.meta.platforms;
  };
})
+5 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
  rustc-demangle,
  elfutils,
  perf,
  callPackage,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -104,6 +105,10 @@ stdenv.mkDerivation (finalAttrs: {
    substituteInPlace ''${!outputDev}/lib/cmake/QtCreator/QtCreatorConfig.cmake --replace "$out/" ""
  '';

  passthru = {
    withPackages = callPackage ./with-plugins.nix { };
  };

  meta = {
    description = "Cross-platform IDE tailored to the needs of Qt developers";
    longDescription = ''
+23 −0
Original line number Diff line number Diff line
{
  pkgs,
  lib,
  qtcreator,
  ...
}:
f:
let
  plugins_arg = builtins.foldl' (
    acc: val: acc + "-pluginpath ${val.outPath}/lib/qtcreator/plugins/"
  ) "" f;
  qtcreator_runner = pkgs.writeShellScriptBin "qtcreator" ''
    exec ${lib.getExe qtcreator} ${plugins_arg} "$@"
  '';
in
pkgs.symlinkJoin {
  inherit (qtcreator) version meta;
  name = "qtcreator-with-plugins";
  paths = [
    qtcreator_runner
    qtcreator
  ];
}