Merge pull request #32365 from vcunat/p/check-meta

check meta, treewide

authored by Graham Christensen and committed by GitHub e5629dc5 3cad1abf

+42 -30
+1 -1
pkgs/applications/graphics/unigine-valley/default.nix
··· 22 else if stdenv.system == "i686-linux" then 23 "x86" 24 else 25 - abort "Unsupported platform"; 26 27 in 28 stdenv.mkDerivation rec {
··· 22 else if stdenv.system == "i686-linux" then 23 "x86" 24 else 25 + throw "Unsupported platform ${stdenv.system}"; 26 27 in 28 stdenv.mkDerivation rec {
+1 -1
pkgs/applications/misc/googleearth/default.nix
··· 6 arch = 7 if stdenv.system == "x86_64-linux" then "amd64" 8 else if stdenv.system == "i686-linux" then "i386" 9 - else abort "Unsupported architecture"; 10 sha256 = 11 if arch == "amd64" 12 then "0dwnppn5snl5bwkdrgj4cyylnhngi0g66fn2k41j3dvis83x24k6"
··· 6 arch = 7 if stdenv.system == "x86_64-linux" then "amd64" 8 else if stdenv.system == "i686-linux" then "i386" 9 + else throw "Unsupported system ${stdenv.system}"; 10 sha256 = 11 if arch == "amd64" 12 then "0dwnppn5snl5bwkdrgj4cyylnhngi0g66fn2k41j3dvis83x24k6"
+1 -1
pkgs/applications/misc/playonlinux/default.nix
··· 48 ld32 = 49 if stdenv.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32" 50 else if stdenv.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker" 51 - else abort "Unsupported platform for PlayOnLinux: ${stdenv.system}"; 52 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 53 libs = pkgs: stdenv.lib.makeLibraryPath [ pkgs.xlibs.libX11 ]; 54
··· 48 ld32 = 49 if stdenv.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32" 50 else if stdenv.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker" 51 + else throw "Unsupported platform for PlayOnLinux: ${stdenv.system}"; 52 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 53 libs = pkgs: stdenv.lib.makeLibraryPath [ pkgs.xlibs.libX11 ]; 54
+3 -2
pkgs/applications/networking/bittorrentsync/generic.nix
··· 4 arch = { 5 "x86_64-linux" = "x64"; 6 "i686-linux" = "i386"; 7 - }.${stdenv.system}; 8 libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 9 in 10 11 stdenv.mkDerivation rec { ··· 19 "https://download-cdn.getsync.com/${version}/linux-${arch}/BitTorrent-Sync_${arch}.tar.gz" 20 "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz" 21 ]; 22 - sha256 = sha256s.${stdenv.system}; 23 }; 24 25 dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
··· 4 arch = { 5 "x86_64-linux" = "x64"; 6 "i686-linux" = "i386"; 7 + }.${stdenv.system} or throwSystem; 8 libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 9 + throwSystem = throw "Unsupported system: ${stdenv.system}"; 10 in 11 12 stdenv.mkDerivation rec { ··· 20 "https://download-cdn.getsync.com/${version}/linux-${arch}/BitTorrent-Sync_${arch}.tar.gz" 21 "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz" 22 ]; 23 + sha256 = sha256s.${stdenv.system} or throwSystem; 24 }; 25 26 dontStrip = true; # Don't strip, otherwise patching the rpaths breaks
+1 -1
pkgs/applications/networking/remote/teamviewer/default.nix
··· 4 ld32 = 5 if stdenv.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker" 6 else if stdenv.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32" 7 - else abort "Unsupported architecture"; 8 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 9 10 mkLdPath = ps: lib.makeLibraryPath (with ps; [ qt4 dbus alsaLib ]);
··· 4 ld32 = 5 if stdenv.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker" 6 else if stdenv.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32" 7 + else throw "Unsupported system ${stdenv.system}"; 8 ld64 = "${stdenv.cc}/nix-support/dynamic-linker"; 9 10 mkLdPath = ps: lib.makeLibraryPath (with ps; [ qt4 dbus alsaLib ]);
+1 -1
pkgs/applications/networking/resilio-sync/default.nix
··· 4 arch = { 5 "x86_64-linux" = "x64"; 6 "i686-linux" = "i386"; 7 - }.${stdenv.system}; 8 libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 9 10 in stdenv.mkDerivation rec {
··· 4 arch = { 5 "x86_64-linux" = "x64"; 6 "i686-linux" = "i386"; 7 + }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); 8 libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc ]; 9 10 in stdenv.mkDerivation rec {
+4 -2
pkgs/build-support/rust/cargo-vendor.nix
··· 8 x86_64-linux = "1hxlavcxy374yypfamlkygjg662lhll8j434qcvdawkvlidg5ii5"; 9 x86_64-darwin = "1jkvhh710gwjnnjx59kaplx2ncfvkx9agfa76rr94sbjqq4igddm"; 10 }; 11 - hash = hashes. ${system} or (throw "missing bootstrap hash for platform ${system}"); 12 13 platforms = { 14 x86_64-linux = "x86_64-unknown-linux-musl"; 15 x86_64-darwin = "x86_64-apple-darwin"; 16 }; 17 - platform = platforms . ${system}; 18 19 in stdenv.mkDerivation { 20 name = "cargo-vendor-${version}";
··· 8 x86_64-linux = "1hxlavcxy374yypfamlkygjg662lhll8j434qcvdawkvlidg5ii5"; 9 x86_64-darwin = "1jkvhh710gwjnnjx59kaplx2ncfvkx9agfa76rr94sbjqq4igddm"; 10 }; 11 + hash = hashes. ${system} or badSystem; 12 + 13 + badSystem = throw "missing bootstrap hash for platform ${system}"; 14 15 platforms = { 16 x86_64-linux = "x86_64-unknown-linux-musl"; 17 x86_64-darwin = "x86_64-apple-darwin"; 18 }; 19 + platform = platforms . ${system} or badSystem; 20 21 in stdenv.mkDerivation { 22 name = "cargo-vendor-${version}";
+1 -1
pkgs/development/compilers/jetbrains-jdk/default.nix
··· 16 sha256 = "1768f02i3dxdbxn8n29d522h8v0mkgnhpb8ixzq5p54vwjmfl6md"; 17 } 18 else 19 - abort "unsupported system: ${stdenv.system}"; 20 21 nativeBuildInputs = [ file ]; 22
··· 16 sha256 = "1768f02i3dxdbxn8n29d522h8v0mkgnhpb8ixzq5p54vwjmfl6md"; 17 } 18 else 19 + throw "unsupported system: ${stdenv.system}"; 20 21 nativeBuildInputs = [ file ]; 22
+1 -1
pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
··· 44 assert swingSupport -> xorg != null; 45 46 let 47 - abortArch = abort "jdk requires i686-linux, x86_64-linux, aarch64-linux or armv7l-linux"; 48 49 /** 50 * The JRE libraries are in directories that depend on the CPU.
··· 44 assert swingSupport -> xorg != null; 45 46 let 47 + abortArch = throw "Unsupported system: ${stdenv.system}"; 48 49 /** 50 * The JRE libraries are in directories that depend on the CPU.
+1 -1
pkgs/development/libraries/bootil/default.nix
··· 28 platform = 29 if stdenv.isLinux then "linux" 30 else if stdenv.isDarwin then "macosx" 31 - else abort "unrecognized platform"; 32 33 buildInputs = [ premake4 ]; 34
··· 28 platform = 29 if stdenv.isLinux then "linux" 30 else if stdenv.isDarwin then "macosx" 31 + else throw "unrecognized system ${stdenv.system}"; 32 33 buildInputs = [ premake4 ]; 34
+1 -1
pkgs/development/tools/misc/iozone/default.nix
··· 9 "macosx" 10 else if stdenv.system == "aarch64-linux" then 11 "linux-arm" 12 - else abort "Platform ${stdenv.system} not yet supported."; 13 in 14 15 stdenv.mkDerivation rec {
··· 9 "macosx" 10 else if stdenv.system == "aarch64-linux" then 11 "linux-arm" 12 + else throw "Platform ${stdenv.system} not yet supported."; 13 in 14 15 stdenv.mkDerivation rec {
+1 -1
pkgs/development/tools/misc/saleae-logic/default.nix
··· 42 sha256 = "1skx2pfnic7pyss7c69qb7kg2xvflpxf112xkf9awk516dw1w4h7"; 43 } 44 else 45 - abort "Saleae Logic software requires i686-linux or x86_64-linux"; 46 47 desktopItem = makeDesktopItem { 48 name = "saleae-logic";
··· 42 sha256 = "1skx2pfnic7pyss7c69qb7kg2xvflpxf112xkf9awk516dw1w4h7"; 43 } 44 else 45 + throw "Saleae Logic software requires i686-linux or x86_64-linux"; 46 47 desktopItem = makeDesktopItem { 48 name = "saleae-logic";
+1 -1
pkgs/games/nethack/default.nix
··· 3 let 4 platform = 5 if lib.elem stdenv.system lib.platforms.unix then "unix" 6 - else abort "Unknown platform for NetHack"; 7 unixHint = 8 if stdenv.isLinux then "linux" 9 else if stdenv.isDarwin then "macosx10.10"
··· 3 let 4 platform = 5 if lib.elem stdenv.system lib.platforms.unix then "unix" 6 + else throw "Unknown platform for NetHack: ${stdenv.system}"; 7 unixHint = 8 if stdenv.isLinux then "linux" 9 else if stdenv.isDarwin then "macosx10.10"
+1 -1
pkgs/games/steam/default.nix
··· 6 self = rec { 7 steamArch = if pkgs.stdenv.system == "x86_64-linux" then "amd64" 8 else if pkgs.stdenv.system == "i686-linux" then "i386" 9 - else abort "Unsupported platform"; 10 11 steam-runtime = callPackage ./runtime.nix { }; 12 steam-runtime-wrapped = callPackage ./runtime-wrapped.nix { };
··· 6 self = rec { 7 steamArch = if pkgs.stdenv.system == "x86_64-linux" then "amd64" 8 else if pkgs.stdenv.system == "i686-linux" then "i386" 9 + else throw "Unsupported platform: ${pkgs.stdenv.system}"; 10 11 steam-runtime = callPackage ./runtime.nix { }; 12 steam-runtime-wrapped = callPackage ./runtime-wrapped.nix { };
+1 -1
pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix
··· 9 let arch = 10 if stdenv.system == "x86_64-linux" then "64" 11 else if stdenv.system == "i686-linux" then "32" 12 - else abort "Unsupported architecture"; 13 14 in stdenv.mkDerivation rec { 15 name = "cnijfilter-${version}";
··· 9 let arch = 10 if stdenv.system == "x86_64-linux" then "64" 11 else if stdenv.system == "i686-linux" then "32" 12 + else throw "Unsupported system ${stdenv.system}"; 13 14 in stdenv.mkDerivation rec { 15 name = "cnijfilter-${version}";
+1 -1
pkgs/misc/cups/drivers/kyocera/default.nix
··· 4 platform = 5 if stdenv.system == "x86_64-linux" then "64bit" 6 else if stdenv.system == "i686-linux" then "32bit" 7 - else abort "Unsupported platform"; 8 9 libPath = lib.makeLibraryPath [ cups ]; 10 in
··· 4 platform = 5 if stdenv.system == "x86_64-linux" then "64bit" 6 else if stdenv.system == "i686-linux" then "32bit" 7 + else throw "Unsupported system: ${stdenv.system}"; 8 9 libPath = lib.makeLibraryPath [ cups ]; 10 in
+1 -1
pkgs/misc/drivers/sundtek/default.nix
··· 9 if isx86_64 then "64bit" 10 else 11 if isi686 then "32bit" 12 - else abort "${system} not considered in build derivation. Might still be supported."; 13 14 in 15 stdenv.mkDerivation {
··· 9 if isx86_64 then "64bit" 10 else 11 if isi686 then "32bit" 12 + else throw "${system} not considered in build derivation. Might still be supported."; 13 14 in 15 stdenv.mkDerivation {
+1 -1
pkgs/os-specific/linux/broadcom-sta/default.nix
··· 16 17 src = fetchurl { 18 url = "https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/${tarball}"; 19 - sha256 = hashes."${stdenv.system}"; 20 }; 21 22 hardeningDisable = [ "pic" ];
··· 16 17 src = fetchurl { 18 url = "https://docs.broadcom.com/docs-and-downloads/docs/linux_sta/${tarball}"; 19 + sha256 = hashes.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); 20 }; 21 22 hardeningDisable = [ "pic" ];
+1 -1
pkgs/os-specific/linux/prl-tools/default.nix
··· 10 xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer)); 11 x64 = if stdenv.system == "x86_64-linux" then true 12 else if stdenv.system == "i686-linux" then false 13 - else abort "Parallels Tools for Linux only support {x86-64,i686}-linux targets"; 14 in 15 stdenv.mkDerivation rec { 16 version = "${prl_major}.2.1-41615";
··· 10 xorgVer = lib.concatStringsSep "." (lib.take 2 (lib.splitString "." xorgFullVer)); 11 x64 = if stdenv.system == "x86_64-linux" then true 12 else if stdenv.system == "i686-linux" then false 13 + else throw "Parallels Tools for Linux only support {x86-64,i686}-linux targets"; 14 in 15 stdenv.mkDerivation rec { 16 version = "${prl_major}.2.1-41615";
+12 -5
pkgs/stdenv/generic/check-meta.nix
··· 125 126 ''; 127 128 - throwEvalHelp = { reason , errormsg ? "" }: 129 - throw ('' 130 - Package ‘${attrs.name or "«name-missing»"}’ in ${pos_str} ${errormsg}, refusing to evaluate. 131 132 - '' + ((builtins.getAttr reason remediation) attrs)); 133 134 metaTypes = with lib.types; rec { 135 # These keys are documented ··· 192 validityCondition = 193 let v = checkValidity attrs; 194 in if !v.valid 195 - then throwEvalHelp (removeAttrs v ["valid"]) 196 else true; 197 198 in
··· 125 126 ''; 127 128 + handleEvalIssue = { reason , errormsg ? "" }: 129 + let 130 + msg = '' 131 + Package ‘${attrs.name or "«name-missing»"}’ in ${pos_str} ${errormsg}, refusing to evaluate. 132 + 133 + '' + (builtins.getAttr reason remediation) attrs; 134 + 135 + handler = if config ? "handleEvalIssue" 136 + then config.handleEvalIssue reason 137 + else throw; 138 + in handler msg; 139 140 141 metaTypes = with lib.types; rec { 142 # These keys are documented ··· 199 validityCondition = 200 let v = checkValidity attrs; 201 in if !v.valid 202 + then handleEvalIssue (removeAttrs v ["valid"]) 203 else true; 204 205 in
+3 -2
pkgs/tools/misc/mprime/default.nix
··· 5 if stdenv.system == "x86_64-linux" then "linux64" 6 else if stdenv.system == "i686-linux" then "linux" 7 else if stdenv.system == "x86_64-darwin" then "macosx64" 8 - else abort "Unsupported platform"; 9 gwnum = 10 if stdenv.system == "x86_64-linux" then "make64" 11 else if stdenv.system == "i686-linux" then "makefile" 12 else if stdenv.system == "x86_64-darwin" then "makemac" 13 - else abort "Unsupported platform"; 14 in 15 16 stdenv.mkDerivation {
··· 5 if stdenv.system == "x86_64-linux" then "linux64" 6 else if stdenv.system == "i686-linux" then "linux" 7 else if stdenv.system == "x86_64-darwin" then "macosx64" 8 + else throwSystem; 9 + throwSystem = throw "Unsupported system: ${stdenv.system}"; 10 gwnum = 11 if stdenv.system == "x86_64-linux" then "make64" 12 else if stdenv.system == "i686-linux" then "makefile" 13 else if stdenv.system == "x86_64-darwin" then "makemac" 14 + else throwSystem; 15 in 16 17 stdenv.mkDerivation {
+3 -2
pkgs/tools/networking/logmein-hamachi/default.nix
··· 8 arch = 9 if stdenv.system == "x86_64-linux" then "x64" 10 else if stdenv.system == "i686-linux" then "x86" 11 - else abort "Unsupported architecture"; 12 sha256 = 13 if stdenv.system == "x86_64-linux" then "011xg1frhjavv6zj1y3da0yh7rl6v1ax6xy2g8fk3sry9bi2p4j3" 14 else if stdenv.system == "i686-linux" then "03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62" 15 - else abort "Unsupported architecture"; 16 libraries = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]; 17 18 in stdenv.mkDerivation rec {
··· 8 arch = 9 if stdenv.system == "x86_64-linux" then "x64" 10 else if stdenv.system == "i686-linux" then "x86" 11 + else throwSystem; 12 + throwSystem = throw "Unsupported system: ${stdenv.system}"; 13 sha256 = 14 if stdenv.system == "x86_64-linux" then "011xg1frhjavv6zj1y3da0yh7rl6v1ax6xy2g8fk3sry9bi2p4j3" 15 else if stdenv.system == "i686-linux" then "03ml9xv19km99f0z7fpr21b1zkxvw7q39kjzd8wpb2pds51wnc62" 16 + else throwSystem; 17 libraries = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]; 18 19 in stdenv.mkDerivation rec {