14 juliaExpression = packageNames: ''
16 Pkg.Registry.add(Pkg.RegistrySpec(path="${augmentedRegistry}"))
18 import Pkg.Types: Context, PackageSpec
20 input = ${lib.generators.toJSON { } packageNames}
22 if isfile("extra_package_names.txt")
23 append!(input, readlines("extra_package_names.txt"))
28 println("Resolving packages: " * join(input, " "))
30 pkgs = [PackageSpec(pkg) for pkg in input]
34 overrides = Dict{String, String}(${
35 builtins.concatStringsSep ", " (
36 lib.mapAttrsToList (name: path: ''"${name}" => "${path}"'') packageOverrides
39 ${builtins.readFile ./resolve_packages.jl}
41 open(ENV["out"], "w") do io
43 println(io, "- name: " * spec.name)
44 println(io, " uuid: " * string(spec.uuid))
45 println(io, " version: " * string(spec.version))
46 if endswith(spec.name, "_jll") && haskey(deps_map, spec.uuid)
47 println(io, " depends_on: ")
48 for (dep_name, dep_uuid) in pairs(deps_map[spec.uuid])
49 println(io, " \"$(dep_name)\": \"$(dep_uuid)\"")
57 runCommand "julia-package-closure.yml"
61 (python3.withPackages (ps: with ps; [ pyyaml ]))
66 export HOME=$(pwd)/home
68 echo "Resolving Julia packages with the following inputs"
69 echo "Julia: ${julia}"
70 echo "Registry: ${augmentedRegistry}"
72 # Prevent a warning where Julia tries to download package server info
73 export JULIA_PKG_SERVER=""
75 julia -e '${juliaExpression packageNames}';
77 # See if we need to add any extra package names based on the closure
78 # and the packageImplications
79 python ${./python}/find_package_implications.py "$out" '${
80 lib.generators.toJSON { } packageImplications
81 }' extra_package_names.txt
83 if [ -f extra_package_names.txt ]; then
84 echo "Re-resolving with additional package names"
85 julia -e '${juliaExpression packageNames}';