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
sourcetrail: init at 2018.3.55 #47594
Conversation
$out/share/applications/sourcetrail.desktop \ | ||
--replace /usr/bin/ $out/bin/ | ||
|
||
# FIXME: not working |
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 can't seem to change the permission of default configuration files that are copied to the user's home directory upon first launch. Does anyone have a clue why this is happening?
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.
Everything in the nix store is always read only.
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.
@symphorien Do you mean even during installPhase
?
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.
When the build is over, $out
will be made read only.
|
||
dontBuild = true; | ||
|
||
nativeBuildInputs = [ makeWrapper ]; |
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 have a simplified version using autoPatchelfHook
:
https://github.com/Mic92/nur-packages/blob/master/pkgs/sourcetrail/default.nix
This will be easier to maintain then manual patchelf/LD_LIBRARY_PATH.
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.
Have you considered moving this to nixpkgs?
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.
No, I don't use it and do not have a license.
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 will remove it from NUR once it lands in nixpkgs.
0268783
to
8d335f4
Compare
72618c3
to
29d0653
Compare
I made some changes based on @Mic92's version. I still couldn't figure out how to change permissions for the initial configuration files, so I made a wrapper command that manually copies those files on first launch. |
|
||
cat <<EOF > $out/bin/sourcetrail | ||
#! ${stdenv.shell} -e | ||
mkdir -p ~/.config/sourcetrail |
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 should be skipped if $HOME is not set. Sourcetrail does not use the fallback configuration from its package itself?
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.
It does, but it gets copied into the home directory without write permissions. I've tried setting write permissions for the original copy during installPhase
, but then I got a "Permission denied" error.
mv -v plugin $out/share/sourcetrail | ||
|
||
cp -rv . $out/opt | ||
rm $out/opt/lib/libssl.so |
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.
Does a symlink works here? Then LD_LIBRARY_PATH becomes unnecessary.
$out/share/applications/sourcetrail.desktop \ | ||
--replace /usr/bin/ $out/bin/ | ||
|
||
cat <<EOF > $out/bin/sourcetrail |
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 variables here are expanded at build time: The wrapper currently contains /homeless-shelter
instead of $HOME
.
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.
Thanks, that explains the problems I was having with the wrapper script.
c379577
to
444ce2d
Compare
With the wrapper script taking care of the permission problem, things seem to work okay now. It should be ready for merge. |
It does not yet work for java. I think this could become another pull request: https://dl.thalheim.io/WOpRngYvf_rmV1TEZL8Ehw/Screenshot_20181030_120612.png maybe @egraether can give us a hint how sourcetrail tries to figure out where java is. |
Ok there is a setting to specify this manually. However dlopen fails here for some reason:
|
On first start Sourcetrail tries to find the java installation with If the dlopen fails then the only reason I can think of is that Sourcetrail and the Java library are built for different architectures. Are you using the 64bit Sourcetrail build? |
|
||
src = fetchurl { | ||
name = "sourtrail.tar.gz"; | ||
url = "https://www.sourcetrail.com/downloads/${version}/linux/64bit"; |
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 should be the 64-bit version. jdk is also 64-bit of course.
Motivation for this change
Sourcetrail is a cross referencer for C/C++/Java
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)