518840e305
* 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.
76 lines
1.2 KiB
Bash
Executable File
76 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
set -o errexit
|
|
|
|
# The first argument is the shell script that initializes the variables:
|
|
# addBuildCompatibilityLibDir
|
|
# mimeDB
|
|
# outputDir
|
|
# sourceDir
|
|
# tmpDir
|
|
# updateOnly
|
|
#
|
|
# addattr
|
|
# copyattr
|
|
# mimeset
|
|
# package
|
|
# rc
|
|
# rmAttrs
|
|
# unzip
|
|
#
|
|
|
|
if [ $# -le 1 ]; then
|
|
echo "$0: Missing parameters!" >&2
|
|
exit 1
|
|
fi
|
|
|
|
packagePath="$1"
|
|
packageInfoPath="$2"
|
|
shift 2
|
|
|
|
if [ $# -gt 0 ]; then
|
|
. $1
|
|
shift
|
|
fi
|
|
|
|
# this adds the build library dir to LD_LIBRARY_PATH
|
|
eval "$addBuildCompatibilityLibDir"
|
|
|
|
|
|
# make a clean contents dir
|
|
contentsDir="$tmpDir/contents"
|
|
$rmAttrs -rf "$contentsDir"
|
|
mkdir -p "$contentsDir"
|
|
|
|
|
|
# map the shell commands
|
|
sPrefix=
|
|
tPrefix="$contentsDir/"
|
|
cd=cd
|
|
scd=:
|
|
cp="$copyattr -d"
|
|
copyAttrs="$copyattr"
|
|
ln=ln
|
|
mkdir=mkdir
|
|
rm=$rmAttrs
|
|
mkindex=mkindex
|
|
|
|
|
|
# execute the scripts preparing the package contents
|
|
while [ $# -gt 0 ]; do
|
|
. $1
|
|
shift
|
|
done
|
|
|
|
|
|
# mimeset the whole package content
|
|
$mimeset --mimedb "$mimeDB" "$contentsDir"
|
|
|
|
|
|
# create the package
|
|
if [ ! $updateOnly ]; then
|
|
rm -f "$packagePath"
|
|
$package create -q -i "$packageInfoPath" -C "$contentsDir" "$packagePath"
|
|
else
|
|
$package add -q -f -i "$packageInfoPath" -C "$contentsDir" "$packagePath" .
|
|
fi
|