Bug 299

Summary: add shared-mime-info package
Product: buildroot Reporter: Sven Neumann <s.neumann>
Component: OtherAssignee: Thomas Petazzoni <thomas.petazzoni>
Status: RESOLVED FIXED    
Severity: enhancement CC: buildroot
Priority: P4    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:
Bug Depends on:    
Bug Blocks: 303    
Attachments: add host-libxml2 target for xmllint
Config.in for shared-mime-info
shared-mime-info.mk
shared-mime-info.mk with a minor fix

Description Sven Neumann 2009-04-23 10:58:05 UTC
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.
Comment 1 Sven Neumann 2009-04-23 10:59:23 UTC
Created attachment 257 [details]
add host-libxml2 target for xmllint
Comment 2 Sven Neumann 2009-04-23 11:07:47 UTC
Created attachment 259 [details]
Config.in for shared-mime-info
Comment 3 Sven Neumann 2009-04-23 11:08:45 UTC
Created attachment 261 [details]
shared-mime-info.mk
Comment 4 Sven Neumann 2009-04-28 09:48:09 UTC
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.
Comment 5 Thomas Petazzoni 2009-04-28 22:05:47 UTC
I'm testing these patches now.
Comment 6 Thomas Petazzoni 2009-04-29 07:29:25 UTC
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 ?
Comment 7 Sven Neumann 2009-04-29 07:59:13 UTC
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.
Comment 8 Thomas Petazzoni 2009-04-29 08:38:56 UTC
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