Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segger-systemview: init at 352a #214195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions pkgs/by-name/se/segger-systemview/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{ lib
, stdenv
, fetchurl
, autoPatchelfHook
, segger-jlink
, config
, fontconfig
, xorg
, makeDesktopItem
, copyDesktopItems
}:

let
supported = {
x86_64-linux = {
name = "x86_64";
sha256 = "d3ec8d54ae0605a40d12d6eeea80967362ed3ed921395f154efee8d65d0c25ee";
};
i686-linux = {
name = "i386";
sha256 = "2292a6ed6c9b277e514ddbafb396e0e5a8ef8ca57ebd3236cf5ae29a52d2b5bc";
};
};

platform = supported.${stdenv.targetPlatform.system} or (throw "unsupported platform ${stdenv.targetPlatform.system}");

version = "352a";

url = "https://www.segger.com/downloads/systemview/SystemView_Linux_V${version}_${platform.name}.tgz";

src = fetchurl {
inherit url;
inherit (platform) sha256;
};

qt4-bundled = stdenv.mkDerivation {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't accept more qt4 package and have been trying to remove or update them.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package has a hard dependency on QT4. Without QT4, it does not run. Please review the discussion on QT4 at #255185 , SEGGER is unwilling to upgrade the QT version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see #255185 and #319342 for context.

We know that the segger software reintroduce qt4 dependencies, but the dependency is not exposed to toplevel, and the package is properly marked as insecure. The user knows what they are doing if they install this package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to introduce a proprietary software with outdated dependencies... why? It's not like it was ever there and we need to remove it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand your concerns, but as @h7x4 pointed out, this package required the user to explicitly understand and allow (1) the license and (2) the outdated libs. Other packages and systems are unaffected by this package, i.e. if you do not use it you are unaffected.

SystemView is a widely used industry-standard embedded debugging suite, see https://www.segger.com/products/development-tools/systemview/ . It would be nice for NixOS to evolve from a project for ambitions hobbyists into a system which supports real-world software.

If I could, I would just provide this package out-of tree, similar to how e.g. Arch (https://aur.archlinux.org/packages/jlink-systemview) does it, but this does not work for nixpkgs. I do not have the bandwidth to maintain an eternal fork for a simple package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to, but the bundled QT libs may change in between releases. AFAIK only the libraries which are directly needed by the related package are included, which might not be enough for the other packages.

I have not verified this, but I am hesitant to de-duplicate these "independent" libs.

This comment was marked as duplicate.

pname = "segger-systemview-qt4";
inherit src version;

nativeBuildInputs = [
autoPatchelfHook
];

buildInputs = [
stdenv.cc.cc.lib
fontconfig
xorg.libXrandr
xorg.libXfixes
xorg.libXcursor
xorg.libSM
xorg.libICE
xorg.libX11
];

dontConfigure = true;
dontBuild = true;

installPhase = ''
runHook preInstall

# Install libraries
mkdir -p $out/lib
mv libQt* $out/lib

runHook postInstall
'';

meta = with lib; {
description = "Bundled QT4 libraries for the SystemView real-time software analysis tool";
homepage = "https://www.segger.com/products/development-tools/systemview/";
license = licenses.lgpl21;
maintainers = with maintainers; [ stargate01 ];
knownVulnerabilities = [
"This bundled version of Qt 4 has reached its end of life after 2015. See https://github.com/NixOS/nixpkgs/pull/174634"
"CVE-2023-43114"
"CVE-2023-38197"
"CVE-2023-37369"
"CVE-2023-34410"
"CVE-2023-32763"
"CVE-2023-32762"
"CVE-2023-32573"
"CVE-2022-25634"
"CVE-2020-17507"
"CVE-2020-0570"
"CVE-2018-21035"
"CVE-2018-19873"
"CVE-2018-19871"
"CVE-2018-19870"
"CVE-2018-19869"
"CVE-2015-1290"
"CVE-2014-0190"
"CVE-2013-0254"
"CVE-2012-6093"
"CVE-2012-5624"
"CVE-2009-2700"
];
};
};

in stdenv.mkDerivation {
pname = "segger-systemview";
inherit src version;

runtimeDependencies = [
segger-jlink
];

nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
];

buildInputs = [
segger-jlink
qt4-bundled
];

dontConfigure = true;
dontBuild = true;

desktopItems = [
(makeDesktopItem {
name = "SystemView";
exec = "SystemView";
icon = "applications-utilities";
desktopName = "SystemView";
genericName = "SEGGER SystemView";
categories = [ "Development" ];
type = "Application";
terminal = false;
startupNotify = false;
})
];

installPhase = ''
runHook preInstall

# Install binaries
mkdir -p $out/bin
install -Dm555 SystemView -t $out/bin
mv Description $out/bin

# This library is opened via dlopen at runtime
for libr in ${segger-jlink}/lib/*; do
ln -s $libr $out/bin
done

# Install docs and examples
mkdir -p $out/share/docs
mv Doc/* $out/share/docs
mkdir -p $out/share/examples
mv Sample/* $out/share/examples

runHook postInstall
'';

meta = with lib; {
description = "Real-time software analysis tool from SEGGER";
homepage = "https://www.segger.com/products/development-tools/systemview/";
license = licenses.unfree;
platforms = attrNames supported;
maintainers = with maintainers; [ stargate01 ];
};
}
Loading