Modify script to use .pc specified in the xml
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 22 May 2024 05:57:49 +0000 (14:57 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Mon, 27 May 2024 03:35:49 +0000 (12:35 +0900)
There are some packages that have .pc files which names are not same as
its package. In this case, it is not simple to get proper pc file by
reading the .xml file.
To resolve this problem, pkgconfig section is added to some .xml files
and parsing code is added to the script.

Change-Id: I69797e1590539431696efad250fba4013301b654
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
rs_resource/NativeAPI/libdlog-rs.xml
rs_resource/OSS/glib2-rs.xml
script/rootstrap_gen_1.0.sh

index c2518015355c8675b5ad498ed44a5ae375796c27..c15e7770baf61382d10fbf8310bc9a68f5352f50 100644 (file)
     <rpm accept="libdlog" arch="armv7l"/>
     <rpm accept="libdlog-devel" arch="armv7l"/>
   </target>
+
+  <pkgconfig>
+    <file>dlog.pc</file>
+  </pkgconfig>
+
   <necessary>
     <file>/usr/include/dlog/dlog.h</file>
     <file>/usr/lib/libdlog.so*</file>
index e93b9b6d3237115c0db531743cb1afcb9331d9a1..92e02a0c40cbcf9cc00b6a8e899f4b5ed8ee9bdf 100644 (file)
     <rpm accept="libgthread" arch="armv7l"/>
   </target>
 
+  <pkgconfig>
+    <file>gio-2.0.pc</file>
+    <file>gio-unix-2.0.pc</file>
+    <file>glib-2.0.pc</file>
+    <file>gmodule-2.0.pc</file>
+    <file>gmodule-export-2.0.pc</file>
+    <file>gmodule-no-export-2.0.pc</file>
+    <file>gobject-2.0.pc</file>
+    <file>gthread-2.0.pc</file>
+  </pkgconfig>
+
   <necessary>
     <file>/usr/include/gio-unix-2.0/gio/gdesktopappinfo.h</file>
     <file>/usr/include/gio-unix-2.0/gio/gfiledescriptorbased.h</file>
index 226ed603582ff5f8770dd87ebee625572e42141a..e868a744af32a6dd618d2ab70df8e831fa47f87f 100755 (executable)
@@ -232,17 +232,28 @@ function copy_package_config()
        log "+ destination dierctory : ${dest_dir}"
        log "+ xml source file : ${xml_file}"
 
-       local pc_fname="$(xmlstarlet sel -t -v '//rootstrap/@name' ${item}).pc"
-       local src_pc_file_path="${src_dir}/usr/lib/pkgconfig/${pc_fname}"
+       local pc_fname=''
+       local src_pc_file_path=''
        local dest_pc_path="${dest_dir}/usr/lib/pkgconfig"
+       local pc_fnames=($(xmlstarlet sel -t -v '//rootstrap/pkgconfig/file' ${item}))
 
-       if [[ ! -f "${src_pc_file_path}" ]]; then
-               log "+ no pkgconfig file(${src_pc_file_path})"
-               return 1
+       if [[ -z ${pc_fnames[@]} ]]; then
+               pc_fnames=("$(xmlstarlet sel -t -v '//rootstrap/@name' ${item}).pc")
        fi
 
-       mkdir -p ${dest_pc_path}
-       cp -P "${src_pc_file_path}" "${dest_pc_path}/."
+       for pc_fname in ${pc_fnames[@]}; do
+               src_pc_file_path="${src_dir}/usr/lib/pkgconfig/${pc_fname}"
+
+               if [[ ! -f "${src_pc_file_path}" ]]; then
+                       log "+ no pkgconfig file(${src_pc_file_path})"
+                       return 1
+               fi
+
+               mkdir -p ${dest_pc_path}
+               cp -P "${src_pc_file_path}" "${dest_pc_path}/."
+       done
+
+       return 0
 }
 
 function check_prerequisite()