Commit 5319f2d8 authored by Jonas Heinrich's avatar Jonas Heinrich
Browse files

android-translation-layer: 0-unstable-2025-08-06 -> 0-unstable-2025-09-14

parent 5d5cf81b
Loading
Loading
Loading
Loading
+2 −26
Original line number Diff line number Diff line
diff --git a/meson.build b/meson.build
index 8f525118..ba8027c2 100644
index ad776069..ba8027c2 100644
--- a/meson.build
+++ b/meson.build
@@ -9,22 +9,15 @@ add_project_dependencies(incdir_dep, language: 'c')
 cc = meson.get_compiler('c')
 dir_base = meson.current_source_dir()
 builddir_base = meson.current_build_dir()
-# FIXME: make art install a pkgconfig file
-libart_dep = [
-	cc.find_library('art', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]),
-     	cc.find_library('nativebridge', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ])
-]
+libart_dep = dependency('art-standalone')
 libdl_bio_dep = [
 	cc.find_library('dl_bio')
 ]
@@ -16,8 +16,8 @@ libdl_bio_dep = [
 libc_bio_dep = [
 	cc.find_library('c_bio')
 ]
-libandroidfw_dep = [
-	cc.find_library('androidfw', dirs : [ '/usr' / get_option('libdir') / 'art', '/usr/local' / get_option('libdir') / 'art', get_option('prefix') / get_option('libdir') / 'art' ]),
-]
-if fs.is_file('/usr' / get_option('libdir') / 'java/core-all_classes.jar')
-  bootclasspath_dir = '/usr' / get_option('libdir') / 'java'
+if fs.is_file('@artStandalonePackageDir@' / get_option('libdir') / 'java/core-all_classes.jar')
@@ -28,12 +13,3 @@ index 8f525118..ba8027c2 100644
 elif fs.is_file('/usr/local' / get_option('libdir') / 'java/core-all_classes.jar')
   bootclasspath_dir = '/usr/local' / get_option('libdir') / 'java'
 elif fs.is_file(get_option('prefix') / get_option('libdir') / 'java/core-all_classes.jar')
@@ -179,7 +172,7 @@ libtranslationlayer_so = shared_library('translation_layer_main', [
                                                                   	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'),
-                                                                  	libandroidfw_dep, wayland_protos_dep
+                                                                        libart_dep, wayland_protos_dep
                                                                   ],
                                                                   link_with: [ libandroid_so ],
                                                                   link_args: [
+16 −0
Original line number Diff line number Diff line
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
+17 −4
Original line number Diff line number Diff line
@@ -30,13 +30,13 @@

stdenv.mkDerivation {
  pname = "android-translation-layer";
  version = "0-unstable-2025-08-06";
  version = "0-unstable-2025-09-03";

  src = fetchFromGitLab {
    owner = "android_translation_layer";
    repo = "android_translation_layer";
    rev = "d52985a6df81d73a8f6dfbdee337f7ff90b724cb";
    hash = "sha256-fJ8S04YucoCzHiIQdiQd+Il0YGNFsOkSiGWjZKNMTIM=";
    rev = "cf93a172b9238e6612b778c7ab76013acebf0ef8";
    hash = "sha256-nnwefW8802ctJRY0aqL+D6MK713eoiQ5K6oVnm5fUOQ=";
  };

  patches = [
@@ -51,6 +51,9 @@ stdenv.mkDerivation {

    # Patch custon Dex install dir
    ./configure-dex-install-dir.patch

    # Patch atl to load microg apk from custom path
    ./configure-microg-path.patch
  ];

  postPatch = ''
@@ -85,10 +88,20 @@ stdenv.mkDerivation {
    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 [ bintools ]}
      --prefix PATH : ${
        lib.makeBinPath [
          art-standalone # dex2oat
          bintools # addr2line
        ]
      } \
      --set MICROG_APK_PATH "$out/share/com.google.android.gms.apk"
  '';

  passthru.tests = {