Skip to content

Commit 58db782

Browse files
authored
Merge pull request #157 from lizelive/main
xbuild
2 parents 2cd380a + 90be9e9 commit 58db782

File tree

4 files changed

+4588
-26
lines changed

4 files changed

+4588
-26
lines changed

flake.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
flake-utils.url = "github:numtide/flake-utils";
99
};
1010

11-
outputs = {
12-
self,
13-
nixpkgs,
14-
fenix,
15-
flake-utils,
16-
}:
11+
outputs =
12+
{ self
13+
, nixpkgs
14+
, fenix
15+
, flake-utils
16+
,
17+
}:
1718
flake-utils.lib.eachDefaultSystem (
18-
system: let
19+
system:
20+
let
1921
# setup pkgs
2022
pkgs = import nixpkgs {
2123
inherit system;
22-
overlays = [fenix.overlays.default];
24+
overlays = [ fenix.overlays.default ];
2325
config = {
2426
android_sdk.accept_license = true;
2527
allowUnfree = true;
@@ -41,19 +43,34 @@
4143
targets.x86_64-pc-windows-gnu.stable.rust-std
4244
];
4345
androidComposition = pkgs.androidenv.composeAndroidPackages {
44-
abiVersions = ["arm64-v8a"];
46+
abiVersions = [ "arm64-v8a" ];
4547
includeNDK = true;
46-
platformVersions = ["32"];
48+
platformVersions = [ "32" ];
4749
};
48-
in {
50+
androidStudio = pkgs.android-studio.withSdk androidComposition.androidsdk;
51+
xbuild = pkgs.callPackage ./xbuild { };
52+
in
53+
{
54+
packages.default = xbuild;
4955
devShells.default = pkgs.mkShell rec {
5056
# build dependencies
5157
nativeBuildInputs = with pkgs; [
58+
jdk
59+
kotlin
60+
gradle
61+
squashfsTools
62+
clang
63+
lldb
64+
libllvm
65+
lld
66+
androidComposition.androidsdk
67+
5268
# the entire rust toolchain
5369
rustToolchain
70+
5471
# tool for cross compiling
5572
cargo-apk
56-
# xbuild
73+
xbuild
5774

5875
pkg-config
5976
openssl
@@ -102,12 +119,14 @@
102119
];
103120

104121
# android vars
105-
ANDROID_SDK_ROOT = "${androidComposition.androidsdk}/libexec/android-sdk";
106-
ANDROID_NDK_ROOT = "${ANDROID_SDK_ROOT}/ndk-bundle";
122+
ANDROID_HOME = "${androidComposition.androidsdk}/libexec/android-sdk";
123+
ANDROID_NDK_ROOT = "${ANDROID_HOME}/ndk-bundle";
107124

108125
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
109126
# this is most likely not needed. for some reason shadows flicker without it.
110127
AMD_VULKAN_ICD = "RADV";
128+
129+
111130
};
112131
# This only formats the nix files.
113132
formatter = pkgs.nixpkgs-fmt;

0 commit comments

Comments
 (0)