The shared-mime-info package contains the core database of common types and the update-mime-database command used to extend it. The attached files and patches add the shared-mime-info package to buildroot. The only thing that is actually needed in the target is the file mime.cache. In order to generate that file, shared-mime-info is installed into the staging-dir. The idea is that other packages might add more mime-info files and these should be collected in staging-dir. From there the mime.cache file is created using tools installed in host-dir and copied to target.
Created attachment 257 [details] add host-libxml2 target for xmllint
Created attachment 259 [details] Config.in for shared-mime-info
Created attachment 261 [details] shared-mime-info.mk
Created attachment 275 [details] shared-mime-info.mk with a minor fix Here's a new version of shared-mime-info.mk with a minor fix. Now compiles cleanly from a fresh buildroot snapshot.
I'm testing these patches now.
I've committed your patches with small modifications (r26235 and r26236). They build correctly for me, for my limited testing. However, there's one thing that I'm not sure about. You re-generate the MIME cache from $(STAGING_DIR)/usr/share/mime in the POST_INSTALL hook of shared-mime-info. But what if a Buildroot package adds a file to $(STAGING_DIR)/usr/share/mime *after* the execution of shared-mime-info's POST_INSTALL hook ? If a package adds something in $(STAGING_DIR)/usr/share/mime, it should probably depend on shared-mime-info, which will trigger the compilation of shared-mime-info and the execution of its POST_INSTALL hook before the compilation of the package. Am I misunderstanding ? If not, what solution does you see to this problem ?
If a package needs to add mime-types, then it needs to install them in staging_dir and invoke update-mime-database with the correct paths. In order to make this work, we probably need to install update-mime-database into host_dir. It shouldn't be hard to get this working. So far I don't have a need for this though and without a package that actually installs new mime-types it is probably not worth to prepare the infrastructure for this. I suggest that this bug is closed as FIXED.
Ok, that makes sense. FWIW, we already have update-mime-database in $(HOST_DIR) : $ file build_arm/host_dir/usr/bin/update-mime-database build_arm/host_dir/usr/bin/update-mime-database: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped