relenv 0.21.1__py3-none-any.whl → 0.22.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. relenv/__init__.py +14 -2
  2. relenv/__main__.py +12 -6
  3. relenv/_resources/xz/config.h +148 -0
  4. relenv/_resources/xz/readme.md +4 -0
  5. relenv/build/__init__.py +28 -30
  6. relenv/build/common/__init__.py +50 -0
  7. relenv/build/common/_sysconfigdata_template.py +72 -0
  8. relenv/build/common/builder.py +907 -0
  9. relenv/build/common/builders.py +163 -0
  10. relenv/build/common/download.py +324 -0
  11. relenv/build/common/install.py +609 -0
  12. relenv/build/common/ui.py +432 -0
  13. relenv/build/darwin.py +128 -14
  14. relenv/build/linux.py +296 -78
  15. relenv/build/windows.py +259 -44
  16. relenv/buildenv.py +48 -17
  17. relenv/check.py +10 -5
  18. relenv/common.py +499 -163
  19. relenv/create.py +147 -7
  20. relenv/fetch.py +16 -4
  21. relenv/manifest.py +15 -7
  22. relenv/python-versions.json +329 -0
  23. relenv/pyversions.py +817 -30
  24. relenv/relocate.py +101 -55
  25. relenv/runtime.py +452 -253
  26. relenv/toolchain.py +9 -3
  27. {relenv-0.21.1.dist-info → relenv-0.22.0.dist-info}/METADATA +1 -1
  28. relenv-0.22.0.dist-info/RECORD +48 -0
  29. tests/__init__.py +2 -0
  30. tests/_pytest_typing.py +45 -0
  31. tests/conftest.py +42 -36
  32. tests/test_build.py +426 -9
  33. tests/test_common.py +311 -48
  34. tests/test_create.py +149 -6
  35. tests/test_downloads.py +19 -15
  36. tests/test_fips_photon.py +6 -3
  37. tests/test_module_imports.py +44 -0
  38. tests/test_pyversions_runtime.py +177 -0
  39. tests/test_relocate.py +45 -39
  40. tests/test_relocate_module.py +257 -0
  41. tests/test_runtime.py +1802 -6
  42. tests/test_verify_build.py +500 -34
  43. relenv/build/common.py +0 -1609
  44. relenv-0.21.1.dist-info/RECORD +0 -35
  45. {relenv-0.21.1.dist-info → relenv-0.22.0.dist-info}/WHEEL +0 -0
  46. {relenv-0.21.1.dist-info → relenv-0.22.0.dist-info}/entry_points.txt +0 -0
  47. {relenv-0.21.1.dist-info → relenv-0.22.0.dist-info}/licenses/LICENSE.md +0 -0
  48. {relenv-0.21.1.dist-info → relenv-0.22.0.dist-info}/licenses/NOTICE +0 -0
  49. {relenv-0.21.1.dist-info → relenv-0.22.0.dist-info}/top_level.txt +0 -0
relenv/build/linux.py CHANGED
@@ -1,16 +1,39 @@
1
1
  # Copyright 2025 Broadcom.
2
2
  # SPDX-License-Identifier: Apache-2
3
+ # mypy: ignore-errors
3
4
  """
4
5
  The linux build process.
5
6
  """
7
+ from __future__ import annotations
8
+
9
+ import glob
10
+ import io
11
+ import os
6
12
  import pathlib
13
+ import shutil
14
+ import tarfile
7
15
  import tempfile
8
- from .common import *
9
- from ..common import arches, LINUX, Version
16
+ import time
17
+ import urllib.request
18
+ from typing import IO, MutableMapping
19
+
20
+ from .common import (
21
+ Dirs,
22
+ build_openssl,
23
+ build_openssl_fips,
24
+ build_sqlite,
25
+ builds,
26
+ finalize,
27
+ get_dependency_version,
28
+ update_sbom_checksums,
29
+ )
30
+ from ..common import LINUX, Version, arches, runcmd
10
31
 
11
32
 
12
33
  ARCHES = arches[LINUX]
13
34
 
