Commit 2557230b authored by Artturin's avatar Artturin
Browse files

androidndkPkgs: throw if targetPackages is not populated

It's better to exit with a throw than a attribute missing which cannot
be caught with tryEval

```
> pkgsCross.aarch64-android-prebuilt.androidndkPkgs
error: attribute 'androidndkPkgs_21' missing
```

Proper ways to to use `androidndkPkgs` AFAIK.

`with import ./. { crossSystem = (import ./lib).systems.examples.aarch64-android-prebuilt; }; buildPackages.androidndkPkgs`

or

`pkgsCross.aarch64-android-prebuilt.buildPackages.androidndkPkgs`
parent fd690175
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
      # these two really are the same.
      buildAndroidndk = buildAndroidComposition.ndk-bundle;
      androidndk = androidComposition.ndk-bundle;
      targetAndroidndkPkgs = targetPackages.androidndkPkgs_21;
      targetAndroidndkPkgs = if targetPackages ? androidndkPkgs_21 then targetPackages.androidndkPkgs_21 else throw "androidndkPkgs_21: no targetPackages, use `buildPackages.androidndkPkgs_21";
    };

  "23b" =
@@ -59,7 +59,7 @@
      # these two really are the same.
      buildAndroidndk = buildAndroidComposition.ndk-bundle;
      androidndk = androidComposition.ndk-bundle;
      targetAndroidndkPkgs = targetPackages.androidndkPkgs_23b;
      targetAndroidndkPkgs = if targetPackages ? androidndkPkgs_23b then targetPackages.androidndkPkgs_23b else throw "androidndkPkgs_23b: no targetPackages, use `buildPackages.androidndkPkgs_23b";
    };

  "24" =
@@ -89,7 +89,7 @@
      # these two really are the same.
      buildAndroidndk = buildAndroidComposition.ndk-bundle;
      androidndk = androidComposition.ndk-bundle;
      targetAndroidndkPkgs = targetPackages.androidndkPkgs_24;
      targetAndroidndkPkgs = if targetPackages ? androidndkPkgs_24 then targetPackages.androidndkPkgs_24 else throw "androidndkPkgs_24: no targetPackages, use `buildPackages.androidndkPkgs_24";
    };

}