Skip to content

Commit

Permalink
miuicamera: Add dependencies libs and append _system to avoid conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: clarencelol <clarencekuiek@proton.me>
  • Loading branch information
clarencelol authored and rayavanindra committed Oct 25, 2024
1 parent f4d9cf5 commit c711154
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 5 deletions.
147 changes: 142 additions & 5 deletions common/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,129 @@

soong_namespace {
imports: [
"vendor/xiaomi/miuicamera",
],
}

cc_prebuilt_library_shared {
name: "libOpenCL_system",
stem: "libOpenCL",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libOpenCL.so"],
shared_libs: ["libcutils", "libvndksupport", "libc++", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libarcsoft_dualcam_refocus_system",
stem: "libarcsoft_dualcam_refocus",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus.so"],
shared_libs: ["libarcsoft_dualcam_refocus_rear_t_system", "libarcsoft_dualcam_refocus_rear_w_system", "libarcsoft_dualcam_refocus_front_system", "libmpbase_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libarcsoft_dualcam_refocus_front_system",
stem: "libarcsoft_dualcam_refocus_front",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus_front.so"],
shared_libs: ["libmpbase_system", "libOpenCL_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libarcsoft_dualcam_refocus_rear_t_system",
stem: "libarcsoft_dualcam_refocus_rear_t",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_t.so"],
shared_libs: ["libmpbase_system", "libOpenCL_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libarcsoft_dualcam_refocus_rear_w_system",
stem: "libarcsoft_dualcam_refocus_rear_w",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libarcsoft_dualcam_refocus_rear_w.so"],
shared_libs: ["libmpbase_system", "libOpenCL_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libarcsoft_portrait_lighting_system",
stem: "libarcsoft_portrait_lighting",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libarcsoft_portrait_lighting.so"],
shared_libs: ["libmpbase_system", "libarcsoft_portrait_lighting_c_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libarcsoft_portrait_lighting_c_system",
stem: "libarcsoft_portrait_lighting_c",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libarcsoft_portrait_lighting_c.so"],
shared_libs: ["libOpenCL_system", "liblog", "libdl", "libc", "libm", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libcamera_algoup_jni.xiaomi",
owner: "xiaomi/miuicamera",
Expand Down Expand Up @@ -48,7 +168,7 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libdoc_photo.so"],
shared_libs: ["liblog", "libOpenCL", "libjnigraphics", "libc", "libz", "libdl", "libm", ],
shared_libs: ["liblog", "libOpenCL_system", "libjnigraphics", "libc", "libz", "libdl", "libm", ],
},
},
compile_multilib: "64",
Expand Down Expand Up @@ -80,7 +200,7 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libgallery_arcsoft_dualcam_refocus.so"],
shared_libs: ["libmpbase", "liblog", "libc", "libm", "libdl", ],
shared_libs: ["libmpbase_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
Expand All @@ -96,7 +216,7 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libgallery_arcsoft_portrait_lighting.so"],
shared_libs: ["libmpbase", "libarcsoft_portrait_lighting_c", "liblog", "libc", "libm", "libdl", ],
shared_libs: ["libmpbase_system", "libarcsoft_portrait_lighting_c_system", "liblog", "libc", "libm", "libdl", ],
},
},
compile_multilib: "64",
Expand All @@ -112,7 +232,7 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libgallery_arcsoft_portrait_lighting_c.so"],
shared_libs: ["libOpenCL", "liblog", "libdl", "libc", "libm", ],
shared_libs: ["libOpenCL_system", "liblog", "libdl", "libc", "libm", ],
},
},
compile_multilib: "64",
Expand Down Expand Up @@ -144,7 +264,24 @@ cc_prebuilt_library_shared {
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libmibokeh_gallery.so"],
shared_libs: ["libOpenCL", "liblog", "libz", "libm", "libdl", "libc", ],
shared_libs: ["libOpenCL_system", "liblog", "libz", "libm", "libdl", "libc", ],
},
},
compile_multilib: "64",
prefer: true,
}

cc_prebuilt_library_shared {
name: "libmpbase_system",
stem: "libmpbase",
owner: "xiaomi/miuicamera",
strip: {
none: true,
},
target: {
android_arm64: {
srcs: ["proprietary/system/lib64/libmpbase.so"],
shared_libs: ["libc", ],
},
},
compile_multilib: "64",
Expand Down
8 changes: 8 additions & 0 deletions common/common-vendor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/miuicamera/common/proprietary/vendor/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/vendor.xiaomi.hardware.misys@3.0-service.rc

PRODUCT_PACKAGES += \
libOpenCL_system \
libarcsoft_dualcam_refocus_system \
libarcsoft_dualcam_refocus_front_system \
libarcsoft_dualcam_refocus_rear_t_system \
libarcsoft_dualcam_refocus_rear_w_system \
libarcsoft_portrait_lighting_system \
libarcsoft_portrait_lighting_c_system \
libcamera_algoup_jni.xiaomi \
libcamera_mianode_jni.xiaomi \
libdoc_photo \
Expand All @@ -21,6 +28,7 @@ PRODUCT_PACKAGES += \
libgallery_arcsoft_portrait_lighting_c \
libgallery_mpbase \
libmibokeh_gallery \
libmpbase_system \
librefocus \
librefocus_mibokeh \
vendor.xiaomi.hardware.misys@1.0-impl \
Expand Down
Binary file added common/proprietary/system/lib64/libOpenCL.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added common/proprietary/system/lib64/libmpbase.so
Binary file not shown.
10 changes: 10 additions & 0 deletions proprietary-files.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# All unpinned blobs below are extracted from V14.0.4.0.SJWMIXM (CURTANAGlobal)

# Dependencies
vendor/lib64/libmpbase.so:system/lib64/libmpbase.so;MODULE_SUFFIX=_system
vendor/lib64/libOpenCL.so:system/lib64/libOpenCL.so;MODULE_SUFFIX=_system
vendor/lib64/libarcsoft_dualcam_refocus.so:system/lib64/libarcsoft_dualcam_refocus.so;MODULE_SUFFIX=_system
vendor/lib64/libarcsoft_dualcam_refocus_front.so:system/lib64/libarcsoft_dualcam_refocus_front.so;MODULE_SUFFIX=_system
vendor/lib64/libarcsoft_dualcam_refocus_rear_t.so:system/lib64/libarcsoft_dualcam_refocus_rear_t.so;MODULE_SUFFIX=_system
vendor/lib64/libarcsoft_dualcam_refocus_rear_w.so:system/lib64/libarcsoft_dualcam_refocus_rear_w.so;MODULE_SUFFIX=_system
vendor/lib64/libarcsoft_portrait_lighting.so:system/lib64/libarcsoft_portrait_lighting.so;MODULE_SUFFIX=_system
vendor/lib64/libarcsoft_portrait_lighting_c.so:system/lib64/libarcsoft_portrait_lighting_c.so;MODULE_SUFFIX=_system

# MiSys
vendor/bin/hw/vendor.xiaomi.hardware.misys@1.0-service
vendor/bin/hw/vendor.xiaomi.hardware.misys@2.0-service
Expand Down
33 changes: 33 additions & 0 deletions setup-makefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,39 @@ if [ ! -f "${HELPER}" ]; then
fi
source "${HELPER}"

function vendor_imports() {
cat << EOF >> "$1"
"vendor/xiaomi/miuicamera",
EOF
}

function lib_to_package_fixup_system_variants() {
if [ "$2" != "system" ]; then
return 1
fi
case "$1" in
libmpbase | \
libOpenCL | \
libarcsoft_dualcam_refocus | \
libarcsoft_dualcam_refocus_front | \
libarcsoft_dualcam_refocus_rear_t | \
libarcsoft_dualcam_refocus_rear_w | \
libarcsoft_portrait_lighting | \
libarcsoft_portrait_lighting_c)
echo "$1_system"
;;
*)
return 1
;;
esac
}

function lib_to_package_fixup() {
lib_to_package_fixup_clang_rt_ubsan_standalone "$1" ||
lib_to_package_fixup_proto_3_9_1 "$1" ||
lib_to_package_fixup_system_variants "$@"
}

# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" true

Expand Down

0 comments on commit c711154

Please sign in to comment.