Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / compilers / adoptopenjdk-icedtea-web / default.nix
blobf5645f563de32f80b8805eec36d5ec76282c1499
1 { lib, stdenv, fetchFromGitHub, cargo, rustc, autoreconfHook, jdk, glib, firefox-unwrapped, zip, pkg-config, npapi_sdk, bash, bc }:
3 stdenv.mkDerivation rec {
4   pname = "adoptopenjdk-icedtea-web";
6   version = "1.8.8";
8   src = fetchFromGitHub {
9     owner = "AdoptOpenJDK";
10     repo = "IcedTea-Web";
11     rev = "icedtea-web-${version}";
12     sha256 = "sha256-hpEVWG9ltNDL/0EFJjgQRRce+BLcCO4ZERULYZxyC1o=";
13   };
15   nativeBuildInputs = [ autoreconfHook pkg-config bc ];
16   buildInputs = [ cargo rustc glib firefox-unwrapped zip npapi_sdk ];
18   preConfigure = ''
19     configureFlagsArray+=("BIN_BASH=${bash}/bin/bash")
20   '';
22   patches = [ ./patches/0001-make-cargo-work-with-nix-build-on-linux.patch ];
24   doCheck = true;
25   preCheck = ''
26     # Needed for the below rust-launcher tests to pass
27     # dirs_paths_helper::tests::check_config_files_paths
28     # dirs_paths_helper::tests::check_legacy_config_files_paths
30     mkdir -p $HOME/.icedtea
31     touch $HOME/.icedtea/deployment.properties
33     mkdir -p $XDG_CONFIG_HOME/icedtea-web
34     touch $XDG_CONFIG_HOME/icedtea-web/deployment.properties
35   '';
37   HOME = "/build";
38   XDG_CONFIG_HOME = "/build";
40   configureFlags = [
41     "--with-itw-libs=DISTRIBUTION"
42     "--with-jdk-home=${jdk.home}"
43     "--disable-docs"
44   ];
46   mozillaPlugin = "/lib";
48   postInstall = ''
49     mkdir -p $out/share/applications
50     cp javaws.desktop itweb-settings.desktop policyeditor.desktop $out/share/applications
51   '';
53   meta = {
54     description = "Java web browser plugin and an implementation of Java Web Start";
55     longDescription = ''
56       A Free Software web browser plugin running applets written in the Java
57       programming language and an implementation of Java Web Start, originally
58       based on the NetX project.
59     '';
60     homepage = "https://github.com/adoptopenjdk/icedtea-web";
61     platforms = lib.platforms.linux;
62   };