35
+ EnvMapping = MutableMapping[str, str]
36
+
14
37
  # Patch for Python's setup.py
15
38
  PATCH = """--- ./setup.py
16
39
  +++ ./setup.py
@@ -25,7 +48,7 @@ PATCH = """--- ./setup.py
25
48
  """
26
49
 
27
50
 
28
- def populate_env(env, dirs):
51
+ def populate_env(env: EnvMapping, dirs: Dirs) -> None:
29
52
  """
30
53
  Make sure we have the correct environment variables set.
31
54
 
@@ -68,7 +91,7 @@ def populate_env(env, dirs):
68
91
  env["PKG_CONFIG_PATH"] = f"{dirs.prefix}/lib/pkgconfig"
69
92
 
70
93
 
71
- def build_bzip2(env, dirs, logfp):
94
+ def build_bzip2(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
72
95
  """
73
96
  Build bzip2.
74
97
 
@@ -112,7 +135,7 @@ def build_bzip2(env, dirs, logfp):
112
135
  shutil.copy2("libbz2.so.1.0.8", os.path.join(dirs.prefix, "lib"))
113
136
 
114
137
 
115
- def build_libxcrypt(env, dirs, logfp):
138
+ def build_libxcrypt(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
116
139
  """
117
140
  Build libxcrypt.
118
141
 
@@ -139,7 +162,7 @@ def build_libxcrypt(env, dirs, logfp):
139
162
  runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp)
140
163
 
141
164
 
142
- def build_gdbm(env, dirs, logfp):
165
+ def build_gdbm(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
143
166
  """
144
167
  Build gdbm.
145
168
 
@@ -166,7 +189,7 @@ def build_gdbm(env, dirs, logfp):
166
189
  runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp)
167
190
 
168
191
 
169
- def build_ncurses(env, dirs, logfp):
192
+ def build_ncurses(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
170
193
  """
171
194
  Build ncurses.
172
195
 
@@ -225,7 +248,7 @@ def build_ncurses(env, dirs, logfp):
225
248
  )
226
249
 
227
250
 
228
- def build_readline(env, dirs, logfp):
251
+ def build_readline(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
229
252
  """
230
253
  Build readline library.
231
254
 
@@ -251,7 +274,7 @@ def build_readline(env, dirs, logfp):
251
274
  runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp)
252
275
 
253
276
 
254
- def build_libffi(env, dirs, logfp):
277
+ def build_libffi(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
255
278
  """
256
279
  Build libffi.
257
280
 
@@ -282,7 +305,7 @@ def build_libffi(env, dirs, logfp):
282
305
  runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp)
283
306
 
284
307
 
