Sat May 11 14:55:52 2024 UTC (36d)
lang/ghc98: Add an upstream URL to a patch


(pho)
diff -r1.5 -r1.6 pkgsrc/lang/ghc98/distinfo
diff -r1.2 -r1.3 pkgsrc/lang/ghc98/patches/patch-hadrian_bootstrap_bootstrap.py

cvs diff -r1.5 -r1.6 pkgsrc/lang/ghc98/distinfo (switch to unified diff)

--- pkgsrc/lang/ghc98/distinfo 2024/05/08 02:43:58 1.5
+++ pkgsrc/lang/ghc98/distinfo 2024/05/11 14:55:51 1.6
@@ -1,60 +1,60 @@ @@ -1,60 +1,60 @@
1$NetBSD: distinfo,v 1.5 2024/05/08 02:43:58 pho Exp $ 1$NetBSD: distinfo,v 1.6 2024/05/11 14:55:51 pho Exp $
2 2
3BLAKE2s (ghc-9.4.7-boot-aarch64-apple-darwin.tar.xz) = c771cfa45f5635bdf8175775cf7a67c9541bd5b4d4927ed9b5189e3dcefcd2ba 3BLAKE2s (ghc-9.4.7-boot-aarch64-apple-darwin.tar.xz) = c771cfa45f5635bdf8175775cf7a67c9541bd5b4d4927ed9b5189e3dcefcd2ba
4SHA512 (ghc-9.4.7-boot-aarch64-apple-darwin.tar.xz) = 3d50e4c6605ebfa7eef018d3e9e11e8115cf2f97e24a5adfc05fd1bab152c726e240f9a213d73e220dc7fc5b9358df74eee0d4cb1b77bd5491f28899c831b1a4 4SHA512 (ghc-9.4.7-boot-aarch64-apple-darwin.tar.xz) = 3d50e4c6605ebfa7eef018d3e9e11e8115cf2f97e24a5adfc05fd1bab152c726e240f9a213d73e220dc7fc5b9358df74eee0d4cb1b77bd5491f28899c831b1a4
5Size (ghc-9.4.7-boot-aarch64-apple-darwin.tar.xz) = 109805384 bytes 5Size (ghc-9.4.7-boot-aarch64-apple-darwin.tar.xz) = 109805384 bytes
6BLAKE2s (ghc-9.4.7-boot-aarch64-unknown-netbsd.tar.xz) = a691117b405b9f7954b954acc382b3357a9ff8c98151514c82d18d83da397940 6BLAKE2s (ghc-9.4.7-boot-aarch64-unknown-netbsd.tar.xz) = a691117b405b9f7954b954acc382b3357a9ff8c98151514c82d18d83da397940
7SHA512 (ghc-9.4.7-boot-aarch64-unknown-netbsd.tar.xz) = 1c917a52a020be3a1878f9d7e8e4c47d31180e54248c127a60706c1053a95b2d8a487f79e7fb5daa725178f271a7cc17e4e7b47ce2119f8546e259c63b9864d8 7SHA512 (ghc-9.4.7-boot-aarch64-unknown-netbsd.tar.xz) = 1c917a52a020be3a1878f9d7e8e4c47d31180e54248c127a60706c1053a95b2d8a487f79e7fb5daa725178f271a7cc17e4e7b47ce2119f8546e259c63b9864d8
8Size (ghc-9.4.7-boot-aarch64-unknown-netbsd.tar.xz) = 90305900 bytes 8Size (ghc-9.4.7-boot-aarch64-unknown-netbsd.tar.xz) = 90305900 bytes
9BLAKE2s (ghc-9.4.7-boot-hadrian-ghc9.8.tar.gz) = ac74fdc6f8a5d4a75bda0c6501902c2c160d3780b41b739129b5a36773c295cd 9BLAKE2s (ghc-9.4.7-boot-hadrian-ghc9.8.tar.gz) = ac74fdc6f8a5d4a75bda0c6501902c2c160d3780b41b739129b5a36773c295cd
10SHA512 (ghc-9.4.7-boot-hadrian-ghc9.8.tar.gz) = e086a40eb6b655fcb22744a32247ab596adf649179681d6203514d66cbc0989e6b59430de5f02e18419b27584e2dbac5a418fb40f66bcdc76e8776d1e315a332 10SHA512 (ghc-9.4.7-boot-hadrian-ghc9.8.tar.gz) = e086a40eb6b655fcb22744a32247ab596adf649179681d6203514d66cbc0989e6b59430de5f02e18419b27584e2dbac5a418fb40f66bcdc76e8776d1e315a332
11Size (ghc-9.4.7-boot-hadrian-ghc9.8.tar.gz) = 1527081 bytes 11Size (ghc-9.4.7-boot-hadrian-ghc9.8.tar.gz) = 1527081 bytes
12BLAKE2s (ghc-9.4.7-boot-i386-unknown-freebsd.tar.xz) = f81c97f117156e8d4f1e7cec33a0e969a78ff1be7c9a5ebf212b9e521c1c23f4 12BLAKE2s (ghc-9.4.7-boot-i386-unknown-freebsd.tar.xz) = f81c97f117156e8d4f1e7cec33a0e969a78ff1be7c9a5ebf212b9e521c1c23f4
13SHA512 (ghc-9.4.7-boot-i386-unknown-freebsd.tar.xz) = b32a9d4c6423cd858dcbd4f07e68d3ef49b879323b9eee36c6495574e15881ea70ff2aa3c02897165d6d9872693f4ee11c4fe86b613b49a7864ca4730ebbc865 13SHA512 (ghc-9.4.7-boot-i386-unknown-freebsd.tar.xz) = b32a9d4c6423cd858dcbd4f07e68d3ef49b879323b9eee36c6495574e15881ea70ff2aa3c02897165d6d9872693f4ee11c4fe86b613b49a7864ca4730ebbc865
14Size (ghc-9.4.7-boot-i386-unknown-freebsd.tar.xz) = 78875476 bytes 14Size (ghc-9.4.7-boot-i386-unknown-freebsd.tar.xz) = 78875476 bytes
15BLAKE2s (ghc-9.4.7-boot-x86_64-apple-darwin.tar.xz) = 2ee9f0deb331b7ac3fbbb8dd6acb595b23329bfc3ee95c16faf9dba378f11525 15BLAKE2s (ghc-9.4.7-boot-x86_64-apple-darwin.tar.xz) = 2ee9f0deb331b7ac3fbbb8dd6acb595b23329bfc3ee95c16faf9dba378f11525
16SHA512 (ghc-9.4.7-boot-x86_64-apple-darwin.tar.xz) = 5abedf9427a73b229beffdd6b1085bb11db100e7222b1e66b46a2cce72235d9c0152c4fd5c433676b3e132db277adf9f6a4267e60fcf48d1902ba50dbac81fa5 16SHA512 (ghc-9.4.7-boot-x86_64-apple-darwin.tar.xz) = 5abedf9427a73b229beffdd6b1085bb11db100e7222b1e66b46a2cce72235d9c0152c4fd5c433676b3e132db277adf9f6a4267e60fcf48d1902ba50dbac81fa5
17Size (ghc-9.4.7-boot-x86_64-apple-darwin.tar.xz) = 111036360 bytes 17Size (ghc-9.4.7-boot-x86_64-apple-darwin.tar.xz) = 111036360 bytes
18BLAKE2s (ghc-9.4.7-boot-x86_64-unknown-freebsd.tar.xz) = 9356f28874c23beb64472241f301079b66ad0de010af186c75c5f05d7df91206 18BLAKE2s (ghc-9.4.7-boot-x86_64-unknown-freebsd.tar.xz) = 9356f28874c23beb64472241f301079b66ad0de010af186c75c5f05d7df91206
19SHA512 (ghc-9.4.7-boot-x86_64-unknown-freebsd.tar.xz) = b40be23acea89133d2ec5049b920d3de9585c5cef7913a3b15623a00fa34f1ef51aafc33e7294b031621bcde2f3996c9a8c43f1b0f680903bbf1b1ba48e107fb 19SHA512 (ghc-9.4.7-boot-x86_64-unknown-freebsd.tar.xz) = b40be23acea89133d2ec5049b920d3de9585c5cef7913a3b15623a00fa34f1ef51aafc33e7294b031621bcde2f3996c9a8c43f1b0f680903bbf1b1ba48e107fb
20Size (ghc-9.4.7-boot-x86_64-unknown-freebsd.tar.xz) = 77145928 bytes 20Size (ghc-9.4.7-boot-x86_64-unknown-freebsd.tar.xz) = 77145928 bytes
21BLAKE2s (ghc-9.4.7-boot-x86_64-unknown-netbsd.tar.xz) = b920b6b54f5c1c6ab5fcbad14298ae742942e14da8105831df535926b9b9f529 21BLAKE2s (ghc-9.4.7-boot-x86_64-unknown-netbsd.tar.xz) = b920b6b54f5c1c6ab5fcbad14298ae742942e14da8105831df535926b9b9f529
22SHA512 (ghc-9.4.7-boot-x86_64-unknown-netbsd.tar.xz) = 4821dbf8f50c42a3427322c7488a07738d41da2236102571fc3051fd4d41a7a75754a1b27769365fc7f9d01ba0af65b87e51933077b3c36c2084ee3053479040 22SHA512 (ghc-9.4.7-boot-x86_64-unknown-netbsd.tar.xz) = 4821dbf8f50c42a3427322c7488a07738d41da2236102571fc3051fd4d41a7a75754a1b27769365fc7f9d01ba0af65b87e51933077b3c36c2084ee3053479040
23Size (ghc-9.4.7-boot-x86_64-unknown-netbsd.tar.xz) = 77029664 bytes 23Size (ghc-9.4.7-boot-x86_64-unknown-netbsd.tar.xz) = 77029664 bytes
24BLAKE2s (ghc-9.4.7-boot-x86_64-unknown-solaris2.tar.xz) = 82abea5431d6d106c7eb4388c196594a050446f8164aecd5c76e263a96114a03 24BLAKE2s (ghc-9.4.7-boot-x86_64-unknown-solaris2.tar.xz) = 82abea5431d6d106c7eb4388c196594a050446f8164aecd5c76e263a96114a03
25SHA512 (ghc-9.4.7-boot-x86_64-unknown-solaris2.tar.xz) = c6dd73fce67dd8a4933a7f31318af662bc3fd873e3d96fa6aa2e0c72282c554cc2e13abdecc29919231c3cf346d878f5f738bb72f2db53d63dd79bf07a1e2d91 25SHA512 (ghc-9.4.7-boot-x86_64-unknown-solaris2.tar.xz) = c6dd73fce67dd8a4933a7f31318af662bc3fd873e3d96fa6aa2e0c72282c554cc2e13abdecc29919231c3cf346d878f5f738bb72f2db53d63dd79bf07a1e2d91
26Size (ghc-9.4.7-boot-x86_64-unknown-solaris2.tar.xz) = 128747936 bytes 26Size (ghc-9.4.7-boot-x86_64-unknown-solaris2.tar.xz) = 128747936 bytes
27BLAKE2s (ghc-9.8.2-src.tar.xz) = 4d903dc828e46d12ad4dc8be912e2996666351ecf8b7a5e1c85790f1fb7eaa5a 27BLAKE2s (ghc-9.8.2-src.tar.xz) = 4d903dc828e46d12ad4dc8be912e2996666351ecf8b7a5e1c85790f1fb7eaa5a
28SHA512 (ghc-9.8.2-src.tar.xz) = 9b677d5ead5ebb5df7bc960055a76ef00e68ed8102844997b12154bf71bdbfafdfff9ca31edce86b3df759242a7c98f52a464887973b53985f54ecd9fc4b4627 28SHA512 (ghc-9.8.2-src.tar.xz) = 9b677d5ead5ebb5df7bc960055a76ef00e68ed8102844997b12154bf71bdbfafdfff9ca31edce86b3df759242a7c98f52a464887973b53985f54ecd9fc4b4627
29Size (ghc-9.8.2-src.tar.xz) = 32432564 bytes 29Size (ghc-9.8.2-src.tar.xz) = 32432564 bytes
30SHA1 (patch-compiler_GHC_Driver_Pipeline_Execute.hs) = 8a86aabddfa4cc5dcff3bb9812010696fb6a16df 30SHA1 (patch-compiler_GHC_Driver_Pipeline_Execute.hs) = 8a86aabddfa4cc5dcff3bb9812010696fb6a16df
31SHA1 (patch-compiler_GHC_SysTools_Process.hs) = ceb26657516e207e22d555ec6f87f735344b0d08 31SHA1 (patch-compiler_GHC_SysTools_Process.hs) = ceb26657516e207e22d555ec6f87f735344b0d08
32SHA1 (patch-configure.ac) = 985482ae70830ddbf1334c9c82a2cec78a34bb4c 32SHA1 (patch-configure.ac) = 985482ae70830ddbf1334c9c82a2cec78a34bb4c
33SHA1 (patch-hadrian_bindist_Makefile) = 3a91d56be4f1b59c6534eceb5b1a4f8e86d49c68 33SHA1 (patch-hadrian_bindist_Makefile) = 3a91d56be4f1b59c6534eceb5b1a4f8e86d49c68
34SHA1 (patch-hadrian_bootstrap_bootstrap.py) = a69ba672e9027cf44e96a2326f916d4ac1df8c98 34SHA1 (patch-hadrian_bootstrap_bootstrap.py) = bf96af392612aad143373f628dcbd3345b83eee7
35SHA1 (patch-hadrian_bootstrap_src_Main.hs) = 2e0a7ae2ef195013ca07313c150a7e48b6985e32 35SHA1 (patch-hadrian_bootstrap_src_Main.hs) = 2e0a7ae2ef195013ca07313c150a7e48b6985e32
36SHA1 (patch-hadrian_src_Builder.hs) = bbfb1ddc30af900c89ca3cf649a32da2a1c83174 36SHA1 (patch-hadrian_src_Builder.hs) = bbfb1ddc30af900c89ca3cf649a32da2a1c83174
37SHA1 (patch-hadrian_src_Rules_BinaryDist.hs) = fb908f74b8b619bccd673fbdb40b1c53ab7a51d8 37SHA1 (patch-hadrian_src_Rules_BinaryDist.hs) = fb908f74b8b619bccd673fbdb40b1c53ab7a51d8
38SHA1 (patch-hadrian_src_Settings_Builders_Ghc.hs) = e2913e9f83bb36bb0b432a24518c9b6ca2990c6a 38SHA1 (patch-hadrian_src_Settings_Builders_Ghc.hs) = e2913e9f83bb36bb0b432a24518c9b6ca2990c6a
39SHA1 (patch-hadrian_src_Settings_Default.hs) = b8b1564fa7941f3c7c737f4115b5f4d7d0e0125a 39SHA1 (patch-hadrian_src_Settings_Default.hs) = b8b1564fa7941f3c7c737f4115b5f4d7d0e0125a
40SHA1 (patch-hadrian_src_Settings_Packages.hs) = d7dce5ff44a3dc05efc6c31aed7234c235594231 40SHA1 (patch-hadrian_src_Settings_Packages.hs) = d7dce5ff44a3dc05efc6c31aed7234c235594231
41SHA1 (patch-libraries_Cabal_Cabal_src_Distribution_Simple_GHC.hs) = 9e6028dd6ffc2d3c71493fbb7336adcec9f08f78 41SHA1 (patch-libraries_Cabal_Cabal_src_Distribution_Simple_GHC.hs) = 9e6028dd6ffc2d3c71493fbb7336adcec9f08f78
42SHA1 (patch-libraries_Cabal_Cabal_src_Distribution_Simple_Register.hs) = 2bfadb25ae6fdc701c3de988d8886eab48999de6 42SHA1 (patch-libraries_Cabal_Cabal_src_Distribution_Simple_Register.hs) = 2bfadb25ae6fdc701c3de988d8886eab48999de6
43SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00 43SHA1 (patch-libraries_base_GHC_Event_KQueue.hsc) = 8ee5da667a241a05fde3c580d3dc9bdc05aa5f00
44SHA1 (patch-libraries_base_System_CPUTime_Posix_Times.hsc) = 2bfb779d534d12073287274ce5e90b99e457a860 44SHA1 (patch-libraries_base_System_CPUTime_Posix_Times.hsc) = 2bfb779d534d12073287274ce5e90b99e457a860
45SHA1 (patch-libraries_base_System_Environment.hs) = 7d79a91f295915b4408d5f41d5405739d7189215 45SHA1 (patch-libraries_base_System_Environment.hs) = 7d79a91f295915b4408d5f41d5405739d7189215
46SHA1 (patch-libraries_base_configure) = 4e02082cdfde8d927d12f3d2f3d98ace6d4ee116 46SHA1 (patch-libraries_base_configure) = 4e02082cdfde8d927d12f3d2f3d98ace6d4ee116
47SHA1 (patch-libraries_terminfo_configure.ac) = 068c2b89fc997a433709ec171c685654598781d7 47SHA1 (patch-libraries_terminfo_configure.ac) = 068c2b89fc997a433709ec171c685654598781d7
48SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimespec.hsc) = 588270767f8a9cbde0648fc99807891fef65d721 48SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimespec.hsc) = 588270767f8a9cbde0648fc99807891fef65d721
49SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimeval.hs) = 68914d012a98cc4a4a245efeabcb9143dba0246a 49SHA1 (patch-libraries_time_lib_Data_Time_Clock_Internal_CTimeval.hs) = 68914d012a98cc4a4a245efeabcb9143dba0246a
50SHA1 (patch-libraries_unix_System_Posix_Env.hsc) = 414f0310793bf184cdac7546e3f81fee4821a05f 50SHA1 (patch-libraries_unix_System_Posix_Env.hsc) = 414f0310793bf184cdac7546e3f81fee4821a05f
51SHA1 (patch-libraries_unix_System_Posix_Env_ByteString.hsc) = a579c00d7d5d7ffbb73f6499e09588d6417be123 51SHA1 (patch-libraries_unix_System_Posix_Env_ByteString.hsc) = a579c00d7d5d7ffbb73f6499e09588d6417be123
52SHA1 (patch-libraries_unix_System_Posix_Env_PosixString.hsc) = 40d464638eb11cb832f93d9892818655f4d70e00 52SHA1 (patch-libraries_unix_System_Posix_Env_PosixString.hsc) = 40d464638eb11cb832f93d9892818655f4d70e00
53SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = ee59a04571881382bcfd9fc82bf196ff86a40ed5 53SHA1 (patch-libraries_unix_System_Posix_Signals.hsc) = ee59a04571881382bcfd9fc82bf196ff86a40ed5
54SHA1 (patch-libraries_unix_System_Posix_User.hsc) = b583f591838fe2d7f42241787e02c5385d336939 54SHA1 (patch-libraries_unix_System_Posix_User.hsc) = b583f591838fe2d7f42241787e02c5385d336939
55SHA1 (patch-libraries_unix_System_Posix_User_ByteString.hsc) = 2a331de2292835ae6904980facd8201705fa63e8 55SHA1 (patch-libraries_unix_System_Posix_User_ByteString.hsc) = 2a331de2292835ae6904980facd8201705fa63e8
56SHA1 (patch-m4_fp__find__cxx__std__lib.m4) = 35196c70e462df054f6b06c299474937a1b71b58 56SHA1 (patch-m4_fp__find__cxx__std__lib.m4) = 35196c70e462df054f6b06c299474937a1b71b58
57SHA1 (patch-m4_fptools__set__haskell__platform__vars.m4) = 8c7a7ab965f4df8a68bedb35c32ee32c59ac2c94 57SHA1 (patch-m4_fptools__set__haskell__platform__vars.m4) = 8c7a7ab965f4df8a68bedb35c32ee32c59ac2c94
58SHA1 (patch-rts_rts.cabal.in) = f913753935b64a26f57d9b7304180d944dcb78f6 58SHA1 (patch-rts_rts.cabal.in) = f913753935b64a26f57d9b7304180d944dcb78f6
59SHA1 (patch-utils_haddock_driver_Main.hs) = 26b015d3aef9fdff66e66c8e3d9a370a2dbd7067 59SHA1 (patch-utils_haddock_driver_Main.hs) = 26b015d3aef9fdff66e66c8e3d9a370a2dbd7067
60SHA1 (patch-utils_haddock_haddock.cabal) = c8a244f2f341b736b65b218590d1a3a8309f55ba 60SHA1 (patch-utils_haddock_haddock.cabal) = c8a244f2f341b736b65b218590d1a3a8309f55ba

