Navigation Menu

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

bluej-bin: init at 414 #59718

Closed
wants to merge 1 commit into from
Closed

Conversation

cybre-finn
Copy link
Contributor

Motivation for this change

BlueJ is used in my programming lecture. Disclaimer: This is my first package submission to nixpkgs.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

{ stdenv, fetchurl, makeWrapper, unzip, jetbrains
}:
let
version = "414";
Copy link
Member

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

Copy link
Contributor Author

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'

Copy link
Member

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}";
Copy link
Member

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

Copy link
Member

@aanderse aanderse left a 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 = {
Copy link
Member

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

Copy link
Contributor Author

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? :)

Copy link
Member

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";
Copy link
Member

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 = ''
Copy link
Member

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 { };
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

@aanderse
Copy link
Member

aanderse commented May 4, 2019

@H0CHI just ping me if you have any questions or need a hand with any of this.

@wamserma
Copy link
Member

@H0CHI bluej is currently at version 4.2.2, please update the PR or close

@cybre-finn cybre-finn closed this May 27, 2020
@chvp chvp mentioned this pull request Sep 18, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants