From 64521e1f22fbd48919942292c6aaa6f9aa578130 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Tue, 29 Aug 2023 14:50:31 +0200 Subject: [PATCH 1/6] compile-libvlc: reindent function There was no indentation despite the braces. --- buildsystem/compile-libvlc.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index cfbde91..090f7f2 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -235,13 +235,13 @@ avlc_get_symbol() avlc_gen_pc_file() { -echo -n "Generating $2 pkg-config file" -echo $1/$(echo $2|tr 'A-Z' 'a-z').pc -echo "Name: $2 -Description: $2 -Version: $3 -Libs: -l$2 -Cflags:" > $1/$(echo $2|tr 'A-Z' 'a-z').pc + echo -n "Generating $2 pkg-config file" + echo $1/$(echo $2|tr 'A-Z' 'a-z').pc + echo "Name: $2 + Description: $2 + Version: $3 + Libs: -l$2 + Cflags:" > $1/$(echo $2|tr 'A-Z' 'a-z').pc } avlc_pkgconfig() -- GitLab From 1c8ad23ca02905afd9dc06fcbd8826c36503ef80 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Tue, 29 Aug 2023 14:55:59 +0200 Subject: [PATCH 2/6] compile-libvlc: use bash redirection for pc generation Bash redirection allows writing the file using multiple commands without repeating the file name again, and it will allow writing conditionals for the output of the pc file. --- buildsystem/compile-libvlc.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index 090f7f2..2297eb4 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -237,11 +237,14 @@ avlc_gen_pc_file() { echo -n "Generating $2 pkg-config file" echo $1/$(echo $2|tr 'A-Z' 'a-z').pc - echo "Name: $2 - Description: $2 - Version: $3 - Libs: -l$2 - Cflags:" > $1/$(echo $2|tr 'A-Z' 'a-z').pc + + exec 3<> $1/$(echo $2|tr 'A-Z' 'a-z').pc + echo "Name: $2" >&3 + echo "Description: $2" >&3 + echo "Version: $3" >&3 + echo "Libs: -l$2" >&3 + echo "Cflags:" >&3 + exec 3>&- } avlc_pkgconfig() -- GitLab From 0892fe65b98a52a2dc58a2c6c47d900a433e9674 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Tue, 29 Aug 2023 14:56:26 +0200 Subject: [PATCH 3/6] compile-libvlc: add other variables for pc generation In order to generate the pkg-config file for libvlc, we want to be able to specify the usual prefix/libdir/includedir variables. --- buildsystem/compile-libvlc.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index 2297eb4..dc5a333 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -239,6 +239,15 @@ avlc_gen_pc_file() echo $1/$(echo $2|tr 'A-Z' 'a-z').pc exec 3<> $1/$(echo $2|tr 'A-Z' 'a-z').pc + + [ ! -z "${PC_PREFIX}" ] && + echo "prefix=${PC_PREFIX}" >&3 + [ ! -z "${PC_LIBDIR}" ] && + echo "libdir=${PC_LIBDIR}" >&3 + [ ! -z "${PC_INCLUDEDIR}" ] && + echo "includedir=${PC_INCLUDEDIR}" >&3 + echo "" >&3 + echo "Name: $2" >&3 echo "Description: $2" >&3 echo "Version: $3" >&3 -- GitLab From 159102a8c2f3a4afa3b072cb12196f8e0cb2fb1a Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Tue, 29 Aug 2023 15:03:23 +0200 Subject: [PATCH 4/6] compile-libvlc: fix weird line The echo line and the next one were stitched without separators, so it was displaying a path as file$path instead of, now, file: $path. --- buildsystem/compile-libvlc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index dc5a333..96b4eb2 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -235,7 +235,7 @@ avlc_get_symbol() avlc_gen_pc_file() { - echo -n "Generating $2 pkg-config file" + echo -n "Generating $2 pkg-config file: " echo $1/$(echo $2|tr 'A-Z' 'a-z').pc exec 3<> $1/$(echo $2|tr 'A-Z' 'a-z').pc -- GitLab From 6f28eeb0544f1c182504a5606ba5d4dd32682a19 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Tue, 29 Aug 2023 15:44:05 +0200 Subject: [PATCH 5/6] compile-libvlc.sh: gen_pc_file allow extending FLAGS Allow extending CFLAGS and LIBS, so that we can specify flags for libvlc when generating its pc file. --- buildsystem/compile-libvlc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index 96b4eb2..b604410 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -251,8 +251,8 @@ avlc_gen_pc_file() echo "Name: $2" >&3 echo "Description: $2" >&3 echo "Version: $3" >&3 - echo "Libs: -l$2" >&3 - echo "Cflags:" >&3 + echo "Libs: ${PC_LIBS} -l$2" >&3 + echo "Cflags: ${PC_CFLAGS}" >&3 exec 3>&- } -- GitLab From 237df42fcce47126a9ad06ce3a5a999c60033f25 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux <ajanni@videolabs.io> Date: Tue, 29 Aug 2023 15:44:31 +0200 Subject: [PATCH 6/6] compile-libvlc.sh: generate pkg-config file for libvlc.so The compile-libvlc.sh script will generate a shared library called libvlc.so including libvlc, libvlccore, the plugins and the contribs. Expose a pkg-config file per arch folder to be able to supply this to other buildsystem like meson, cmake or autoconf. --- buildsystem/compile-libvlc.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildsystem/compile-libvlc.sh b/buildsystem/compile-libvlc.sh index b604410..f05862e 100755 --- a/buildsystem/compile-libvlc.sh +++ b/buildsystem/compile-libvlc.sh @@ -706,6 +706,16 @@ $NDK_BUILD -C $LIBVLCJNI_SRC_DIR/libvlc \ NDK_DEBUG=${NDK_DEBUG} avlc_checkfail "ndk-build libvlc failed" +libvlc_pc_dir="$LIBVLCJNI_SRC_DIR/libvlc/jni/pkgconfig/${ANDROID_ABI}/" +mkdir -p "${libvlc_pc_dir}" + +PC_PREFIX="$(cd $LIBVLCJNI_SRC_DIR/libvlc/jni/; pwd -P)" \ +PC_LIBDIR="$(cd $LIBVLCJNI_SRC_DIR/libvlc/jni/libs/${ANDROID_ABI}; pwd -P)" \ +PC_INCLUDEDIR="$(cd $VLC_SRC_DIR/include/; pwd -P)" \ +PC_CFLAGS="-I\${includedir}" \ +PC_LIBS="-L\${libdir}" \ +avlc_gen_pc_file "${libvlc_pc_dir}" libvlc 4.0.0 + # Remove gdbserver to avoid conflict with libvlcjni.so debug options rm -f $VLC_OUT_PATH/libs/${ANDROID_ABI}/gdb* -- GitLab