285
- def build_zlib(env, dirs, logfp):
308
+ def build_zlib(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
286
309
  """
287
310
  Build zlib.
288
311
 
@@ -309,7 +332,7 @@ def build_zlib(env, dirs, logfp):
309
332
  runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp)
310
333
 
311
334
 
312
- def build_krb(env, dirs, logfp):
335
+ def build_krb(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
313
336
  """
314
337
  Build kerberos.
315
338
 
@@ -342,7 +365,66 @@ def build_krb(env, dirs, logfp):
342
365
  runcmd(["make", "install"], env=env, stderr=logfp, stdout=logfp)
343
366
 
344
367
 
345
- def build_python(env, dirs, logfp):
368
+ def update_expat(dirs: Dirs, env: EnvMapping) -> None:
369
+ """
370
+ Update the bundled expat library to the latest version.
371
+
372
+ Python ships with an older bundled expat. This function updates it
373
+ to the latest version for security and bug fixes.
374
+ """
375
+ # Get version from JSON
376
+ expat_info = get_dependency_version("expat", "linux")
377
+ if not expat_info:
378
+ # No update needed, use bundled version
379
+ return
380
+
381
+ version = expat_info["version"]
382
+ version_tag = version.replace(".", "_")
383
+ url = f"https://github.com/libexpat/libexpat/releases/download/R_{version_tag}/expat-{version}.tar.xz"
384
+
385
+ expat_dir = pathlib.Path(dirs.source) / "Modules" / "expat"
386
+ if not expat_dir.exists():
387
+ # No expat directory, skip
388
+ return
389
+
390
+ # Download expat tarball
391
+ tmpbuild = pathlib.Path(dirs.tmpbuild)
392
+ tarball_path = tmpbuild / f"expat-{version}.tar.xz"
393
+ urllib.request.urlretrieve(url, str(tarball_path))
394
+
395
+ # Extract tarball
396
+ with tarfile.open(tarball_path) as tar:
397
+ tar.extractall(path=str(tmpbuild))
398
+
399
+ # Copy source files to Modules/expat/
400
+ expat_source_dir = tmpbuild / f"expat-{version}" / "lib"
401
+ updated_files = []
402
+ for source_file in ["*.h", "*.c"]:
403
+ for file_path in glob.glob(str(expat_source_dir / source_file)):
404
+ target_file = expat_dir / pathlib.Path(file_path).name
405
+ # Remove old file if it exists
406
+ if target_file.exists():
407
+ target_file.unlink()
408
+ shutil.copy2(file_path, str(expat_dir))
409
+ updated_files.append(target_file)
410
+
411
+ # Touch all updated files to ensure make rebuilds them
412
+ # (The tarball may contain files with newer timestamps)
413
+ now = time.time()
414
+ for target_file in updated_files:
415
+ os.utime(target_file, (now, now))
416
+
417
+ # Update SBOM with correct checksums for updated expat files
418
+ files_to_update = {}
419
+ for target_file in updated_files:
420
+ # SBOM uses relative paths from Python source root
421
+ relative_path = f"Modules/expat/{target_file.name}"
422
+ files_to_update[relative_path] = target_file
423
+
424
+ update_sbom_checksums(dirs.source, files_to_update)
425
+
426
+
427
+ def build_python(env: EnvMapping, dirs: Dirs, logfp: IO[str]) -> None:
346
428
  """
347
429
  Run the commands to build Python.
348
430
 
@@ -353,6 +435,9 @@ def build_python(env, dirs, logfp):
353
435
  :param logfp: A handle for the log file
354
436
  :type logfp: file
355
437
  """
438
+ # Update bundled expat to latest version
439
+ update_expat(dirs, env)
440
+
356
441
  ldflagopt = f"-Wl,--rpath={dirs.prefix}/lib"
357
442
  if ldflagopt not in env["LDFLAGS"]:
358
443
  env["LDFLAGS"] = f"{ldflagopt} {env['LDFLAGS']}"
@@ -379,11 +464,11 @@ def build_python(env, dirs, logfp):
379
464
  )
380
465
 
381
466
  if pathlib.Path("setup.py").exists():
