Use packages.json for intel packages instead of awk script
This commit is contained in:
parent
1430ae7ceb
commit
3ed5463c25
@ -35,35 +35,18 @@ let
|
|||||||
mpi = "2021.9.0";
|
mpi = "2021.9.0";
|
||||||
};
|
};
|
||||||
|
|
||||||
aptPackageIndex = stdenv.mkDerivation {
|
|
||||||
name = "intel-oneapi-packages";
|
|
||||||
srcs = [
|
|
||||||
# Run update.sh to update the package lists
|
|
||||||
./amd64-packages ./all-packages
|
|
||||||
];
|
|
||||||
phases = [ "installPhase" ];
|
|
||||||
installPhase = ''
|
|
||||||
awk -F': ' '\
|
|
||||||
BEGIN { print "[ {" } \
|
|
||||||
NF==0 { empty=1; } \
|
|
||||||
NF && empty { print "} {"; empty=0; } \
|
|
||||||
/: / { printf "%s = \"%s\";\n", $1, $2 } \
|
|
||||||
END { print "} ]" }' $srcs > $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
findMatch = name:
|
findMatch = name:
|
||||||
let
|
let
|
||||||
aptPackages = import aptPackageIndex;
|
aptPackages = builtins.fromJSON (builtins.readFile ./packages.json);
|
||||||
matches = lib.filter (x: name == x.Package) aptPackages;
|
matches = lib.filter (x: name == x.pname) aptPackages;
|
||||||
n = lib.length matches;
|
n = lib.length matches;
|
||||||
match = builtins.traceVerbose (name + " -- ${builtins.toString n}") (builtins.head matches);
|
match = builtins.traceVerbose (name + " -- ${builtins.toString n}") (builtins.head matches);
|
||||||
|
|
||||||
apthost = "https://apt.repos.intel.com/oneapi/";
|
apthost = "https://apt.repos.intel.com/oneapi/";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
url = apthost + match.Filename;
|
url = apthost + match.filename;
|
||||||
sha256 = match.SHA256;
|
sha256 = match.sha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
uncompressDebs = debs: name: stdenv.mkDerivation {
|
uncompressDebs = debs: name: stdenv.mkDerivation {
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user