forked from M-Labs/artiq-extrapkg
Change environment variables to positional arguments
Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
parent
b12ca4b928
commit
f0e2486d6c
@ -24,7 +24,9 @@ pacman --root $MSYS2DIR --config $MSYS2DIR/etc/pacman.conf --cachedir $MSYS2DIR/
|
||||
--sync --print-format "%l %n" mingw-w64-clang-x86_64-qt-installer-framework > $MSYS2DIR/qt_ifw_packages.txt
|
||||
|
||||
function generate_nix_packages_from_pacman() {
|
||||
echo "{ pkgs } : [" > $OUT
|
||||
local in=$1
|
||||
local out=$2
|
||||
echo "{ pkgs } : [" > $out
|
||||
while IFS= read -r line; do
|
||||
read -r url package <<< "$line"
|
||||
hash=$(nix-prefetch-url $url --name $package)
|
||||
@ -33,11 +35,11 @@ function generate_nix_packages_from_pacman() {
|
||||
url = \"$url\";
|
||||
name = \"$package\";
|
||||
sha256 = \"$hash\";
|
||||
})" >> $OUT
|
||||
done < $IN
|
||||
echo "]" >> $OUT
|
||||
})" >> $out
|
||||
done < $in
|
||||
echo "]" >> $out
|
||||
}
|
||||
|
||||
IN=$MSYS2DIR/packages.txt OUT=msys2_packages.nix generate_nix_packages_from_pacman
|
||||
IN=$MSYS2DIR/qt_ifw_packages.txt OUT=msys2_qt_ifw_packages.nix generate_nix_packages_from_pacman
|
||||
IN=$MSYS2DIR/artiq_dependency_packages.txt OUT=artiq_dependency_packages.nix generate_nix_packages_from_pacman
|
||||
generate_nix_packages_from_pacman $MSYS2DIR/packages.txt msys2_packages.nix
|
||||
generate_nix_packages_from_pacman $MSYS2DIR/qt_ifw_packages.txt msys2_qt_ifw_packages.nix
|
||||
generate_nix_packages_from_pacman $MSYS2DIR/artiq_dependency_packages.txt artiq_dependency_packages.nix
|
||||
|
Loading…
Reference in New Issue
Block a user