cvs diff -r1.2 -r1.3 pkgsrc/lang/ghc98/patches/patch-hadrian_bootstrap_bootstrap.py (switch to unified diff)

--- pkgsrc/lang/ghc98/patches/patch-hadrian_bootstrap_bootstrap.py 2024/05/01 03:22:33 1.2
+++ pkgsrc/lang/ghc98/patches/patch-hadrian_bootstrap_bootstrap.py 2024/05/11 14:55:51 1.3
@@ -1,132 +1,132 @@ @@ -1,132 +1,132 @@
1$NetBSD: patch-hadrian_bootstrap_bootstrap.py,v 1.2 2024/05/01 03:22:33 pho Exp $ 1$NetBSD: patch-hadrian_bootstrap_bootstrap.py,v 1.3 2024/05/11 14:55:51 pho Exp $
2 2
3Hunk #0, #1: 3Hunk #0, #1:
4 bootstrap.py assumes that GHC always has a threaded RTS but our 4 bootstrap.py assumes that GHC always has a threaded RTS but our
5 bootkits don't. It is debatable at least as to whether this should be 5 bootkits don't. It is debatable at least as to whether this should be
6 upstreamed. 6 upstreamed.
7 7
8 We also need to patch some packages to bootstrap hadrian. Those patch 8 We also need to patch some packages to bootstrap hadrian. Those patch
9 files are in ${FILESDIR}. 9 files are in ${FILESDIR}.
10 10
11Hunk #1-#7: 11Hunk #1-#7:
12 Support --jobs=N for parallel compilation. This makes bootstrapping 12 Support --jobs=N for parallel compilation. This makes bootstrapping
13 hadrian a lot faster. 13 hadrian a lot faster.
14 TODO: Upstream this. 14 https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12610
15 15
16--- hadrian/bootstrap/bootstrap.py.orig 2024-02-22 20:59:45.000000000 +0000 16--- hadrian/bootstrap/bootstrap.py.orig 2024-02-22 20:59:45.000000000 +0000
17+++ hadrian/bootstrap/bootstrap.py 17+++ hadrian/bootstrap/bootstrap.py
18@@ -25,6 +25,7 @@ import sys 18@@ -25,6 +25,7 @@ import sys
19 from textwrap import dedent 19 from textwrap import dedent
20 from typing import Optional, Dict, List, Tuple, \ 20 from typing import Optional, Dict, List, Tuple, \
21 NewType, BinaryIO, NamedTuple 21 NewType, BinaryIO, NamedTuple
22+import os 22+import os
23  23
24 #logging.basicConfig(level=logging.INFO) 24 #logging.basicConfig(level=logging.INFO)
25  25
26@@ -180,24 +181,42 @@ def resolve_dep(dep : BootstrapDep) -> P 26@@ -180,24 +181,42 @@ def resolve_dep(dep : BootstrapDep) -> P
27 return sdist_dir 27 return sdist_dir
28  28
29  29
30-def install_dep(dep: BootstrapDep, ghc: Compiler) -> None: 30-def install_dep(dep: BootstrapDep, ghc: Compiler) -> None:
31+def install_dep(dep: BootstrapDep, ghc: Compiler, jobs: int) -> None: 31+def install_dep(dep: BootstrapDep, ghc: Compiler, jobs: int) -> None:
32 dist_dir = (DISTDIR / f'{dep.package}-{dep.version}').resolve() 32 dist_dir = (DISTDIR / f'{dep.package}-{dep.version}').resolve()
33  33
34 sdist_dir = resolve_dep(dep) 34 sdist_dir = resolve_dep(dep)
35  35
36- install_sdist(dist_dir, sdist_dir, ghc, dep.flags) 36- install_sdist(dist_dir, sdist_dir, ghc, dep.flags)
37+ # Some packages are going to be built with threaded RTS, which is 37+ # Some packages are going to be built with threaded RTS, which is
38+ # impossible in our case. 38+ # impossible in our case.
39+ flags = [flag.replace("+threaded", "-threaded") for flag in dep.flags] 39+ flags = [flag.replace("+threaded", "-threaded") for flag in dep.flags]
40+ 40+
41+ # pkgsrc has local patches that need to be applied for bootstrapping 41+ # pkgsrc has local patches that need to be applied for bootstrapping
42+ # hadrian. 42+ # hadrian.
43+ patch_path = Path(os.environ['FILESDIR']) / f'hadrian-{dep.package}.patch' 43+ patch_path = Path(os.environ['FILESDIR']) / f'hadrian-{dep.package}.patch'
44+ if patch_path.is_file(): 44+ if patch_path.is_file():
45+ with open(patch_path) as patch_file: 45+ with open(patch_path) as patch_file:
46+ patch = patch_file.read() 46+ patch = patch_file.read()
47+ subprocess_run( 47+ subprocess_run(
48+ ['patch', '-p1', '-b'], cwd=sdist_dir, input=patch, check=True, encoding='UTF-8') 48+ ['patch', '-p1', '-b'], cwd=sdist_dir, input=patch, check=True, encoding='UTF-8')
49+ 49+
50+ # If it's from Hackage and we've already installed it, don't do it 50+ # If it's from Hackage and we've already installed it, don't do it
51+ # twice. That only wastes time. 51+ # twice. That only wastes time.
52+ stamp = sdist_dir / 'bootstrap-done' 52+ stamp = sdist_dir / 'bootstrap-done'
53+ if dep.source == PackageSource.LOCAL or not stamp.exists(): 53+ if dep.source == PackageSource.LOCAL or not stamp.exists():
54+ install_sdist(dist_dir, sdist_dir, ghc, flags, jobs) 54+ install_sdist(dist_dir, sdist_dir, ghc, flags, jobs)
55+ stamp.touch() 55+ stamp.touch()
56  56
57-def install_sdist(dist_dir: Path, sdist_dir: Path, ghc: Compiler, flags: List[str]): 57-def install_sdist(dist_dir: Path, sdist_dir: Path, ghc: Compiler, flags: List[str]):
58+def install_sdist(dist_dir: Path, sdist_dir: Path, ghc: Compiler, flags: List[str], jobs: int): 58+def install_sdist(dist_dir: Path, sdist_dir: Path, ghc: Compiler, flags: List[str], jobs: int):
59 prefix = PSEUDOSTORE.resolve() 59 prefix = PSEUDOSTORE.resolve()
60 flags_option = ' '.join(flags) 60 flags_option = ' '.join(flags)
61 setup_dist_dir = dist_dir / 'setup' 61 setup_dist_dir = dist_dir / 'setup'
62 setup = setup_dist_dir / 'Setup' 62 setup = setup_dist_dir / 'Setup'
63  63
64- build_args = [ 64- build_args = [
65+ common_args = [ 65+ common_args = [
66 f'--builddir={dist_dir}', 66 f'--builddir={dist_dir}',
67 ] 67 ]
68  68
69- configure_args = build_args + [ 69- configure_args = build_args + [
70+ configure_args = common_args + [ 70+ configure_args = common_args + [
71 f'--package-db={PKG_DB.resolve()}', 71 f'--package-db={PKG_DB.resolve()}',
72 f'--prefix={prefix}', 72 f'--prefix={prefix}',
73 f'--bindir={BINDIR.resolve()}', 73 f'--bindir={BINDIR.resolve()}',
74@@ -207,6 +226,12 @@ def install_sdist(dist_dir: Path, sdist_ 74@@ -207,6 +226,12 @@ def install_sdist(dist_dir: Path, sdist_
75 f'--flags={flags_option}', 75 f'--flags={flags_option}',
76 ] 76 ]
77  77
78+ build_args = common_args + [ 78+ build_args = common_args + [
79+ f'--jobs={jobs}', 79+ f'--jobs={jobs}',
80+ ] 80+ ]
81+ 81+
82+ install_args = common_args 82+ install_args = common_args
83+ 83+
84 def check_call(args: List[str]) -> None: 84 def check_call(args: List[str]) -> None:
85 subprocess_run(args, cwd=sdist_dir, check=True) 85 subprocess_run(args, cwd=sdist_dir, check=True)
86  86
87@@ -223,7 +248,7 @@ def install_sdist(dist_dir: Path, sdist_ 87@@ -223,7 +248,7 @@ def install_sdist(dist_dir: Path, sdist_
88 check_call([str(ghc.ghc_path), '--make', '-package-env=-', '-i', f'-odir={setup_dist_dir}', f'-hidir={setup_dist_dir}', '-o', setup, 'Setup']) 88 check_call([str(ghc.ghc_path), '--make', '-package-env=-', '-i', f'-odir={setup_dist_dir}', f'-hidir={setup_dist_dir}', '-o', setup, 'Setup'])
89 check_call([setup, 'configure'] + configure_args) 89 check_call([setup, 'configure'] + configure_args)
90 check_call([setup, 'build'] + build_args) 90 check_call([setup, 'build'] + build_args)
91- check_call([setup, 'install'] + build_args) 91- check_call([setup, 'install'] + build_args)
92+ check_call([setup, 'install'] + install_args) 92+ check_call([setup, 'install'] + install_args)
93  93
94 def hash_file(h, f: BinaryIO) -> SHA256Hash: 94 def hash_file(h, f: BinaryIO) -> SHA256Hash:
95 while True: 95 while True:
96@@ -238,7 +263,7 @@ def hash_file(h, f: BinaryIO) -> SHA256H 96@@ -238,7 +263,7 @@ def hash_file(h, f: BinaryIO) -> SHA256H
97 UnitId = NewType('UnitId', str) 97 UnitId = NewType('UnitId', str)
98 PlanUnit = NewType('PlanUnit', dict) 98 PlanUnit = NewType('PlanUnit', dict)
99  99
100-def bootstrap(info: BootstrapInfo, ghc: Compiler) -> None: 100-def bootstrap(info: BootstrapInfo, ghc: Compiler) -> None:
101+def bootstrap(info: BootstrapInfo, ghc: Compiler, jobs: int) -> None: 101+def bootstrap(info: BootstrapInfo, ghc: Compiler, jobs: int) -> None:
102 if not PKG_DB.exists(): 102 if not PKG_DB.exists():
103 print(f'Creating package database {PKG_DB}') 103 print(f'Creating package database {PKG_DB}')
104 PKG_DB.parent.mkdir(parents=True, exist_ok=True) 104 PKG_DB.parent.mkdir(parents=True, exist_ok=True)
105@@ -248,7 +273,7 @@ def bootstrap(info: BootstrapInfo, ghc:  105@@ -248,7 +273,7 @@ def bootstrap(info: BootstrapInfo, ghc:
106 check_builtin(dep, ghc) 106 check_builtin(dep, ghc)
107  107
108 for dep in info.dependencies: 108 for dep in info.dependencies:
109- install_dep(dep, ghc) 109- install_dep(dep, ghc)
110+ install_dep(dep, ghc, jobs) 110+ install_dep(dep, ghc, jobs)
111  111
112 # Steps 112 # Steps
113 ####################################################################### 113 #######################################################################
114@@ -374,6 +399,8 @@ def main() -> None: 114@@ -374,6 +399,8 @@ def main() -> None:
115 help='produce a Hadrian distribution archive (default)') 115 help='produce a Hadrian distribution archive (default)')
116 parser.add_argument('--no-archive', dest='want_archive', action='store_false', 116 parser.add_argument('--no-archive', dest='want_archive', action='store_false',
117 help='do not produce a Hadrian distribution archive') 117 help='do not produce a Hadrian distribution archive')
118+ parser.add_argument('-j', '--jobs', type=int, 118+ parser.add_argument('-j', '--jobs', type=int,
119+ help='the number of jobs to run simultaneously') 119+ help='the number of jobs to run simultaneously')
120 parser.set_defaults(want_archive=True) 120 parser.set_defaults(want_archive=True)
121  121
122 subparsers = parser.add_subparsers(dest="command") 122 subparsers = parser.add_subparsers(dest="command")
123@@ -480,7 +507,8 @@ Alternatively, you could use `bootstrap. 123@@ -480,7 +507,8 @@ Alternatively, you could use `bootstrap.
124 plan = gen_fetch_plan(info) 124 plan = gen_fetch_plan(info)
125 fetch_from_plan(plan, TARBALLS) 125 fetch_from_plan(plan, TARBALLS)
126  126
127- bootstrap(info, ghc) 127- bootstrap(info, ghc)
128+ bootstrap(info, ghc, args.jobs) 128+ bootstrap(info, ghc, args.jobs)
129+ return # Don't waste time by creating an archive. 129+ return # Don't waste time by creating an archive.
130 hadrian_path = (BINDIR / 'hadrian').resolve() 130 hadrian_path = (BINDIR / 'hadrian').resolve()
131  131
132 print(dedent(f''' 132 print(dedent(f'''