Bug 299 - add shared-mime-info package
Summary: add shared-mime-info package
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P4 enhancement
Target Milestone: ---
Assignee: Thomas Petazzoni
URL:
Keywords:
Depends on:
Blocks: 303
  Show dependency treegraph
 
Reported: 2009-04-23 10:58 UTC by Sven Neumann
Modified: 2009-04-29 08:38 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
add host-libxml2 target for xmllint (1.79 KB, patch)
2009-04-23 10:59 UTC, Sven Neumann
Details
Config.in for shared-mime-info (378 bytes, application/octet-stream)
2009-04-23 11:07 UTC, Sven Neumann
Details
shared-mime-info.mk (2.60 KB, application/octet-stream)
2009-04-23 11:08 UTC, Sven Neumann
Details
shared-mime-info.mk with a minor fix (2.59 KB, text/plain)
2009-04-28 09:48 UTC, Sven Neumann
Details

Note You need to log in before you can comment on or make changes to this bug.
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