mirror of
https://github.com/wentasah/ros2nix.git
synced 2025-06-09 15:52:23 +03:00
Always prefix package.nix path with ./ in overlay.nix
Without this, nixified package in the current directory fails to evaluate with "error: undefined variable 'package'".
This commit is contained in:
parent
dc2eef69c1
commit
a78551449b
2 changed files with 9 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
# PYTHON_ARGCOMPLETE_OK
|
# PYTHON_ARGCOMPLETE_OK
|
||||||
|
|
||||||
# Copyright 2019-2024 Ben Wolsieffer <benwolsieffer@gmail.com>
|
# Copyright 2019-2024 Ben Wolsieffer <benwolsieffer@gmail.com>
|
||||||
# Copyright 2024 Michal Sojka <michal.sojka@cvut.cz>
|
# Copyright 2024, 2025 Michal Sojka <michal.sojka@cvut.cz>
|
||||||
|
|
||||||
from os.path import dirname
|
from os.path import dirname
|
||||||
import argcomplete, argparse
|
import argcomplete, argparse
|
||||||
|
@ -105,9 +105,9 @@ def generate_overlay(expressions: dict[str, str], args):
|
||||||
expr = (
|
expr = (
|
||||||
expressions[pkg]
|
expressions[pkg]
|
||||||
if args.output_dir is None
|
if args.output_dir is None
|
||||||
else f"./{os.path.basename(expressions[pkg])}"
|
else os.path.basename(expressions[pkg])
|
||||||
)
|
)
|
||||||
print(f" {pkg} = final.callPackage {expr} {{}};", file=f)
|
print(f" {pkg} = final.callPackage ./{expr} {{}};", file=f)
|
||||||
print("}", file=f)
|
print("}", file=f)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,12 @@ load common.bash
|
||||||
nix-build -A rosPackages.humble.ros-node -A rosPackages.jazzy.ros-node -A rosPackages.rolling.ros-node
|
nix-build -A rosPackages.humble.ros-node -A rosPackages.jazzy.ros-node -A rosPackages.rolling.ros-node
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "nixify package in the current directory" {
|
||||||
|
cd ws/src/library
|
||||||
|
ros2nix package.xml
|
||||||
|
nix-build -A rosPackages.jazzy.library
|
||||||
|
}
|
||||||
|
|
||||||
@test "--output-as-nix-pkg-name" {
|
@test "--output-as-nix-pkg-name" {
|
||||||
ros2nix --output-as-nix-pkg-name $(find ws/src -name package.xml)
|
ros2nix --output-as-nix-pkg-name $(find ws/src -name package.xml)
|
||||||
assert [ -f ros-node.nix ]
|
assert [ -f ros-node.nix ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue