1{
2 featureVersion,
3
4 lib,
5 stdenv,
6
7 fetchurl,
8 fetchpatch,
9
10 buildPackages,
11 pkg-config,
12 autoconf,
13 lndir,
14 unzip,
15 ensureNewerSourcesForZipFilesHook,
16 pandoc,
17
18 cpio,
19 file,
20 which,
21 zip,
22 perl,
23 zlib,
24 cups,
25 freetype,
26 harfbuzz,
27 alsa-lib,
28 libjpeg,
29 giflib,
30 libpng,
31 lcms2,
32 libX11,
33 libICE,
34 libXext,
35 libXrender,
36 libXtst,
37 libXt,
38 libXi,
39 libXinerama,
40 libXcursor,
41 libXrandr,
42 fontconfig,
43
44 setJavaClassPath,
45
46 versionCheckHook,
47
48 bash,
49 liberation_ttf,
50 cacert,
51
52 nixpkgs-openjdk-updater,
53
54 # TODO(@sternenseemann): gtk3 fails to evaluate in pkgsCross.ghcjs.buildPackages
55 # which should be fixable, this is a no-rebuild workaround for GHC.
56 headless ? lib.versionAtLeast featureVersion "21" && stdenv.targetPlatform.isGhcjs,
57
58 enableJavaFX ? false,
59 openjfx17,
60 openjfx21,
61 openjfx23,
62 openjfx24,
63 openjfx_jdk ?
64 {
65 "17" = openjfx17;
66 "21" = openjfx21;
67 "23" = openjfx23;
68 "24" = openjfx24;
69 }
70 .${featureVersion} or (throw "JavaFX is not supported on OpenJDK ${featureVersion}"),
71
72 enableGtk ? true,
73 gtk3,
74 gtk2,
75 glib,
76
77 temurin-bin-8,
78 temurin-bin-11,
79 temurin-bin-17,
80 temurin-bin-21,
81 temurin-bin-23,
82 temurin-bin-24,
83 jdk-bootstrap ?
84 {
85 "8" = temurin-bin-8.__spliced.buildBuild or temurin-bin-8;
86 "11" = temurin-bin-11.__spliced.buildBuild or temurin-bin-11;
87 "17" = temurin-bin-17.__spliced.buildBuild or temurin-bin-17;
88 "21" = temurin-bin-21.__spliced.buildBuild or temurin-bin-21;
89 "23" = temurin-bin-23.__spliced.buildBuild or temurin-bin-23;
90 "24" = temurin-bin-24.__spliced.buildBuild or temurin-bin-24;
91 }
92 .${featureVersion},
93}:
94
95let
96 sourceFile = ./. + "/${featureVersion}/source.json";
97 source = nixpkgs-openjdk-updater.openjdkSource {
98 inherit sourceFile;
99 featureVersionPrefix = tagPrefix + featureVersion;
100 };
101
102 atLeast11 = lib.versionAtLeast featureVersion "11";
103 atLeast17 = lib.versionAtLeast featureVersion "17";
104 atLeast21 = lib.versionAtLeast featureVersion "21";
105 atLeast23 = lib.versionAtLeast featureVersion "23";
106 atLeast24 = lib.versionAtLeast featureVersion "24";
107
108 tagPrefix = if atLeast11 then "jdk-" else "jdk";
109 version = lib.removePrefix "refs/tags/${tagPrefix}" source.src.rev;
110 versionSplit = builtins.match (if atLeast11 then "(.+)+(.+)" else "(.+)-b(.+)") version;
111 versionBuild = lib.elemAt versionSplit 1;
112
113 # The JRE 8 libraries are in directories that depend on the CPU.
114 architecture =
115 if atLeast11 then
116 ""
117 else
118 {
119 i686-linux = "i386";
120 x86_64-linux = "amd64";
121 aarch64-linux = "aarch64";
122 powerpc64le-linux = "ppc64le";
123 }
124 .${stdenv.system} or (throw "Unsupported platform ${stdenv.system}");
125
126 jdk-bootstrap' = jdk-bootstrap.override {
127 # when building a headless jdk, also bootstrap it with a headless jdk
128 gtkSupport = !headless;
129 };
130in
131
132assert lib.assertMsg (lib.pathExists sourceFile)
133 "OpenJDK ${featureVersion} is not a supported version";
134
135stdenv.mkDerivation (finalAttrs: {
136 pname = "openjdk" + lib.optionalString headless "-headless";
137 inherit version;
138
139 outputs =
140 [
141 "out"
142 ]
143 ++ lib.optionals (!atLeast11) [
144 "jre"
145 ];
146
147 inherit (source) src;
148
149 patches =
150 [
151 (
152 if atLeast24 then
153 ./24/patches/fix-java-home-jdk24.patch
154 else if atLeast21 then
155 ./21/patches/fix-java-home-jdk21.patch
156 else if atLeast11 then
157 ./11/patches/fix-java-home-jdk10.patch
158 else
159 ./8/patches/fix-java-home-jdk8.patch
160 )
161 (
162 if atLeast24 then
163 ./24/patches/read-truststore-from-env-jdk24.patch
164 else if atLeast11 then
165 ./11/patches/read-truststore-from-env-jdk10.patch
166 else
167 ./8/patches/read-truststore-from-env-jdk8.patch
168 )
169 ]
170 ++ lib.optionals (!atLeast23) [
171 (
172 if atLeast11 then
173 ./11/patches/currency-date-range-jdk10.patch
174 else
175 ./8/patches/currency-date-range-jdk8.patch
176 )
177 ]
178 ++ lib.optionals atLeast11 [
179 (
180 if atLeast17 then
181 ./17/patches/increase-javadoc-heap-jdk13.patch
182 else
183 ./11/patches/increase-javadoc-heap.patch
184 )
185 ]
186 ++ lib.optionals atLeast17 [
187 (
188 if atLeast21 then
189 ./21/patches/ignore-LegalNoticeFilePlugin-jdk18.patch
190 else
191 ./17/patches/ignore-LegalNoticeFilePlugin-jdk17.patch
192 )
193 ]
194 ++ lib.optionals (!atLeast21) [
195 (
196 if atLeast17 then
197 ./17/patches/fix-library-path-jdk17.patch
198 else if atLeast11 then
199 ./11/patches/fix-library-path-jdk11.patch
200 else
201 ./8/patches/fix-library-path-jdk8.patch
202 )
203 ]
204 ++ lib.optionals (atLeast17 && !atLeast23) [
205 # -Wformat etc. are stricter in newer gccs, per
206 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79677
207 # so grab the work-around from
208 # https://src.fedoraproject.org/rpms/java-openjdk/pull-request/24
209 (fetchurl {
210 url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch";
211 sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r";
212 })
213 ]
214 ++ lib.optionals (featureVersion == "17") [
215 # Patch borrowed from Alpine to fix build errors with musl libc and recent gcc.
216 # This is applied anywhere to prevent patchrot.
217 (fetchurl {
218 url = "https://git.alpinelinux.org/aports/plain/community/openjdk17/FixNullPtrCast.patch?id=41e78a067953e0b13d062d632bae6c4f8028d91c";
219 sha256 = "sha256-LzmSew51+DyqqGyyMw2fbXeBluCiCYsS1nCjt9hX6zo=";
220 })
221 ]
222 ++ lib.optionals atLeast11 [
223 # Fix build for gnumake-4.4.1:
224 # https://github.com/openjdk/jdk/pull/12992
225 (fetchpatch {
226 name = "gnumake-4.4.1";
227 url = "https://github.com/openjdk/jdk/commit/9341d135b855cc208d48e47d30cd90aafa354c36.patch";
228 hash = "sha256-Qcm3ZmGCOYLZcskNjj7DYR85R4v07vYvvavrVOYL8vg=";
229 })
230 ]
231 ++ lib.optionals (!headless && enableGtk) [
232 (
233 if atLeast17 then
234 ./17/patches/swing-use-gtk-jdk13.patch
235 else if atLeast11 then
236 ./11/patches/swing-use-gtk-jdk10.patch
237 else
238 ./8/patches/swing-use-gtk-jdk8.patch
239 )
240 ];
241
242 strictDeps = true;
243
244 depsBuildBuild = [ buildPackages.stdenv.cc ];
245
246 nativeBuildInputs =
247 [
248 pkg-config
249 ]
250 ++ lib.optionals atLeast11 [
251 autoconf
252 ]
253 ++ lib.optionals (!atLeast11) [
254 lndir
255 # Certificates generated using perl in `installPhase`
256 perl
257 ]
258 ++ lib.optionals (!atLeast11 && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
259 # Certificates generated using keytool in `installPhase`
260 buildPackages.jdk8
261 ]
262 ++ [
263 unzip
264 zip
265 which
266 # Probably for BUILD_CC but not sure, not in closure.
267 zlib
268 ]
269 ++ lib.optionals atLeast21 [
270 ensureNewerSourcesForZipFilesHook
271 ]
272 ++ lib.optionals atLeast24 [
273 pandoc
274 ];
275
276 buildInputs =
277 [
278 # TODO: Many of these should likely be in `nativeBuildInputs`.
279 cpio
280 # `-lmagic` in NIX_LDFLAGS
281 file
282 cups
283 freetype
284 ]
285 ++ lib.optionals (atLeast11 && !atLeast21) [
286 harfbuzz
287 ]
288 ++ [
289 alsa-lib
290 libjpeg
291 giflib
292 ]
293 ++ lib.optionals atLeast11 [
294 libpng
295 zlib # duplicate
296 lcms2
297 ]
298 ++ [
299 libX11
300 libICE
301 ]
302 ++ lib.optionals (!atLeast11) [
303 libXext
304 ]
305 ++ [
306 libXrender
307 ]
308 ++ lib.optionals atLeast11 [
309 libXext
310 ]
311 ++ [
312 libXtst
313 libXt
314 libXtst # duplicate
315 libXi
316 libXinerama
317 libXcursor
318 libXrandr
319 fontconfig
320 ]
321 ++ lib.optionals (!headless && enableGtk) [
322 (if atLeast11 then gtk3 else gtk2)
323 glib
324 ];
325
326 propagatedBuildInputs = lib.optionals (!atLeast11) [ setJavaClassPath ];
327
328 nativeInstallCheckInputs = lib.optionals atLeast23 [
329 versionCheckHook
330 ];
331
332 # JDK's build system attempts to specifically detect
333 # and special-case WSL, and we don't want it to do that,
334 # so pass the correct platform names explicitly
335 ${if atLeast17 then "configurePlatforms" else null} = [
336 "build"
337 "host"
338 ];
339
340 # https://openjdk.org/groups/build/doc/building.html
341 configureFlags =
342 [
343 "--with-boot-jdk=${jdk-bootstrap'.home}"
344 # https://github.com/openjdk/jdk/blob/471f112bca715d04304cbe35c6ed63df8c7b7fee/make/autoconf/util_paths.m4#L315
345 # Ignoring value of READELF from the environment. Use command line variables instead.
346 "READELF=${stdenv.cc.targetPrefix}readelf"
347 "AR=${stdenv.cc.targetPrefix}ar"
348 "STRIP=${stdenv.cc.targetPrefix}strip"
349 "NM=${stdenv.cc.targetPrefix}nm"
350 "OBJDUMP=${stdenv.cc.targetPrefix}objdump"
351 "OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
352 ]
353 ++ (
354 if atLeast23 then
355 [
356 "--with-version-string=${version}"
357 "--with-vendor-version-string=(nix)"
358 ]
359 else if atLeast11 then
360 lib.optionals atLeast17 [
361 "--with-version-build=${versionBuild}"
362 "--with-version-opt=nixos"
363 ]
364 ++ [
365 "--with-version-pre="
366 ]
367 else
368 [
369 "--with-update-version=${lib.removePrefix "${featureVersion}u" (lib.elemAt versionSplit 0)}"
370 "--with-build-number=${versionBuild}"
371 "--with-milestone=fcs"
372 ]
373 )
374 ++ [
375 "--enable-unlimited-crypto"
376 "--with-native-debug-symbols=internal"
377 ]
378 ++ lib.optionals (!atLeast21) (
379 if atLeast11 then
380 [
381 "--with-freetype=system"
382 "--with-harfbuzz=system"
383 ]
384 else
385 [
386 "--disable-freetype-bundling"
387 ]
388 )
389 ++ (
390 if atLeast11 then
391 [
392 "--with-libjpeg=system"
393 "--with-giflib=system"
394 "--with-libpng=system"
395 "--with-zlib=system"
396 "--with-lcms=system"
397 ]
398 else
399 [
400 "--with-zlib=system"
401 "--with-giflib=system"
402 ]
403 )
404 ++ [
405 "--with-stdc++lib=dynamic"
406 ]
407 ++ lib.optionals (featureVersion == "11") [
408 "--disable-warnings-as-errors"
409 ]
410 # OpenJDK 11 cannot be built by recent versions of Clang, as far as I can tell (see
411 # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260319). Known to
412 # compile with LLVM 12.
413 ++ lib.optionals (atLeast11 && stdenv.cc.isClang) [
414 "--with-toolchain-type=clang"
415 # Explicitly tell Clang to compile C++ files as C++, see
416 # https://github.com/NixOS/nixpkgs/issues/150655#issuecomment-1935304859
417 "--with-extra-cxxflags=-xc++"
418 ]
419 # This probably shouldn’t apply to OpenJDK 21; see
420 # b7e68243306833845cbf92e2ea1e0cf782481a51 which removed it for
421 # versions 15 through 20.
422 ++ lib.optional (
423 (featureVersion == "11" || featureVersion == "21") && stdenv.hostPlatform.isx86_64
424 ) "--with-jvm-features=zgc"
425 ++ lib.optional headless (if atLeast11 then "--enable-headless-only" else "--disable-headful")
426 ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx_jdk}";
427
428 buildFlags = if atLeast17 then [ "images" ] else [ "all" ];
429
430 separateDebugInfo = true;
431
432 # -j flag is explicitly rejected by the build system:
433 # Error: 'make -jN' is not supported, use 'make JOBS=N'
434 # Note: it does not make build sequential. Build system
435 # still runs in parallel.
436 enableParallelBuilding = false;
437
438 env =
439 {
440 NIX_CFLAGS_COMPILE =
441 if atLeast17 then
442 "-Wno-error"
443 else if atLeast11 then
444 # Workaround for
445 # `cc1plus: error: '-Wformat-security' ignored without '-Wformat' [-Werror=format-security]`
446 # when building jtreg
447 "-Wformat"
448 else
449 lib.concatStringsSep " " (
450 [
451 # glibc 2.24 deprecated readdir_r so we need this
452 # See https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg49006.html
453 "-Wno-error=deprecated-declarations"
454 ]
455 ++ lib.optionals stdenv.cc.isGNU [
456 # https://bugzilla.redhat.com/show_bug.cgi?id=1306558
457 # https://github.com/JetBrains/jdk8u/commit/eaa5e0711a43d64874111254d74893fa299d5716
458 "-fno-lifetime-dse"
459 "-fno-delete-null-pointer-checks"
460 "-std=gnu++98"
461 "-Wno-error"
462 ]
463 ++ [
464 # error by default in GCC 14
465 "-Wno-error=int-conversion"
466 "-Wno-error=incompatible-pointer-types"
467 ]
468 );
469
470 NIX_LDFLAGS = lib.concatStringsSep " " (
471 lib.optionals (!headless) [
472 "-lfontconfig"
473 "-lcups"
474 "-lXinerama"
475 "-lXrandr"
476 "-lmagic"
477 ]
478 ++ lib.optionals (!headless && enableGtk) [
479 (if atLeast11 then "-lgtk-3" else "-lgtk-x11-2.0")
480 "-lgio-2.0"
481 ]
482 );
483 }
484 // lib.optionalAttrs (!atLeast11) {
485 # OpenJDK 8 Hotspot cares about the host(!) version otherwise
486 DISABLE_HOTSPOT_OS_VERSION_CHECK = "ok";
487 };
488
489 ${if atLeast23 then "versionCheckProgram" else null} = "${placeholder "out"}/bin/java";
490
491 ${if !atLeast11 then "doCheck" else null} = false; # fails with "No rule to make target 'y'."
492
493 doInstallCheck = atLeast23;
494
495 ${if atLeast17 then "postPatch" else null} =
496 ''
497 chmod +x configure
498 patchShebangs --build configure
499 ''
500 + lib.optionalString atLeast24 ''
501 chmod +x make/scripts/*.{template,sh,pl}
502 patchShebangs --build make/scripts
503 '';
504
505 ${if !atLeast17 then "preConfigure" else null} =
506 ''
507 chmod +x configure
508 substituteInPlace configure --replace /bin/bash "${bash}/bin/bash"
509 ''
510 + lib.optionalString (!atLeast11) ''
511 substituteInPlace hotspot/make/linux/adlc_updater --replace /bin/sh "${stdenv.shell}"
512 substituteInPlace hotspot/make/linux/makefiles/dtrace.make --replace /usr/include/sys/sdt.h "/no-such-path"
513 '';
514
515 installPhase =
516 ''
517 mkdir -p $out/lib
518
519 mv build/*/images/${if atLeast11 then "jdk" else "j2sdk-image"} $out/lib/openjdk
520
521 # Remove some broken manpages.
522 rm -rf $out/lib/openjdk/man/ja*
523
524 # Mirror some stuff in top-level.
525 mkdir -p $out/share
526 ln -s $out/lib/openjdk/include $out/include
527 ln -s $out/lib/openjdk/man $out/share/man
528 ''
529 + lib.optionalString atLeast17 ''
530
531 # IDEs use the provided src.zip to navigate the Java codebase (https://github.com/NixOS/nixpkgs/pull/95081)
532 ''
533 + lib.optionalString atLeast11 ''
534 ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip
535 ''
536 + ''
537
538 # jni.h expects jni_md.h to be in the header search path.
539 ln -s $out/include/linux/*_md.h $out/include/
540
541 # Remove crap from the installation.
542 rm -rf $out/lib/openjdk/demo${lib.optionalString (!atLeast11) " $out/lib/openjdk/sample"}
543 ${lib.optionalString headless (
544 if atLeast11 then
545 ''
546 rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so
547 ''
548 else
549 ''
550 rm $out/lib/openjdk/jre/lib/${architecture}/{libjsound,libjsoundalsa,libsplashscreen,libawt*,libfontmanager}.so
551 rm $out/lib/openjdk/jre/bin/policytool
552 rm $out/lib/openjdk/bin/{policytool,appletviewer}
553 ''
554 )}
555 ''
556 + lib.optionalString (!atLeast11) ''
557
558 # Move the JRE to a separate output
559 mkdir -p $jre/lib/openjdk
560 mv $out/lib/openjdk/jre $jre/lib/openjdk/jre
561 mkdir $out/lib/openjdk/jre
562 lndir $jre/lib/openjdk/jre $out/lib/openjdk/jre
563
564 # Make sure cmm/*.pf are not symlinks:
565 # https://youtrack.jetbrains.com/issue/IDEA-147272
566 rm -rf $out/lib/openjdk/jre/lib/cmm
567 ln -s {$jre,$out}/lib/openjdk/jre/lib/cmm
568
569 # Setup fallback fonts
570 ${lib.optionalString (!headless) ''
571 mkdir -p $jre/lib/openjdk/jre/lib/fonts
572 ln -s ${liberation_ttf}/share/fonts/truetype $jre/lib/openjdk/jre/lib/fonts/fallback
573 ''}
574
575 # Remove duplicate binaries.
576 for i in $(cd $out/lib/openjdk/bin && echo *); do
577 if [ "$i" = java ]; then continue; fi
578 if cmp -s $out/lib/openjdk/bin/$i $jre/lib/openjdk/jre/bin/$i; then
579 ln -sfn $jre/lib/openjdk/jre/bin/$i $out/lib/openjdk/bin/$i
580 fi
581 done
582
583 # Generate certificates.
584 (
585 cd $jre/lib/openjdk/jre/lib/security
586 rm cacerts
587 perl ${./8/generate-cacerts.pl} ${
588 if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
589 "$jre/lib/openjdk/jre/bin/keytool"
590 else
591 "keytool"
592 } ${cacert}/etc/ssl/certs/ca-bundle.crt
593 )
594 ''
595 + ''
596
597 ln -s $out/lib/openjdk/bin $out/bin
598 ''
599 + lib.optionalString (!atLeast11) ''
600 ln -s $jre/lib/openjdk/jre/bin $jre/bin
601 ln -s $jre/lib/openjdk/jre $out/jre
602 '';
603
604 preFixup =
605 (
606 if atLeast11 then
607 ''
608 # Propagate the setJavaClassPath setup hook so that any package
609 # that depends on the JDK has $CLASSPATH set up properly.
610 mkdir -p $out/nix-support
611 #TODO or printWords? cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
612 echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
613 ''
614 else
615 ''
616 # Propagate the setJavaClassPath setup hook from the JRE so that
617 # any package that depends on the JRE has $CLASSPATH set up
618 # properly.
619 mkdir -p $jre/nix-support
620 printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
621 ''
622 )
623 + ''
624
625 # Set JAVA_HOME automatically.
626 mkdir -p $out/nix-support
627 cat <<EOF > $out/nix-support/setup-hook
628 if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
629 EOF
630 '';
631
632 postFixup = ''
633 # Build the set of output library directories to rpath against
634 LIBDIRS=""
635 for output in $(getAllOutputNames); do
636 if [ "$output" = debug ]; then continue; fi
637 LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | ${
638 if atLeast17 then "sort -u" else "sort | uniq"
639 } | tr '\n' ':'):$LIBDIRS"
640 done
641 # Add the local library paths to remove dependencies on the bootstrap
642 for output in $(getAllOutputNames); do
643 if [ "$output" = debug ]; then continue; fi
644 OUTPUTDIR=$(eval echo \$$output)
645 BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
646 echo "$BINLIBS" | while read i; do
647 patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
648 patchelf --shrink-rpath "$i" || true
649 done
650 done
651 '';
652
653 # TODO: The OpenJDK 8 derivation got this wrong.
654 disallowedReferences = [
655 (if atLeast11 then jdk-bootstrap' else jdk-bootstrap)
656 ];
657
658 passthru =
659 {
660 home = "${finalAttrs.finalPackage}/lib/openjdk";
661 inherit jdk-bootstrap;
662 inherit (source) updateScript;
663 }
664 // (if atLeast11 then { inherit gtk3; } else { inherit gtk2; })
665 // lib.optionalAttrs (!atLeast23) {
666 inherit architecture;
667 };
668
669 meta = {
670 description = "Open-source Java Development Kit";
671 homepage = "https://openjdk.java.net/";
672 license = lib.licenses.gpl2Only;
673 maintainers = with lib.maintainers; [
674 edwtjo
675 infinidoge
676 ];
677 teams = [ lib.teams.java ];
678 mainProgram = "java";
679 platforms =
680 [
681 "i686-linux"
682 "x86_64-linux"
683 "aarch64-linux"
684 ]
685 ++ lib.optionals atLeast11 [
686 "armv7l-linux"
687 "armv6l-linux"
688 "powerpc64le-linux"
689 ]
690 ++ lib.optionals atLeast17 [
691 "riscv64-linux"
692 ];
693 # OpenJDK 8 was broken for musl at 2024-01-17. Tracking issue:
694 # https://github.com/NixOS/nixpkgs/issues/281618
695 # error: ‘isnanf’ was not declared in this scope
696 broken = !atLeast11 && stdenv.hostPlatform.isMusl;
697 };
698})