uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
56
pkgs/development/python-modules/torchaudio/bin.nix
Normal file
56
pkgs/development/python-modules/torchaudio/bin.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildPythonPackage
|
||||
, fetchurl
|
||||
, isPy37
|
||||
, isPy38
|
||||
, isPy39
|
||||
, isPy310
|
||||
, python
|
||||
, pytorch-bin
|
||||
, pythonOlder
|
||||
, pythonAtLeast
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "torchaudio";
|
||||
version = "0.11.0";
|
||||
format = "wheel";
|
||||
|
||||
src =
|
||||
let pyVerNoDot = lib.replaceStrings [ "." ] [ "" ] python.pythonVersion;
|
||||
unsupported = throw "Unsupported system";
|
||||
srcs = (import ./binary-hashes.nix version)."${stdenv.system}-${pyVerNoDot}" or unsupported;
|
||||
in fetchurl srcs;
|
||||
|
||||
disabled = !(isPy37 || isPy38 || isPy39 || isPy310);
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pytorch-bin
|
||||
];
|
||||
|
||||
# The wheel-binary is not stripped to avoid the error of `ImportError: libtorch_cuda_cpp.so: ELF load command address/offset not properly aligned.`.
|
||||
dontStrip = true;
|
||||
|
||||
pythonImportsCheck = [ "torchaudio" ];
|
||||
|
||||
postFixup = ''
|
||||
# Note: after patchelf'ing, libcudart can still not be found. However, this should
|
||||
# not be an issue, because PyTorch is loaded before torchvision and brings
|
||||
# in the necessary symbols.
|
||||
patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:${pytorch-bin}/${python.sitePackages}/torch/lib:" \
|
||||
"$out/${python.sitePackages}/torchaudio/_torchaudio.so"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "PyTorch audio library";
|
||||
homepage = "https://pytorch.org/";
|
||||
changelog = "https://github.com/pytorch/audio/releases/tag/v${version}";
|
||||
# Includes CUDA and Intel MKL, but redistributions of the binary are not limited.
|
||||
# https://docs.nvidia.com/cuda/eula/index.html
|
||||
# https://www.intel.com/content/www/us/en/developer/articles/license/onemkl-license-faq.html
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ junjihashimoto ];
|
||||
};
|
||||
}
|
||||
66
pkgs/development/python-modules/torchaudio/binary-hashes.nix
Normal file
66
pkgs/development/python-modules/torchaudio/binary-hashes.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# Warning: Need to update at the same time as pytorch-bin
|
||||
#
|
||||
# Precompiled wheels can be found at:
|
||||
# https://download.pytorch.org/whl/torch_stable.html
|
||||
|
||||
# To add a new version, run "prefetch.sh 'new-version'" to paste the generated file as follows.
|
||||
|
||||
version : builtins.getAttr version {
|
||||
"0.11.0" = {
|
||||
x86_64-linux-37 = {
|
||||
name = "torchaudio-0.11.0-cp37-cp37m-linux_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp37-cp37m-linux_x86_64.whl";
|
||||
hash = "sha256-AdqgntXh2rTD7rBePshFAQ2tVl7b+734wG4r471/Y2U=";
|
||||
};
|
||||
x86_64-linux-38 = {
|
||||
name = "torchaudio-0.11.0-cp38-cp38-linux_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp38-cp38-linux_x86_64.whl";
|
||||
hash = "sha256-zuCHDpz3bkOUjYWprqX9VXoUbXfR8Vhdf1VFfOUg8z4=";
|
||||
};
|
||||
x86_64-linux-39 = {
|
||||
name = "torchaudio-0.11.0-cp39-cp39-linux_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp39-cp39-linux_x86_64.whl";
|
||||
hash = "sha256-btI9TpsOjeLnIz6J56avNv4poJTpXjjhDbMy6+ZFQvI=";
|
||||
};
|
||||
x86_64-linux-310 = {
|
||||
name = "torchaudio-0.11.0-cp310-cp310-linux_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/cu113/torchaudio-0.11.0%2Bcu113-cp310-cp310-linux_x86_64.whl";
|
||||
hash = "sha256-Zk+AWytEXfJ+HM69BAPhVsvN6pgQwC6uaW7Xux2row4=";
|
||||
};
|
||||
x86_64-darwin-37 = {
|
||||
name = "torchaudio-0.11.0-cp37-cp37m-macosx_10_15_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp37-cp37m-macosx_10_15_x86_64.whl";
|
||||
hash = "sha256-uaTT4athEWHAZe0hBoBIM/9LhfZNhAIexZBGg2MWn50=";
|
||||
};
|
||||
x86_64-darwin-38 = {
|
||||
name = "torchaudio-0.11.0-cp38-cp38-macosx_10_15_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp38-cp38-macosx_10_15_x86_64.whl";
|
||||
hash = "sha256-9OndqejTzgu9XnkZJiGfUFS4uFNlx5vi7pAzOs+a2/w=";
|
||||
};
|
||||
x86_64-darwin-39 = {
|
||||
name = "torchaudio-0.11.0-cp39-cp39-macosx_10_15_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp39-cp39-macosx_10_15_x86_64.whl";
|
||||
hash = "sha256-cNi8B/J3YI0jqaoI2z+68DVmAlS8EtmzYWQMRVZ3dVk=";
|
||||
};
|
||||
x86_64-darwin-310 = {
|
||||
name = "torchaudio-0.11.0-cp310-cp310-macosx_10_15_x86_64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp310-cp310-macosx_10_15_x86_64.whl";
|
||||
hash = "sha256-g2Pj2wqK9YIP19O/g5agryPcgiHJqdS2Di44mAVJKUQ=";
|
||||
};
|
||||
aarch64-darwin-38 = {
|
||||
name = "torchaudio-0.11.0-cp38-cp38-macosx_11_0_arm64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp38-cp38-macosx_11_0_arm64.whl";
|
||||
hash = "sha256-MX/Y7Dn92zrx2tkGWTuezcPt9o5/V4DEL43pVlha5IA=";
|
||||
};
|
||||
aarch64-darwin-39 = {
|
||||
name = "torchaudio-0.11.0-cp39-cp39-macosx_11_0_arm64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp39-cp39-macosx_11_0_arm64.whl";
|
||||
hash = "sha256-5eVRP83VeHAGGWW++/B2V4eyX0mcPgC1j02ETkQYMXc=";
|
||||
};
|
||||
aarch64-darwin-310 = {
|
||||
name = "torchaudio-0.11.0-cp310-cp310-macosx_11_0_arm64.whl";
|
||||
url = "https://download.pytorch.org/whl/torchaudio-0.11.0-cp310-cp310-macosx_11_0_arm64.whl";
|
||||
hash = "sha256-06OyzOuV8E7ZNtozvFO9Zm2rBxWnnbM65HGYUiQdwtI=";
|
||||
};
|
||||
};
|
||||
}
|
||||
46
pkgs/development/python-modules/torchaudio/prefetch.sh
Executable file
46
pkgs/development/python-modules/torchaudio/prefetch.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p nix-prefetch-scripts
|
||||
|
||||
set -eou pipefail
|
||||
|
||||
version=$1
|
||||
|
||||
linux_bucket="https://download.pytorch.org/whl/cu113"
|
||||
darwin_bucket="https://download.pytorch.org/whl"
|
||||
|
||||
url_and_key_list=(
|
||||
"x86_64-linux-37 $linux_bucket/torchaudio-${version}%2Bcu113-cp37-cp37m-linux_x86_64.whl torchaudio-${version}-cp37-cp37m-linux_x86_64.whl"
|
||||
"x86_64-linux-38 $linux_bucket/torchaudio-${version}%2Bcu113-cp38-cp38-linux_x86_64.whl torchaudio-${version}-cp38-cp38-linux_x86_64.whl"
|
||||
"x86_64-linux-39 $linux_bucket/torchaudio-${version}%2Bcu113-cp39-cp39-linux_x86_64.whl torchaudio-${version}-cp39-cp39-linux_x86_64.whl"
|
||||
"x86_64-linux-310 $linux_bucket/torchaudio-${version}%2Bcu113-cp310-cp310-linux_x86_64.whl torchaudio-${version}-cp310-cp310-linux_x86_64.whl"
|
||||
"x86_64-darwin-37 $darwin_bucket/torchaudio-${version}-cp37-cp37m-macosx_10_15_x86_64.whl torchaudio-${version}-cp37-cp37m-macosx_10_15_x86_64.whl"
|
||||
"x86_64-darwin-38 $darwin_bucket/torchaudio-${version}-cp38-cp38-macosx_10_15_x86_64.whl torchaudio-${version}-cp38-cp38-macosx_10_15_x86_64.whl"
|
||||
"x86_64-darwin-39 $darwin_bucket/torchaudio-${version}-cp39-cp39-macosx_10_15_x86_64.whl torchaudio-${version}-cp39-cp39-macosx_10_15_x86_64.whl"
|
||||
"x86_64-darwin-310 $darwin_bucket/torchaudio-${version}-cp310-cp310-macosx_10_15_x86_64.whl torchaudio-${version}-cp310-cp310-macosx_10_15_x86_64.whl"
|
||||
"aarch64-darwin-38 $darwin_bucket/torchaudio-${version}-cp38-cp38-macosx_11_0_arm64.whl torchaudio-${version}-cp38-cp38-macosx_11_0_arm64.whl"
|
||||
"aarch64-darwin-39 $darwin_bucket/torchaudio-${version}-cp39-cp39-macosx_11_0_arm64.whl torchaudio-${version}-cp39-cp39-macosx_11_0_arm64.whl"
|
||||
"aarch64-darwin-310 $darwin_bucket/torchaudio-${version}-cp310-cp310-macosx_11_0_arm64.whl torchaudio-${version}-cp310-cp310-macosx_11_0_arm64.whl"
|
||||
)
|
||||
|
||||
hashfile=binary-hashes-"$version".nix
|
||||
echo " \"$version\" = {" >> $hashfile
|
||||
|
||||
for url_and_key in "${url_and_key_list[@]}"; do
|
||||
key=$(echo "$url_and_key" | cut -d' ' -f1)
|
||||
url=$(echo "$url_and_key" | cut -d' ' -f2)
|
||||
name=$(echo "$url_and_key" | cut -d' ' -f3)
|
||||
|
||||
echo "prefetching ${url}..."
|
||||
hash=$(nix hash to-sri --type sha256 `nix-prefetch-url "$url" --name "$name"`)
|
||||
|
||||
echo " $key = {" >> $hashfile
|
||||
echo " name = \"$name\";" >> $hashfile
|
||||
echo " url = \"$url\";" >> $hashfile
|
||||
echo " hash = \"$hash\";" >> $hashfile
|
||||
echo " };" >> $hashfile
|
||||
|
||||
echo
|
||||
done
|
||||
|
||||
echo " };" >> $hashfile
|
||||
echo "done."
|
||||
Loading…
Add table
Add a link
Reference in a new issue