summary refs log tree commit diff
path: root/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix
blob: f5645f563de32f80b8805eec36d5ec76282c1499 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{ lib, stdenv, fetchFromGitHub, cargo, rustc, autoreconfHook, jdk, glib, firefox-unwrapped, zip, pkg-config, npapi_sdk, bash, bc }:

stdenv.mkDerivation rec {
  pname = "adoptopenjdk-icedtea-web";

  version = "1.8.8";

  src = fetchFromGitHub {
    owner = "AdoptOpenJDK";
    repo = "IcedTea-Web";
    rev = "icedtea-web-${version}";
    sha256 = "sha256-hpEVWG9ltNDL/0EFJjgQRRce+BLcCO4ZERULYZxyC1o=";
  };

  nativeBuildInputs = [ autoreconfHook pkg-config bc ];
  buildInputs = [ cargo rustc glib firefox-unwrapped zip npapi_sdk ];

  preConfigure = ''
    configureFlagsArray+=("BIN_BASH=${bash}/bin/bash")
  '';

  patches = [ ./patches/0001-make-cargo-work-with-nix-build-on-linux.patch ];

  doCheck = true;
  preCheck = ''
    # Needed for the below rust-launcher tests to pass
    # dirs_paths_helper::tests::check_config_files_paths
    # dirs_paths_helper::tests::check_legacy_config_files_paths

    mkdir -p $HOME/.icedtea
    touch $HOME/.icedtea/deployment.properties

    mkdir -p $XDG_CONFIG_HOME/icedtea-web
    touch $XDG_CONFIG_HOME/icedtea-web/deployment.properties
  '';

  HOME = "/build";
  XDG_CONFIG_HOME = "/build";

  configureFlags = [
    "--with-itw-libs=DISTRIBUTION"
    "--with-jdk-home=${jdk.home}"
    "--disable-docs"
  ];

  mozillaPlugin = "/lib";

  postInstall = ''
    mkdir -p $out/share/applications
    cp javaws.desktop itweb-settings.desktop policyeditor.desktop $out/share/applications
  '';

  meta = {
    description = "Java web browser plugin and an implementation of Java Web Start";
    longDescription = ''
      A Free Software web browser plugin running applets written in the Java
      programming language and an implementation of Java Web Start, originally
      based on the NetX project.
    '';
    homepage = "https://github.com/adoptopenjdk/icedtea-web";
    platforms = lib.platforms.linux;
  };
}