Complete MIME related support for image/package creation

* Update MimeSet rule to use the MIME DB the build system creates.
* Add CreateAppMimeDBEntries rule and call it from Link for targets that
  might be applications that need to be registered with the MIME DB. For
  the target the rule is invoked with it creates a directory into which
  the entries for the types to be registered are written. The directory
  is associated with the target via the HAIKU_MIME_DB_ENTRIES variable.
* AddFilesToContainer: If a target is added that has MIME DB entries,
  also add those to the container.
* build_haiku_package: Call mimeset for the package contents.
This commit is contained in:
Ingo Weinhold
2013-05-09 03:38:10 +02:00
parent f666576f62
commit 518840e305
5 changed files with 70 additions and 9 deletions
+37 -5
View File
@@ -163,20 +163,52 @@ actions SetType1
$(2[1]) -t $(TARGET_EXECUTABLE_MIME_TYPE) "$(1)" ;
}
rule MimeSet
rule MimeSet target
{
# MimeSet <target>
# MimeSet <target> ;
Depends $(1) : <build>mimeset ;
MimeSet1 $(1) : <build>mimeset ;
Depends $(target) : <build>mimeset <mimedb>mime_db ;
MimeSet1 $(target) : <build>mimeset <mimedb>mime_db ;
}
actions MimeSet1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -f "$(1)" ;
$(2[1]) -f --mimedb "$(2[2])" "$(1)"
}
rule CreateAppMimeDBEntries target
{
# MimeSetApp <target> ;
# Create the app meta MIME DB entries for the given target. The
# HAIKU_MIME_DB_ENTRIES variable on <target> is set to the generated
# resulting target directory that contains the MIME DB entries.
local appGrist = $(target:G) ;
local appMimeDB = $(target:BS)_mimedb ;
appMimeDB = $(appMimeDB:G=mimedb-app-$(appGrist:E=)) ;
MakeLocateDebug $(appMimeDB) ;
Depends $(appMimeDB) : <build>mimeset $(target) <mimedb>mime_db ;
CreateAppMimeDBEntries1 $(appMimeDB)
: <build>mimeset $(target) <mimedb>mime_db ;
HAIKU_MIME_DB_ENTRIES on $(target) = $(appMimeDB) ;
}
actions CreateAppMimeDBEntries1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
appMimeDB="$(1)"
$(RM) -rf "$appMimeDB"
$(MKDIR) "$appMimeDB"
$(2[1]) -f --apps --mimedb "$appMimeDB" --mimedb "$(2[3])" "$(2[2])"
}
rule ResComp
{
# ResComp <resource file> : <rdef file> ;