push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
diff --git a/meson.build b/meson.build
index ba8027c2..fb21e317 100644
--- a/meson.build
+++ b/meson.build
@@ -171,7 +171,7 @@ libtranslationlayer_so = shared_library('translation_layer_main', [
extra_deps,
dependency('gtk4', version: '>=4.14'), dependency('gl'), dependency('egl'), dependency('wayland-client'), dependency('jni'),
dependency('libportal'), dependency('sqlite3'), dependency('libavcodec', version: '>=59'), dependency('libdrm'),
- dependency('gudev-1.0'), dependency('libswscale'), dependency('webkitgtk-6.0'),
+ dependency('gudev-1.0'), dependency('libswscale'), dependency('webkitgtk-6.0'), dependency('gio-unix-2.0'),
libart_dep, wayland_protos_dep
],
link_with: [ libandroid_so ],

View File

@@ -0,0 +1,12 @@
diff --git a/src/main-executable/main.c b/src/main-executable/main.c
index d7cfbfe8..c542c71a 100644
--- a/src/main-executable/main.c
+++ b/src/main-executable/main.c
@@ -311,6 +311,7 @@ static void open(GtkApplication *app, GFile **files, gint nfiles, const gchar *h
} else {
dex_install_dir = "DIDN'T_GET_SO_PATH_WITH_dladdr_SUS"; // in case we print this as part of some other error, it should be clear what the real cause is
}
+ dex_install_dir = "@out@/lib/java/dex";
char *app_data_dir_base = getenv("ANDROID_APP_DATA_DIR");
if (!app_data_dir_base) {

View File

@@ -0,0 +1,16 @@
diff --git a/src/main-executable/main.c b/src/main-executable/main.c
index 545da00f..2f87447d 100644
--- a/src/main-executable/main.c
+++ b/src/main-executable/main.c
@@ -390,7 +390,10 @@ static void open(GtkApplication *app, GFile **files, gint nfiles, const gchar *h
ret = stat(MICROG_APK_PATH_LOCAL, &dont_care);
errno_localdir = errno;
- if (!ret) {
+ char *env_microg = getenv("MICROG_APK_PATH");
+ if (env_microg && access(env_microg, F_OK) == 0) {
+ microg_apk = strdup(env_microg);
+ } else if (stat(MICROG_APK_PATH_LOCAL, &dont_care) == 0) {
microg_apk = strdup(MICROG_APK_PATH_LOCAL); // for running out of builddir; using strdup so we can always safely call free on this
} else {
char *microg_install_dir = malloc(strlen(dex_install_dir) + strlen(REL_MICROG_APK_INSTALL_PATH) + 1); // +1 for NULL

View File

@@ -0,0 +1,113 @@
{
stdenv,
fetchFromGitLab,
ffmpeg,
meson,
openjdk17,
lib,
glib,
pkg-config,
wayland-protocols,
wayland,
wayland-scanner,
gtk4,
openxr-loader,
libglvnd,
libportal-gtk4,
sqlite,
libdrm,
libgudev,
webkitgtk_6_0,
ninja,
art-standalone,
bionic-translation,
alsa-lib,
makeWrapper,
replaceVars,
nixosTests,
bintools,
}:
stdenv.mkDerivation {
pname = "android-translation-layer";
version = "0-unstable-2025-09-14";
src = fetchFromGitLab {
owner = "android_translation_layer";
repo = "android_translation_layer";
rev = "9de91586994af5078decda17db92ce50c5673951";
hash = "sha256-iRjP++WzLsV7oDGNdF3m9JJJS7zLrG5W46U3h39H5uk=";
};
patches = [
# Required gio-unix dependency is missing in meson.build
./add-gio-unix-dep.patch
# Patch custon Dex install dir
./configure-dex-install-dir.patch
# Patch atl to load microg apk from custom path
./configure-microg-path.patch
];
postPatch = ''
# As we need the $out reference, we can't use `replaceVars` here.
substituteInPlace src/main-executable/main.c \
--replace-fail '@out@' "$out"
'';
nativeBuildInputs = [
makeWrapper
meson
ninja
openjdk17
pkg-config
];
buildInputs = [
alsa-lib
art-standalone
bionic-translation
ffmpeg
gtk4
libdrm
libglvnd
libgudev
libportal-gtk4
openxr-loader
sqlite
wayland
wayland-protocols
wayland-scanner
webkitgtk_6_0
];
postInstall = ''
install -D $src/com.google.android.gms.apk $out/share/com.google.android.gms.apk
'';
postFixup = ''
wrapProgram $out/bin/android-translation-layer \
--prefix LD_LIBRARY_PATH : ${art-standalone}/lib/art \
--prefix PATH : ${
lib.makeBinPath [
art-standalone # dex2oat
bintools # addr2line
]
} \
--set MICROG_APK_PATH "$out/share/com.google.android.gms.apk"
'';
passthru.tests = {
inherit (nixosTests) android-translation-layer;
};
meta = {
description = "Translation layer that allows running Android apps on a Linux system";
homepage = "https://gitlab.com/android_translation_layer/android_translation_layer";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ onny ];
mainProgram = "android-translation-layer";
};
}