387387 "--enable-dom"
388388 ] ;
389389 # Add a PHP lower version bound constraint to avoid applying the patch on older PHP versions.
390- patches = lib . optionals ( ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.14" && lib . versionAtLeast php . version "8.2.7" ) || ( lib . versions . majorMinor php . version == "8.1" && lib . versionAtLeast php . version "8.1.27" ) ) [
390+ patches = lib . optionals ( ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.14" && lib . versionAtLeast php . version "8.2.7" ) || ( lib . versions . majorMinor php . version == "8.1" ) ) [
391391 # Fix tests with libxml 2.12
392392 # Part of 8.3.1RC1+, 8.2.14RC1+
393393 ( fetchpatch {
@@ -397,6 +397,14 @@ in {
397397 "NEWS"
398398 ] ;
399399 } )
400+ ] ++ lib . optionals ( lib . versions . majorMinor php . version == "8.1" ) [
401+ # Backport of PHP_LIBXML_IGNORE_DEPRECATIONS_START and PHP_LIBXML_IGNORE_DEPRECATIONS_END
402+ ../development/interpreters/php/php81-fix-libxml2-2.13-compatibility.patch
403+ # Fix build with libxml2 2.13+. Has to be applied after libxml2 2.12 patch.
404+ ( fetchpatch {
405+ url = "https://github.com/php/php-src/commit/9b4f6b09d58a4e54ee60443bf9a8b166852c03e0.patch" ;
406+ hash = "sha256-YC3I0BQi3o3+VmRu/UqpqPpaSC+ekPqzbORTHftbPvY=" ;
407+ } )
400408 ] ++ lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
401409 # Fixes compatibility with libxml2 2.13. Part of 8.3.10RC1+, 8.2.22RC1+
402410 ( fetchpatch {
@@ -630,7 +638,24 @@ in {
630638 configureFlags = [
631639 "--enable-simplexml"
632640 ] ;
633- patches = lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
641+ patches = lib . optionals ( lib . versions . majorMinor php . version == "8.1" ) [
642+ # Fix tests with libxml2 2.12
643+ ( fetchpatch {
644+ url = "https://github.com/php/php-src/commit/061058a9b1bbd90d27d97d79aebcf2b5029767b0.patch" ;
645+ hash = "sha256-0hOlAG+pOYp/gUU0MUMZvzWpgr0ncJi5GB8IeNxxyEU=" ;
646+ excludes = [
647+ "NEWS"
648+ ] ;
649+ } )
650+ # Backport of PHP_LIBXML_IGNORE_DEPRECATIONS_START and PHP_LIBXML_IGNORE_DEPRECATIONS_END
651+ # Required for libxml2 2.13 compatibility patch.
652+ ../development/interpreters/php/php81-fix-libxml2-2.13-compatibility.patch
653+ # Fix build with libxml2 2.13+. Has to be applied after libxml2 2.12 patch.
654+ ( fetchpatch {
655+ url = "https://github.com/php/php-src/commit/9b4f6b09d58a4e54ee60443bf9a8b166852c03e0.patch" ;
656+ hash = "sha256-YC3I0BQi3o3+VmRu/UqpqPpaSC+ekPqzbORTHftbPvY=" ;
657+ } )
658+ ] ++ lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
634659 # Fixes compatibility with libxml2 2.13. Part of 8.3.10RC1+, 8.2.22RC1+
635660 ( fetchpatch {
636661 url = "https://github.com/php/php-src/commit/4fe821311cafb18ca8bdf20b9d796c48a13ba552.diff?full_index=1" ;
@@ -660,7 +685,24 @@ in {
660685 ] ;
661686 doCheck = stdenv . isDarwin ; # TODO: a couple tests still fail on *-linux
662687 internalDeps = [ php . extensions . session ] ;
663- patches = lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
688+ patches = lib . optionals ( lib . versions . majorMinor php . version == "8.1" ) [
689+ # Fix tests with libxml2 2.12
690+ ( fetchpatch {
691+ url = "https://github.com/php/php-src/commit/061058a9b1bbd90d27d97d79aebcf2b5029767b0.patch" ;
692+ hash = "sha256-0hOlAG+pOYp/gUU0MUMZvzWpgr0ncJi5GB8IeNxxyEU=" ;
693+ excludes = [
694+ "NEWS"
695+ ] ;
696+ } )
697+ # Backport of PHP_LIBXML_IGNORE_DEPRECATIONS_START and PHP_LIBXML_IGNORE_DEPRECATIONS_END
698+ # Required for libxml2 2.13 compatibility patch.
699+ ../development/interpreters/php/php81-fix-libxml2-2.13-compatibility.patch
700+ # Fix build with libxml2 2.13+. Has to be applied after libxml2 2.12 patch.
701+ ( fetchpatch {
702+ url = "https://github.com/php/php-src/commit/9b4f6b09d58a4e54ee60443bf9a8b166852c03e0.patch" ;
703+ hash = "sha256-YC3I0BQi3o3+VmRu/UqpqPpaSC+ekPqzbORTHftbPvY=" ;
704+ } )
705+ ] ++ lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
664706 # Fixes compatibility with libxml2 2.13. Part of 8.3.10RC1+, 8.2.22RC1+
665707 ( fetchpatch {
666708 url = "https://github.com/php/php-src/commit/4fe821311cafb18ca8bdf20b9d796c48a13ba552.diff?full_index=1" ;
@@ -705,7 +747,24 @@ in {
705747 "--enable-xml"
706748 ] ;
707749 doCheck = false ;
708- patches = lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
750+ patches = lib . optionals ( lib . versions . majorMinor php . version == "8.1" ) [
751+ # Fix tests with libxml2 2.12
752+ ( fetchpatch {
753+ url = "https://github.com/php/php-src/commit/061058a9b1bbd90d27d97d79aebcf2b5029767b0.patch" ;
754+ hash = "sha256-0hOlAG+pOYp/gUU0MUMZvzWpgr0ncJi5GB8IeNxxyEU=" ;
755+ excludes = [
756+ "NEWS"
757+ ] ;
758+ } )
759+ # Backport of PHP_LIBXML_IGNORE_DEPRECATIONS_START and PHP_LIBXML_IGNORE_DEPRECATIONS_END
760+ # Required for libxml2 2.13 compatibility patch.
761+ ../development/interpreters/php/php81-fix-libxml2-2.13-compatibility.patch
762+ # Fix build with libxml2 2.13+. Has to be applied after libxml2 2.12 patch.
763+ ( fetchpatch {
764+ url = "https://github.com/php/php-src/commit/9b4f6b09d58a4e54ee60443bf9a8b166852c03e0.patch" ;
765+ hash = "sha256-YC3I0BQi3o3+VmRu/UqpqPpaSC+ekPqzbORTHftbPvY=" ;
766+ } )
767+ ] ++ lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
709768 # Fixes compatibility with libxml2 2.13. Part of 8.3.10RC1+, 8.2.22RC1+
710769 ( fetchpatch {
711770 url = "https://github.com/php/php-src/commit/4fe821311cafb18ca8bdf20b9d796c48a13ba552.diff?full_index=1" ;
@@ -735,7 +794,24 @@ in {
735794 configureFlags = [
736795 "--enable-xmlwriter"
737796 ] ;
738- patches = lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
797+ patches = lib . optionals ( lib . versions . majorMinor php . version == "8.1" ) [
798+ # Fix tests with libxml2 2.12
799+ ( fetchpatch {
800+ url = "https://github.com/php/php-src/commit/061058a9b1bbd90d27d97d79aebcf2b5029767b0.patch" ;
801+ hash = "sha256-0hOlAG+pOYp/gUU0MUMZvzWpgr0ncJi5GB8IeNxxyEU=" ;
802+ excludes = [
803+ "NEWS"
804+ ] ;
805+ } )
806+ # Backport of PHP_LIBXML_IGNORE_DEPRECATIONS_START and PHP_LIBXML_IGNORE_DEPRECATIONS_END
807+ # Required for libxml2 2.13 compatibility patch.
808+ ../development/interpreters/php/php81-fix-libxml2-2.13-compatibility.patch
809+ # Fix build with libxml2 2.13+. Has to be applied after libxml2 2.12 patch.
810+ ( fetchpatch {
811+ url = "https://github.com/php/php-src/commit/9b4f6b09d58a4e54ee60443bf9a8b166852c03e0.patch" ;
812+ hash = "sha256-YC3I0BQi3o3+VmRu/UqpqPpaSC+ekPqzbORTHftbPvY=" ;
813+ } )
814+ ] ++ lib . optionals ( lib . versions . majorMinor php . version == "8.2" && lib . versionOlder php . version "8.2.22" ) [
739815 # Fixes compatibility with libxml2 2.13. Part of 8.3.10RC1+, 8.2.22RC1+
740816 ( fetchpatch {
741817 url = "https://github.com/php/php-src/commit/4fe821311cafb18ca8bdf20b9d796c48a13ba552.diff?full_index=1" ;
0 commit comments