mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-06 04:03:04 +00:00
36bf6afd42
Be able to build arbitrary Julia environments in Nixpkgs, in the same style as python.withPackages.
25 lines
613 B
Python
25 lines
613 B
Python
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import sys
|
|
import yaml
|
|
|
|
dependencies_path = Path(sys.argv[1])
|
|
package_implications_json = sys.argv[2]
|
|
out_path = Path(sys.argv[3])
|
|
|
|
package_implications = json.loads(package_implications_json)
|
|
with open(dependencies_path) as f:
|
|
desired_packages = yaml.safe_load(f) or []
|
|
|
|
extra_package_names = []
|
|
for pkg in desired_packages:
|
|
if pkg["name"] in package_implications:
|
|
extra_package_names.extend(package_implications[pkg["name"]])
|
|
|
|
if len(extra_package_names) > 0:
|
|
with open(out_path, "w") as f:
|
|
f.write("\n".join(extra_package_names))
|