android-translation-layer: init at 0-unstable-2025-07-14

+151
+13
pkgs/by-name/an/android-translation-layer/add-gio-unix-dep.patch
··· 1 + diff --git a/meson.build b/meson.build 2 + index 8f525118..658cd9e5 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -178,7 +178,7 @@ libtranslationlayer_so = shared_library('translation_layer_main', [ 6 + extra_deps, 7 + dependency('gtk4', version: '>=4.14'), dependency('gl'), dependency('egl'), dependency('wayland-client'), dependency('jni'), 8 + dependency('libportal'), dependency('sqlite3'), dependency('libavcodec', version: '>=59'), dependency('libdrm'), 9 + - dependency('gudev-1.0'), dependency('libswscale'), dependency('webkitgtk-6.0'), 10 + + dependency('gudev-1.0'), dependency('libswscale'), dependency('webkitgtk-6.0'), dependency('gio-unix-2.0'), 11 + libandroidfw_dep, wayland_protos_dep 12 + ], 13 + link_with: [ libandroid_so ],
+29
pkgs/by-name/an/android-translation-layer/configure-art-path.patch
··· 1 + diff --git a/meson.build b/meson.build 2 + index 8f525118..c1761a2d 100644 3 + --- a/meson.build 4 + +++ b/meson.build 5 + @@ -11,8 +11,8 @@ dir_base = meson.current_source_dir() 6 + builddir_base = meson.current_build_dir() 7 + # FIXME: make art install a pkgconfig file 8 + libart_dep = [ 9 + - cc.find_library('art', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]), 10 + - cc.find_library('nativebridge', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]) 11 + + cc.find_library('art', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art', '@artStandalonePackageDir@' / get_option('libdir') / 'art' ]), 12 + + cc.find_library('nativebridge', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art', '@artStandalonePackageDir@' / get_option('libdir') / 'art' ]) 13 + ] 14 + libdl_bio_dep = [ 15 + cc.find_library('dl_bio') 16 + @@ -21,10 +21,10 @@ libc_bio_dep = [ 17 + cc.find_library('c_bio') 18 + ] 19 + libandroidfw_dep = [ 20 + - cc.find_library('androidfw', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]), 21 + + cc.find_library('androidfw', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art', '@artStandalonePackageDir@' / 'lib' / 'art' ]), 22 + ] 23 + -if fs.is_file('/usr' / get_option('libdir') / 'java/core-all_classes.jar') 24 + - bootclasspath_dir = '/usr' / get_option('libdir') / 'java' 25 + +if fs.is_file('@artStandalonePackageDir@' / get_option('libdir') / 'java/core-all_classes.jar') 26 + + bootclasspath_dir = '@artStandalonePackageDir@' / get_option('libdir') / 'java' 27 + elif fs.is_file('/usr/local' / get_option('libdir') / 'java/core-all_classes.jar') 28 + bootclasspath_dir = '/usr/local' / get_option('libdir') / 'java' 29 + elif fs.is_file(get_option('prefix') / get_option('libdir') / 'java/core-all_classes.jar')
+12
pkgs/by-name/an/android-translation-layer/configure-dex-install-dir.patch
··· 1 + diff --git a/src/main-executable/main.c b/src/main-executable/main.c 2 + index d7cfbfe8..c542c71a 100644 3 + --- a/src/main-executable/main.c 4 + +++ b/src/main-executable/main.c 5 + @@ -311,6 +311,7 @@ static void open(GtkApplication *app, GFile **files, gint nfiles, const gchar *h 6 + } else { 7 + 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 8 + } 9 + + dex_install_dir = "@out@/lib/java/dex"; 10 + 11 + char *app_data_dir_base = getenv("ANDROID_APP_DATA_DIR"); 12 + if (!app_data_dir_base) {
+97
pkgs/by-name/an/android-translation-layer/package.nix
··· 1 + { 2 + stdenv, 3 + fetchFromGitLab, 4 + ffmpeg, 5 + meson, 6 + openjdk17, 7 + lib, 8 + glib, 9 + pkg-config, 10 + wayland-protocols, 11 + wayland, 12 + wayland-scanner, 13 + gtk4, 14 + openxr-loader, 15 + libglvnd, 16 + libportal-gtk4, 17 + sqlite, 18 + libdrm, 19 + libgudev, 20 + webkitgtk_6_0, 21 + ninja, 22 + art-standalone, 23 + bionic-translation, 24 + alsa-lib, 25 + makeWrapper, 26 + replaceVars, 27 + }: 28 + 29 + stdenv.mkDerivation { 30 + pname = "android-translation-layer"; 31 + version = "0-unstable-2025-07-14"; 32 + 33 + src = fetchFromGitLab { 34 + owner = "android_translation_layer"; 35 + repo = "android_translation_layer"; 36 + rev = "828f779c4f7170f608047c500d6d3b64b480df7f"; 37 + hash = "sha256-1KYZWlzES3tbskqvA8qSQCegE0uLTLCq4q2CX6uix4o="; 38 + }; 39 + 40 + patches = [ 41 + (replaceVars ./configure-art-path.patch { 42 + artStandalonePackageDir = "${art-standalone}"; 43 + }) 44 + 45 + # Required gio-unix dependency is missing in meson.build 46 + ./add-gio-unix-dep.patch 47 + 48 + # Patch custon Dex install dir 49 + ./configure-dex-install-dir.patch 50 + ]; 51 + 52 + postPatch = '' 53 + # As we need the $out reference, we can't use `replaceVars` here. 54 + substituteInPlace src/main-executable/main.c \ 55 + --replace-fail '@out@' "$out" 56 + ''; 57 + 58 + nativeBuildInputs = [ 59 + makeWrapper 60 + meson 61 + ninja 62 + openjdk17 63 + pkg-config 64 + ]; 65 + 66 + buildInputs = [ 67 + alsa-lib 68 + art-standalone 69 + bionic-translation 70 + ffmpeg 71 + gtk4 72 + libdrm 73 + libglvnd 74 + libgudev 75 + libportal-gtk4 76 + openxr-loader 77 + sqlite 78 + wayland 79 + wayland-protocols 80 + wayland-scanner 81 + webkitgtk_6_0 82 + ]; 83 + 84 + postFixup = '' 85 + wrapProgram $out/bin/android-translation-layer \ 86 + --prefix LD_LIBRARY_PATH : ${art-standalone}/lib/art 87 + ''; 88 + 89 + meta = { 90 + description = "Translation layer that allows running Android apps on a Linux system"; 91 + homepage = "https://gitlab.com/android_translation_layer/android_translation_layer"; 92 + license = lib.licenses.gpl3Plus; 93 + platforms = lib.platforms.all; 94 + maintainers = with lib.maintainers; [ onny ]; 95 + mainProgram = "android-translation-layer"; 96 + }; 97 + }