summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2021-06-02 21:06:00 +0200
committerGitHub <noreply@github.com>2021-06-02 21:06:00 +0200
commited8115ef5ba5f1ca565c1d303775249d59833998 (patch)
tree0e58442f7669be2d87213da234b466000fe671d9
parenta8e4f721aad4f52824e8d5e37b9d0cac71450e7d (diff)
parentc57b309d32d74e4f1e60d32d32c53a76aac89577 (diff)
downloadnixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.tar
nixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.tar.gz
nixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.tar.bz2
nixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.tar.lz
nixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.tar.xz
nixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.tar.zst
nixpkgs-ed8115ef5ba5f1ca565c1d303775249d59833998.zip
Merge pull request #124992 from primeos/android-tools
android-tools: init at 31.0.0p1
-rw-r--r--lib/licenses.nix5
-rw-r--r--pkgs/tools/misc/android-tools/default.nix46
-rw-r--r--pkgs/top-level/all-packages.nix4
3 files changed, 55 insertions, 0 deletions
diff --git a/lib/licenses.nix b/lib/licenses.nix
index 88d598d9207..d79ac900439 100644
--- a/lib/licenses.nix
+++ b/lib/licenses.nix
@@ -760,6 +760,11 @@ lib.mapAttrs (n: v: v // { shortName = n; }) ({
     # channel and NixOS images.
   };
 
+  unicode-dfs-2015 = spdx {
+    spdxId = "Unicode-DFS-2015";
+    fullName = "Unicode License Agreement - Data Files and Software (2015)";
+  };
+
   unicode-dfs-2016 = spdx {
     spdxId = "Unicode-DFS-2016";
     fullName = "Unicode License Agreement - Data Files and Software (2016)";
diff --git a/pkgs/tools/misc/android-tools/default.nix b/pkgs/tools/misc/android-tools/default.nix
new file mode 100644
index 00000000000..69a74e465c9
--- /dev/null
+++ b/pkgs/tools/misc/android-tools/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl
+, cmake, perl, go
+, protobuf, zlib, gtest, brotli, lz4, zstd, libusb1, pcre2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "android-tools";
+  version = "31.0.0p1";
+
+  src = fetchurl {
+    url = "https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz";
+    sha256 = "1dn7v10gdx1pi0pkddznd5sdz941qz0x4jww8h2mk50nbyxc792i";
+  };
+
+  nativeBuildInputs = [ cmake perl go ];
+  buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 ];
+
+  # Don't try to fetch any Go modules via the network:
+  GOFLAGS = [ "-mod=vendor" ];
+
+  preConfigure = ''
+    export GOCACHE=$TMPDIR/go-cache
+  '';
+
+  meta = with lib; {
+    description = "Android SDK platform tools";
+    longDescription = ''
+      Android SDK Platform-Tools is a component for the Android SDK. It
+      includes tools that interface with the Android platform, such as adb and
+      fastboot. These tools are required for Android app development. They're
+      also needed if you want to unlock your device bootloader and flash it
+      with a new system image.
+      Currently the following tools are supported:
+      - adb
+      - fastboot
+      - mke2fs.android (required by fastboot)
+      - simg2img, img2simg, append2simg
+    '';
+    # https://developer.android.com/studio/command-line#tools-platform
+    # https://developer.android.com/studio/releases/platform-tools
+    homepage = "https://github.com/nmeum/android-tools";
+    license = with licenses; [ asl20 unicode-dfs-2015 ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 646bed9aba6..043d7634741 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1039,6 +1039,10 @@ in
 
   analog = callPackage ../tools/admin/analog {};
 
+  android-tools = lowPrio (callPackage ../tools/misc/android-tools {
+    stdenv = if stdenv.targetPlatform.isAarch64 then gcc10Stdenv else stdenv;
+  });
+
   angle-grinder = callPackage ../tools/text/angle-grinder {};
 
   ansifilter = callPackage ../tools/text/ansifilter {};