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
bluej-bin: init at 414 #59718
bluej-bin: init at 414 #59718
Conversation
{ stdenv, fetchurl, makeWrapper, unzip, jetbrains | ||
}: | ||
let | ||
version = "414"; |
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.
version can be passed on to mkDerivation
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'm not sure how. When I put version
into mkDerivation like this
stdenv.mkDerivation {
version = "414";
name = "bluej-bin";
src = fetchurl {
url = "https://www.bluej.org/download/files/BlueJ-linux-${version}.deb";
sha512 = "c9c5c905d6dcf4388fe1423179be836ad8d35a4d197e53706a5764d9192c439aa60b80a28b87222b9f16ed1534d7a7768d924fc06ddd95107aea3cb00570c22a";
};
I get
error: undefined variable '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.
Clarification:
stdenv.mkDerivation rec {
version = "414";
pname = "bluej-bin";
src = fetchurl {
url = "https://www.bluej.org/download/files/BlueJ-linux-${version}.deb";
sha512 = "c9c5c905d6dcf4388fe1423179be836ad8d35a4d197e53706a5764d9192c439aa60b80a28b87222b9f16ed1534d7a7768d924fc06ddd95107aea3cb00570c22a";
};
Added missing rec
and changed name
to pname
.
version = "414"; | ||
in | ||
stdenv.mkDerivation { | ||
name = "bluej-bin-${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.
remove version from the name
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 for deciding to contribute to nixpkgs! A few small things I noticed that we can work through. I'll take a more in depth look when I get a chance. Let me know if you need any clarification on points raised so far.
@@ -1989,6 +1989,10 @@ | |||
github = "Hodapp87"; | |||
name = "Chris Hodapp"; | |||
}; | |||
hochi = { |
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.
Please include this in a separate commit
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.
So you want me to amend this and force push this branch? Or is there another way I did not know about yet? :)
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.
Yeah just rewrite the history into 2 commits and force push please.
{ stdenv, fetchurl, makeWrapper, unzip, jetbrains | ||
}: | ||
let | ||
version = "414"; |
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.
Clarification:
stdenv.mkDerivation rec {
version = "414";
pname = "bluej-bin";
src = fetchurl {
url = "https://www.bluej.org/download/files/BlueJ-linux-${version}.deb";
sha512 = "c9c5c905d6dcf4388fe1423179be836ad8d35a4d197e53706a5764d9192c439aa60b80a28b87222b9f16ed1534d7a7768d924fc06ddd95107aea3cb00570c22a";
};
Added missing rec
and changed name
to pname
.
sha512 = "c9c5c905d6dcf4388fe1423179be836ad8d35a4d197e53706a5764d9192c439aa60b80a28b87222b9f16ed1534d7a7768d924fc06ddd95107aea3cb00570c22a"; | ||
}; | ||
|
||
buildCommand = '' |
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 had a chance to play with this a little bit and this might not be prefect but something like this would be preferable:
dontBuild = true;
propagatedBuildInputs = [ jetbrains.jdk ];
nativeBuildInputs = [ makeWrapper ];
unpackPhase = ''
ar xf $src
tar xf data.tar.xz
'';
installPhase = ''
mkdir -p $out
cp -r usr/* $out/
makeWrapper ${jetbrains.jdk}/bin/java $out/bin/bluej \
--add-flags "-Djavafx.embed.singleThread=true -Dawt.useSystemAAFontSettings=on -Xmx512M -cp \"$out/share/bluej/bluej.jar:${jetbrains.jdk}/lib/tools.jar\" bluej.Boot"
'';
bluejeans = callPackage ../applications/networking/browsers/mozilla-plugins/bluejeans { }; | ||
|
||
bluej-bin = callPackage ../applications/editors/bluej-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.
You can probably just call this bluej as the non binary version isn't packaged, and if it were ever packaged it could be replaced.
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.
Will fix this, but let me note:
We have a bad habit of not building java applications ourselves in nixpkgs (which would be nice to fix some day...) so what you've done is fine.
This is exactly why I named this -bin - as propaganda against the bad habit. I guess there is no motivation to check back on from-source build of this package otherwise.
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 appreciate the thought behind that.
@H0CHI just ping me if you have any questions or need a hand with any of this. |
@H0CHI bluej is currently at version 4.2.2, please update the PR or close |
Motivation for this change
BlueJ is used in my programming lecture. Disclaimer: This is my first package submission to nixpkgs.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)