382
- with tempfile.NamedTemporaryFile(mode="w", suffix="_patch") as patch_file:
383
- patch_file.write(PATCH)
384
- patch_file.flush()
467
+ with tempfile.NamedTemporaryFile(mode="w", suffix="_patch") as p_file:
468
+ p_file.write(PATCH)
469
+ p_file.flush()
385
470
  runcmd(
386
- ["patch", "-p0", "-i", patch_file.name],
471
+ ["patch", "-p0", "-i", p_file.name],
387
472
  env=env,
388
473
  stderr=logfp,
389
474
  stdout=logfp,
@@ -477,167 +562,302 @@ def build_python(env, dirs, logfp):
477
562
 
478
563
  build = builds.add("linux", populate_env=populate_env)
479
564
 
565
+ # Get dependency versions from JSON (with fallback to hardcoded values)
566
+ openssl_info = get_dependency_version("openssl", "linux")
567
+ if openssl_info:
568
+ openssl_version = openssl_info["version"]
569
+ openssl_url = openssl_info["url"]
570
+ openssl_checksum = openssl_info["sha256"]
571
+ else:
572
+ # Fallback to hardcoded values
573
+ openssl_version = "3.5.4"
574
+ openssl_url = "https://github.com/openssl/openssl/releases/download/openssl-{version}/openssl-{version}.tar.gz"
575
+ openssl_checksum = "b75daac8e10f189abe28a076ba5905d363e4801f"
576
+
480
577
  build.add(
481
578
  "openssl",
482
579
  build_func=build_openssl,
483
580
  download={
484
- "url": "https://github.com/openssl/openssl/releases/download/openssl-{version}/openssl-{version}.tar.gz",
485
- "version": "3.5.4",
486
- "checksum": "b75daac8e10f189abe28a076ba5905d363e4801f",
487
- "checkfunc": tarball_version,
488
- "checkurl": "https://www.openssl.org/source/",
581
+ "url": openssl_url,
582
+ "version": openssl_version,
583
+ "checksum": openssl_checksum,
489
584
  },
490
585
  )
491
586
 
587
+ # If openssl-fips-module runs before openssl we get an error installing openssl
588
+ # becuase <prefix>/lib/ossl-modules exists.
492
589
  build.add(
493
590
  "openssl-fips-module",
494
- build_func=build_openssl_fips,
495
591
  wait_on=["openssl"],
592
+ build_func=build_openssl_fips,
496
593
  download={
497
594
  "url": "https://www.openssl.org/source/openssl-{version}.tar.gz",
498
595
  "version": "3.1.2",
499
596
  "checksum": "206036c21264e53f0196f715d81d905742e6245b",
500
- "checkfunc": tarball_version,
501
- "checkurl": "https://www.openssl.org/source/",
502
597
  },
503
598
  )
504
599
 
505
600
 
601
+ # Get libxcrypt version from JSON
602
+ libxcrypt_info = get_dependency_version("libxcrypt", "linux")
603
+ if libxcrypt_info:
604
+ libxcrypt_version = libxcrypt_info["version"]
605
+ libxcrypt_url = libxcrypt_info["url"]
606
+ libxcrypt_checksum = libxcrypt_info["sha256"]
607
+ else:
608
+ libxcrypt_version = "4.4.38"
609
+ libxcrypt_url = "https://github.com/besser82/libxcrypt/releases/download/v{version}/libxcrypt-{version}.tar.xz"
610
+ libxcrypt_checksum = "9aa2fa261be6144af492e9b6bfd03bfaa47f7159"
611
+
506
612
  build.add(
507
613
  "libxcrypt",
508
614
  download={
509
- "url": "https://github.com/besser82/libxcrypt/releases/download/v{version}/libxcrypt-{version}.tar.xz",
510
- "version": "4.4.38",
511
- "checksum": "9aa2fa261be6144af492e9b6bfd03bfaa47f7159",
512
- "checkfunc": github_version,
513
- "checkurl": "https://github.com/besser82/libxcrypt/releases/",
615
+ "url": libxcrypt_url,
616
+ "version": libxcrypt_version,
617
+ "checksum": libxcrypt_checksum,
514
618
  },
515
619
  )
516
620
 
621
+ # Get XZ version from JSON
622
+ xz_info = get_dependency_version("xz", "linux")
623
+ if xz_info:
624
+ xz_version = xz_info["version"]
625
+ xz_url = xz_info["url"]
626
+ xz_checksum = xz_info["sha256"]
627
+ else:
628
+ # Fallback to hardcoded values
629
+ xz_version = "5.8.1"
630
+ xz_url = "http://tukaani.org/xz/xz-{version}.tar.gz"
631
+ xz_checksum = "ed4d5589c4cfe84e1697bd02a9954b76af336931"
632
+
517
633
  build.add(
518
634
  "XZ",
519
635
  download={
520
- "url": "http://tukaani.org/xz/xz-{version}.tar.gz",
521
- "version": "5.8.1",
522
- "checksum": "ed4d5589c4cfe84e1697bd02a9954b76af336931",
523
- "checkfunc": tarball_version,
636
+ "url": xz_url,
637
+ "version": xz_version,
638
+ "checksum": xz_checksum,
524
639
  },
525
640
  )
526
641
 
642
+ # Get SQLite version from JSON
643
+ sqlite_info = get_dependency_version("sqlite", "linux")
644
+ if sqlite_info:
645
+ sqlite_url = sqlite_info["url"]
646
+ sqlite_checksum = sqlite_info["sha256"]
647
+ # SQLite uses a special 7-digit version number
648
+ sqlite_version_num = sqlite_info.get("sqliteversion", "3500400")
649
+ else:
650
+ # Fallback to hardcoded values
651
+ sqlite_version_num = "3500400"
652
+ sqlite_url = "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz"
653
+ sqlite_checksum = "145048005c777796dd8494aa1cfed304e8c34283"
654
+
527
655
  build.add(
528
656
  name="SQLite",
529
657
  build_func=build_sqlite,
530
658
  download={
531
- "url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz",
532
- "version": "3500400",
533
- "checksum": "145048005c777796dd8494aa1cfed304e8c34283",
534
- "checkfunc": sqlite_version,
535
- "checkurl": "https://sqlite.org/",
659
+ "url": sqlite_url,
660
+ "version": sqlite_version_num,
661
+ "checksum": sqlite_checksum,
536
662
  },
537
663
  )
538
664
 
665
+ # Get bzip2 version from JSON
666
+ bzip2_info = get_dependency_version("bzip2", "linux")
667
+ if bzip2_info:
668
+ bzip2_version = bzip2_info["version"]
669
+ bzip2_url = bzip2_info["url"]
670
+ bzip2_checksum = bzip2_info["sha256"]
671
+ else:
672
+ bzip2_version = "1.0.8"
673
+ bzip2_url = "https://sourceware.org/pub/bzip2/bzip2-{version}.tar.gz"
674
+ bzip2_checksum = "bf7badf7e248e0ecf465d33c2f5aeec774209227"
675
+
539
676
  build.add(
540
677
  name="bzip2",
541
678
  build_func=build_bzip2,
542
679
  download={
543
- "url": "https://sourceware.org/pub/bzip2/bzip2-{version}.tar.gz",
544
- "version": "1.0.8",
545
- "checksum": "bf7badf7e248e0ecf465d33c2f5aeec774209227",
546
- "checkfunc": tarball_version,
680
+ "url": bzip2_url,
681
+ "version": bzip2_version,
682
+ "checksum": bzip2_checksum,
547
683
  },
548
684
  )
549
685
 
686
+ # Get gdbm version from JSON
687
+ gdbm_info = get_dependency_version("gdbm", "linux")
688
+ if gdbm_info:
689
+ gdbm_version = gdbm_info["version"]
690
+ gdbm_url = gdbm_info["url"]
691
+ gdbm_checksum = gdbm_info["sha256"]
692
+ else:
693
+ gdbm_version = "1.26"
694
+ gdbm_url = "https://mirrors.ocf.berkeley.edu/gnu/gdbm/gdbm-{version}.tar.gz"
695
+ gdbm_checksum = "6cee3657de948e691e8df26509157be950cef4d4"
696
+
550
697
  build.add(
551
698
  name="gdbm",
552
699
  build_func=build_gdbm,
553
700
  download={
554
- "url": "https://mirrors.ocf.berkeley.edu/gnu/gdbm/gdbm-{version}.tar.gz",
555
- "version": "1.26",
556
- "checksum": "6cee3657de948e691e8df26509157be950cef4d4",
557
- "checkfunc": tarball_version,
701
+ "url": gdbm_url,
702
+ "version": gdbm_version,
703
+ "checksum": gdbm_checksum,
558
704
  },
559
705
  )
560
706
 
707
+ # Get ncurses version from JSON
708
+ ncurses_info = get_dependency_version("ncurses", "linux")
709
+ if ncurses_info:
710
+ ncurses_version = ncurses_info["version"]
711
+ ncurses_url = ncurses_info["url"]
712
+ ncurses_checksum = ncurses_info["sha256"]
713
+ else:
714
+ ncurses_version = "6.5"
715
+ ncurses_url = (
716
+ "https://mirrors.ocf.berkeley.edu/gnu/ncurses/ncurses-{version}.tar.gz"
717
+ )
718
+ ncurses_checksum = "cde3024ac3f9ef21eaed6f001476ea8fffcaa381"
719
+
561
720
  build.add(
562
721
  name="ncurses",
563
722
  build_func=build_ncurses,
564
723
  download={
565
- "url": "https://mirrors.ocf.berkeley.edu/gnu/ncurses/ncurses-{version}.tar.gz",
566
- "version": "6.5",
567
- "checksum": "cde3024ac3f9ef21eaed6f001476ea8fffcaa381",
568
- "checkfunc": tarball_version,
724
+ "url": ncurses_url,
725
+ "version": ncurses_version,
726
+ "checksum": ncurses_checksum,
569
727
  },
570
728
  )
571
729
 
730
+ # Get libffi version from JSON
731
+ libffi_info = get_dependency_version("libffi", "linux")
732
+ if libffi_info:
733
+ libffi_version = libffi_info["version"]
734
+ libffi_url = libffi_info["url"]
735
+ libffi_checksum = libffi_info["sha256"]
736
+ else:
737
+ libffi_version = "3.5.2"
738
+ libffi_url = "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz"
739
+ libffi_checksum = "2bd35b135b0eeb5c631e02422c9dbe786ddb626a"
740
+
572
741
  build.add(
573
742
  "libffi",
574
743
  build_libffi,
575
744
  download={
576
- "url": "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz",
577
- "version": "3.5.2",
578
- "checksum": "2bd35b135b0eeb5c631e02422c9dbe786ddb626a",
579
- "checkfunc": github_version,
580
- "checkurl": "https://github.com/libffi/libffi/releases/",
745
+ "url": libffi_url,
746
+ "version": libffi_version,
747
+ "checksum": libffi_checksum,
581
748
  },
582
749
  )
583
750
 
751
+ # Get zlib version from JSON
752
+ zlib_info = get_dependency_version("zlib", "linux")
753
+ if zlib_info:
754
+ zlib_version = zlib_info["version"]
755
+ zlib_url = zlib_info["url"]
756
+ zlib_checksum = zlib_info["sha256"]
757
+ else:
758
+ zlib_version = "1.3.1"
759
+ zlib_url = "https://zlib.net/fossils/zlib-{version}.tar.gz"
760
+ zlib_checksum = "f535367b1a11e2f9ac3bec723fb007fbc0d189e5"
761
+
584
762
  build.add(
585
763
  "zlib",
586
764
  build_zlib,
587
765
  download={
588
- "url": "https://zlib.net/fossils/zlib-{version}.tar.gz",
589
- "version": "1.3.1",
590
- "checksum": "f535367b1a11e2f9ac3bec723fb007fbc0d189e5",
591
- "checkfunc": tarball_version,
766
+ "url": zlib_url,
767
+ "version": zlib_version,
768
+ "checksum": zlib_checksum,
592
769
  },
593
770
  )
594
771
 
772
+ # Get uuid version from JSON
773
+ uuid_info = get_dependency_version("uuid", "linux")
774
+ if uuid_info:
775
+ uuid_ver = uuid_info["version"]
776
+ uuid_url = uuid_info["url"]
777
+ uuid_checksum = uuid_info["sha256"]
778
+ else:
779
+ uuid_ver = "1.0.3"
780
+ uuid_url = "https://sourceforge.net/projects/libuuid/files/libuuid-{version}.tar.gz"
781
+ uuid_checksum = "46eaedb875ae6e63677b51ec583656199241d597"
782
+
595
783
  build.add(
596
784
  "uuid",
597
785
  download={
598
- "url": "https://sourceforge.net/projects/libuuid/files/libuuid-{version}.tar.gz",
599
- "version": "1.0.3",
600
- "checksum": "46eaedb875ae6e63677b51ec583656199241d597",
601
- "checkfunc": uuid_version,
786
+ "url": uuid_url,
787
+ "version": uuid_ver,
788
+ "checksum": uuid_checksum,
602
789
  },
603
790
  )
604
791
 
792
+ # Get krb5 version from JSON
793
+ krb5_info = get_dependency_version("krb5", "linux")
794
+ if krb5_info:
795
+ krb5_version = krb5_info["version"]
796
+ krb5_url = krb5_info["url"]
797
+ krb5_checksum = krb5_info["sha256"]
798
+ else:
799
+ krb5_version = "1.22"
800
+ krb5_url = "https://kerberos.org/dist/krb5/{version}/krb5-{version}.tar.gz"
801
+ krb5_checksum = "3ad930ab036a8dc3678356fbb9de9246567e7984"
802
+
605
803
  build.add(
606
804
  "krb5",
607
805
  build_func=build_krb,
608
806
  wait_on=["openssl"],
609
807
  download={
610
- "url": "https://kerberos.org/dist/krb5/{version}/krb5-{version}.tar.gz",
611
- "version": "1.22",
612
- "checksum": "3ad930ab036a8dc3678356fbb9de9246567e7984",
613
- "checkfunc": krb_version,
614
- "checkurl": "https://kerberos.org/dist/krb5/",
808
+ "url": krb5_url,
809
+ "version": krb5_version,
810
+ "checksum": krb5_checksum,
615
811
  },
616
812
  )
617
813
 
814
+ # Get readline version from JSON
815
+ readline_info = get_dependency_version("readline", "linux")
816
+ if readline_info:
817
+ readline_version = readline_info["version"]
818
+ readline_url = readline_info["url"]
819
+ readline_checksum = readline_info["sha256"]
820
+ else:
821
+ readline_version = "8.3"
822
+ readline_url = (
823
+ "https://mirrors.ocf.berkeley.edu/gnu/readline/readline-{version}.tar.gz"
824
+ )
825
+ readline_checksum = "2c05ae9350b695f69d70b47f17f092611de2081f"
826
+
618
827
  build.add(
619
828
  "readline",
620
829
  build_func=build_readline,
621
830
  wait_on=["ncurses"],
622
831
  download={
623
- "url": "https://mirrors.ocf.berkeley.edu/gnu/readline/readline-{version}.tar.gz",
624
- "version": "8.3",
625
- "checksum": "2c05ae9350b695f69d70b47f17f092611de2081f",
626
- "checkfunc": tarball_version,
832
+ "url": readline_url,
833
+ "version": readline_version,
834
+ "checksum": readline_checksum,
627
835
  },
628
836
  )
629
837
 
838
+ # Get tirpc version from JSON
839
+ tirpc_info = get_dependency_version("tirpc", "linux")
840
+ if tirpc_info:
841
+ tirpc_version = tirpc_info["version"]
842
+ tirpc_url = tirpc_info["url"]
843
+ tirpc_checksum = tirpc_info["sha256"]
844
+ else:
845
+ tirpc_version = "1.3.4"
846
+ tirpc_url = (
847
+ "https://sourceforge.net/projects/libtirpc/files/libtirpc-{version}.tar.bz2"
848
+ )
849
+ tirpc_checksum = "63c800f81f823254d2706637bab551dec176b99b"
850
+
630
851
  build.add(
631
852
  "tirpc",
632
853
  wait_on=[
633
854
  "krb5",
634
855
  ],
635
856
  download={
636
- "url": "https://sourceforge.net/projects/libtirpc/files/libtirpc-{version}.tar.bz2",
857
+ "url": tirpc_url,
637
858
  # "url": "https://downloads.sourceforge.net/projects/libtirpc/files/libtirpc-{version}.tar.bz2",
638
- "version": "1.3.4",
639
- "checksum": "63c800f81f823254d2706637bab551dec176b99b",
640
- "checkfunc": tarball_version,
859
+ "version": tirpc_version,
860
+ "checksum": tirpc_checksum,
641
861
  },
642
862
  )
643
863
 
@@ -663,8 +883,6 @@ build.add(
663
883
  "url": "https://www.python.org/ftp/python/{version}/Python-{version}.tar.xz",
664
884
  "version": build.version,
665
885
  "checksum": "d31d548cd2c5ca2ae713bebe346ba15e8406633a",
666
- "checkfunc": python_version,
667
- "checkurl": "https://www.python.org/ftp/python/",
668
886
  },
669
887
  )
670
888