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
qcachegrind: init at 16.12.3 #23812
qcachegrind: init at 16.12.3 #23812
Conversation
@orivej Here is the WIP of my PR. Currently qcachegrind segfaults during qt-plugin-load. |
Ok now i can fully understand the segfaults. I missed the wrapQtProgram. |
d8a47a8
to
5262679
Compare
|
{ stdenv, fetchurl, bash, cmake, qt57, graphviz, qmakeHook, makeQtWrapper, makeWrapper }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "kcachegrind-${version}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the name not be qcachegrind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name is needed for the url and qcachegrind is a subpackage of kcachegrind for non-kde-environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, then I would suggest changing the name here to qcachegrind and change the source URL to http://download.kde.org/stable/applications/${version}/src/kcachegrind-${version}.tar.xz
.
The package name should reflect what you actually get when installing the package and doing nix-env -i kcachegrind
and ending up with qcachegrind may be confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point :) i've always used the attr through nix-env -iA
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
cp -r converters/memprof2calltree $out/bin/memprof2calltree | ||
cp -r converters/op2calltree $out/bin/op2calltree | ||
cp -r converters/pprof2calltree $out/bin/pprof2calltree | ||
chmod -R +x $out/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To include converters, you should list their dependencies in build inputs so that fixup phase fixes their shebangs. (Users may disable them with e.g. qcachegrind.override { php = null; }
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependencies to perl
, php
, python
added.
buildInputs = [ qt57.qtbase graphviz ]; | ||
nativeBuildInputs = [ qmakeHook makeQtWrapper makeWrapper ]; | ||
|
||
postInstall = stdenv.lib.optionalString (stdenv.isDarwin) '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should also be available on Linux, at least cgview
. I'm going to help with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could separate postInstall
to build a .desktop
for linux and an .app
for macos. Let me known what you think.
version = "16.12.2"; | ||
|
||
src = fetchurl { | ||
url = "http://download.kde.org/stable/applications/${version}/src/${name}.tar.xz"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if qcachegrind should be a part of kdeApplications since it uses its sources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if it is possible at all to provide linux+macos outputs through the kdeWrapper
. I think it is best for bost OSes to have the two packages separate, since the CMakelists.txt
for linux depend on find_library(kde4)
which will never work on MacOS. Thus, a simple separate qcachegrind package for non-linux users will be the alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g.:
'' + stdenv.lib.optionalString (stdenv.isLinux) ''
mkdir -p "$out/share/applications"
cat > "$out/share/applications/cgview.desktop" << __EOF__
[Desktop Entry]
Exec=$out/bin/cgview
Name=Cachgrind View
GenericName=Profiling Visualization
Terminal=true
Type=Application
Categories=Qt;Development;Profiling;
__EOF__
wrapQtProgram $out/bin/cgview
cat > "$out/share/applications/qcachegrind.desktop" << __EOF__
[Desktop Entry]
Exec=$out/bin/qcachegrind
Name=QCachgrind
GenericName=Profiling Visualization
Terminal=false
Type=Application
Categories=Qt;Development;Profiling;
__EOF__
wrapQtProgram $out/bin/qcachegrind
''
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "QCachegrind is a Qt GUI to visualize profiling data."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Violates convention.
Thx for review, i'll take care in the next couple of hours. |
d312332
to
ddb11b8
Compare
@orivej ping |
I would suggest to apply these changes: orivej@qcachegrind
|
ddb11b8
to
efb209a
Compare
efb209a
to
79c43e9
Compare
{ stdenv, fetchurl, bash, cmake, | ||
qt, graphviz, | ||
qmakeHook, makeQtWrapper, | ||
perl, python, php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the style guide (“Function formal arguments”), lines with arguments do not end with commas.
bash
and graphviz
are unused.
mkdir -p $out/Applications | ||
cp -rp qcachegrind/qcachegrind.app $out/Applications | ||
wrapQtProgram $out/Applications/qcachegrind.app/Contents/MacOS/qcachegrind | ||
chmod -R +x $out/Applications/qcachegrind.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chmod
is not needed.
You did not include installation of Linux desktop files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installation on linux should be let to kcachegrind?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no cgview in kcachegrind package, and some people who do not use KDE might prefer qcachegrind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, as asked above. What is the preferred way, provide the binary only under $out/bin
or a qcachegrind.desktop
file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I linked to what I would expect on Linux: an executable in $out/bin/qcachegrind
and desktop metadata (for qcachegrind to appear in the launcher) in $out/share/applications
.
d72ceea
to
9a52fe6
Compare
@orivej any other impediments to merge this? |
9a52fe6
to
d61467a
Compare
I approve the merge, but I do not have merge rights. |
I'm doing a build of this now, if everything goes well I'll put it in master. |
Motivation for this change
This is the pure qt-based version of kcachegrind for Non-KDE-users e.g. MacOS. kcachegrind is merged under #23766
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)