From 8a2a94078bb4803847e2f685011c7de10a202aee Mon Sep 17 00:00:00 2001 From: Yureka Date: Sat, 17 Dec 2022 11:57:27 +0100 Subject: [PATCH] pkgsMusl.javaPackages.compiler.openjdk18: fix build --- pkgs/development/compilers/openjdk/18.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/openjdk/18.nix b/pkgs/development/compilers/openjdk/18.nix index 5be60eb94875..600899677fed 100644 --- a/pkgs/development/compilers/openjdk/18.nix +++ b/pkgs/development/compilers/openjdk/18.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, fetchFromGitHub, bash, pkg-config, autoconf, cpio +{ stdenv, lib, fetchurl, fetchpatch, fetchFromGitHub, bash, pkg-config, autoconf, cpio , file, which, unzip, zip, perl, cups, freetype, harfbuzz, alsa-lib, libjpeg, giflib , libpng, zlib, lcms2, libX11, libICE, libXrender, libXext, libXt, libXtst , libXi, libXinerama, libXcursor, libXrandr, fontconfig, openjdk18-bootstrap @@ -49,6 +49,13 @@ let url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch"; sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r"; }) + + # Patch borrowed from Alpine to fix build errors with musl libc and recent gcc. + # This is applied anywhere to prevent patchrot. + (fetchpatch { + url = "https://git.alpinelinux.org/aports/plain/testing/openjdk18/FixNullPtrCast.patch?id=b93d1fc37fcf106144958d957bb97c7db67bd41f"; + hash = "sha256-nvO8RcmKwMcPdzq28mZ4If1XJ6FQ76CYWqRIozPCk5U="; + }) ] ++ lib.optionals (!headless && enableGnome2) [ ./swing-use-gtk-jdk13.patch ];