Currently, pkgsrc does not support platform-specific patches, which caused a recent problem with the lang/gcc1[2-4] packages on different Darwin platforms. Perhaps the best way to avoid this in the future is to introduce support for platform-specific patches. For example, the problem would be avoided if a package Makefile could include a section like the following .if ${MACHINE_PLATFORM:MDarwin-*-x86_64} PLATFORM_PATCH_SUBDIR= Darwin-x86_64 .endif This would indicate that patches (named patch-* as usual) in the specified subdirectory of ${PATCHDIR} should be applied together with the general patches in ${PATCHDIR}. Other platform-specific subdirectories could coexist without conflict. The attached patch mostly implements this idea. The missing part is how to get the right digests into the distinfo file, which involves teaching mk/checksum/distinfo.awk and pkgtools/mktools about this. Other solutions are of course possible. One that I have investigated was platform-specific names for patch files within ${PATCHDIR}, which also works (so far also without distinfo.awk/mktools support), but a subdirectory seems a bit more straightforward, especially if we want to import large platform-specific patches that hit many files (e.g., gcc1[2-4] patches for Darwin aarch64). I would greatly appreciate thoughts, improvements, and especially help with distinfo support; I’m having trouble with distinfo.awk and mktools. Thanks a lot. Cheers, Brook
Attachment:
mk.patch
Description: Binary data