summary refs log tree commit diff
path: root/pkgs/development/androidndk-pkgs
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-09-21 01:09:37 +0300
committerArtturin <Artturin@artturin.com>2023-09-21 01:34:26 +0300
commitb2bcfe74af8292090e2060b1058ed447318591ce (patch)
tree70377c5ed3bc75f5a171160b91819c2bfc736b80 /pkgs/development/androidndk-pkgs
parent2557230bf62d87b753ffe3fb96c2b434843caac3 (diff)
downloadnixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.tar
nixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.tar.gz
nixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.tar.bz2
nixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.tar.lz
nixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.tar.xz
nixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.tar.zst
nixpkgs-b2bcfe74af8292090e2060b1058ed447318591ce.zip
androidndkPkgs: separate build and target ndkInfoFun
remove unused hostInfo variable, the uses of it were removed in (androidndk: remove legacy ndks)[2408ef3c6faa0ba0d513257378563ddc886f1020].

This prevents exiting with `error "attribute 'triple' missing"`
It's better to exit with a throw than a attribute missing which cannot
Diffstat (limited to 'pkgs/development/androidndk-pkgs')
-rw-r--r--pkgs/development/androidndk-pkgs/androidndk-pkgs.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
index 475fe4564ee..a8b172f4eb5 100644
--- a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
+++ b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
@@ -11,15 +11,17 @@ let
   # than we do. We don't just use theirs because ours are less ambiguous and
   # some builds need that clarity.
   #
-  # FIXME:
-  # There's some dragons here. Build host and target concepts are being mixed up.
-  ndkInfoFun = { config, ... }: {
+  ndkBuildInfoFun = { config, ... }: {
     x86_64-apple-darwin = {
       double = "darwin-x86_64";
     };
     x86_64-unknown-linux-gnu = {
       double = "linux-x86_64";
     };
+  }.${config} or
+    (throw "Android NDK doesn't support building on ${config}, as far as we know");
+
+  ndkTargetInfoFun = { config, ... }: {
     i686-unknown-linux-android = {
       triple = "i686-linux-android";
       arch = "x86";
@@ -37,11 +39,10 @@ let
       triple = "aarch64-linux-android";
     };
   }.${config} or
-    (throw "Android NDK doesn't support ${config}, as far as we know");
+    (throw "Android NDK doesn't support targetting ${config}, as far as we know");
 
-  buildInfo = ndkInfoFun stdenv.buildPlatform;
-  hostInfo = ndkInfoFun stdenv.hostPlatform;
-  targetInfo = ndkInfoFun stdenv.targetPlatform;
+  buildInfo = ndkBuildInfoFun stdenv.buildPlatform;
+  targetInfo = ndkTargetInfoFun stdenv.targetPlatform;
 
   inherit (stdenv.targetPlatform) sdkVer;
   suffixSalt = lib.replaceStrings ["-" "."] ["_" "_"] stdenv.targetPlatform.config;