Change environmental arguments to positional

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2024-09-30 12:55:20 +08:00
parent b12ca4b928
commit 5e71c2d899
1 changed files with 9 additions and 7 deletions

View File

@ -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 --sync --print-format "%l %n" mingw-w64-clang-x86_64-qt-installer-framework > $MSYS2DIR/qt_ifw_packages.txt
function generate_nix_packages_from_pacman() { function generate_nix_packages_from_pacman() {
echo "{ pkgs } : [" > $OUT local in=$1
local out=$2
echo "{ pkgs } : [" > $out
while IFS= read -r line; do while IFS= read -r line; do
read -r url package <<< "$line" read -r url package <<< "$line"
hash=$(nix-prefetch-url $url --name $package) hash=$(nix-prefetch-url $url --name $package)
@ -33,11 +35,11 @@ function generate_nix_packages_from_pacman() {
url = \"$url\"; url = \"$url\";
name = \"$package\"; name = \"$package\";
sha256 = \"$hash\"; sha256 = \"$hash\";
})" >> $OUT })" >> $out
done < $IN done < $in
echo "]" >> $OUT echo "]" >> $out
} }
IN=$MSYS2DIR/packages.txt OUT=msys2_packages.nix generate_nix_packages_from_pacman generate_nix_packages_from_pacman $MSYS2DIR/packages.txt msys2_packages.nix
IN=$MSYS2DIR/qt_ifw_packages.txt OUT=msys2_qt_ifw_packages.nix generate_nix_packages_from_pacman generate_nix_packages_from_pacman $MSYS2DIR/qt_ifw_packages.txt msys2_qt_ifw_packages.nix
IN=$MSYS2DIR/artiq_dependency_packages.txt OUT=artiq_dependency_packages.nix generate_nix_packages_from_pacman generate_nix_packages_from_pacman $MSYS2DIR/artiq_dependency_packages.txt artiq_dependency_packages.nix