gta4xl-common: Switch to install_symlink for OpenCL

Change-Id: I229b76868aa8afb0542f21d112be94080f85e7e6
diff --git a/Android.bp b/Android.bp
index 9515b25..5c20901 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,2 +1,64 @@
+//
+// Copyright (C) 2021-2024 The LineageOS Project
+//
+// SPDX-License-Identifier: Apache-2.0
+//
+
 soong_namespace {
 }
+
+install_symlink {
+    name: "libOpenCL_symlink32",
+    vendor: true,
+    installed_location: "lib/libOpenCL.so",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "libOpenCL_symlink64",
+    vendor: true,
+    installed_location: "lib64/libOpenCL.so",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "libOpenCL.1_symlink32",
+    vendor: true,
+    installed_location: "lib/libOpenCL.so.1",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "libOpenCL.1_symlink64",
+    vendor: true,
+    installed_location: "lib64/libOpenCL.so.1",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "libOpenCL.1.1_symlink32",
+    vendor: true,
+    installed_location: "lib/libOpenCL.so.1.1",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "libOpenCL.1.1_symlink64",
+    vendor: true,
+    installed_location: "lib64/libOpenCL.so.1.1",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "vulkan.universal9611_symlink32",
+    vendor: true,
+    installed_location: "lib/hw/vulkan.universal9611.so",
+    symlink_target: "egl/libGLES_mali.so",
+}
+
+install_symlink {
+    name: "vulkan.universal9611_symlink64",
+    vendor: true,
+    installed_location: "lib64/hw/vulkan.universal9611.so",
+    symlink_target: "egl/libGLES_mali.so",
+}
diff --git a/Android.mk b/Android.mk
index 1baa498..be21ddc 100644
--- a/Android.mk
+++ b/Android.mk
@@ -18,25 +18,4 @@
 
 ifneq ($(filter gta4xlwifi gta4xl, $(TARGET_DEVICE)),)
 include $(call all-subdir-makefiles,$(LOCAL_PATH))
-
-include $(CLEAR_VARS)
-
-EGL_LIBS := libGLES_mali.so libOpenCL.so libOpenCL.so.1 libOpenCL.so.1.1 hw/vulkan.universal9611.so
-
-EGL_32_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/lib/,$(EGL_LIBS))
-$(EGL_32_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
-	@echo "EGL 32 lib link: $@"
-	@mkdir -p $(dir $@)
-	@rm -rf $@
-	$(hide) ln -sf /vendor/lib/egl/libGLES_mali.so $@
-
-EGL_64_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR)/lib64/,$(EGL_LIBS))
-$(EGL_64_SYMLINKS): $(LOCAL_INSTALLED_MODULE)
-	@echo "EGL 64 lib link: $@"
-	@mkdir -p $(dir $@)
-	@rm -rf $@
-	$(hide) ln -sf /vendor/lib64/egl/libGLES_mali.so $@
-
-ALL_DEFAULT_INSTALLED_MODULES += $(EGL_32_SYMLINKS) $(EGL_64_SYMLINKS)
-
 endif
diff --git a/common.mk b/common.mk
index 83d2e61..3195611 100644
--- a/common.mk
+++ b/common.mk
@@ -200,6 +200,15 @@
     libOMX.Exynos.VP9.Encoder \
     libOMX.Exynos.WMV.Decoder
 
+# OpenCL
+PRODUCT_PACKAGES += \
+    libOpenCL_symlink32 \
+    libOpenCL_symlink64 \
+    libOpenCL.1_symlink32 \
+    libOpenCL.1_symlink64 \
+    libOpenCL.1.1_symlink32 \
+    libOpenCL.1.1_symlink64
+
 # Overlays
 DEVICE_PACKAGE_OVERLAYS += $(COMMON_PATH)/overlay
 PRODUCT_ENFORCE_RRO_TARGETS += *
@@ -297,6 +306,11 @@
     android.hardware.usb-service.samsung \
     android.hardware.usb.gadget-service.samsung
 
+# Vulkan
+PRODUCT_PACKAGES += \
+    vulkan.universal9611_symlink32 \
+    vulkan.universal9611_symlink64
+
 # WiFi
 PRODUCT_PACKAGES += \
     WifiOverlay \