Chameleon

Chameleon Commit Details

Date:2011-12-28 21:33:52 (12 years 3 months ago)
Author:JrCs
Commit:1758
Parents: 1757
Message:Improved buildpkg script - Use configuration to know which modules to add to the generated meta-package
Changes:
M/trunk/package/buildpkg.sh

File differences

trunk/package/buildpkg.sh
2222
2323
2424
25
26
27
28
29
30
31
32
2533
2634
2735
......
264272
265273
266274
275
267276
268277
269278
......
281290
282291
283292
284
293
285294
286
287
288
289
295
296
297
298
290299
291300
292301
293302
294
303
295304
296305
297306
298307
299
308
300309
301
302
303
304
310
311
312
313
305314
306315
307316
308317
309
318
310319
311320
312321
313322
314
323
324
315325
326
327
328
329
316330
317331
318
319
332
333
320334
321335
322336
323337
324
325
338
326339
327340
328341
329342
330343
331344
332
345
333346
334347
335348
......
366379
367380
368381
382
369383
370384
371385
......
441455
442456
443457
444
458
459
445460
446461
447462
448463
449464
450
465
466
467
468
451469
452470
453471
......
479497
480498
481499
482
483
484
500
501
502
485503
486504
487505
set -u # Abort with unset variables
#set -e # Abort with any error can be suppressed locally using EITHER cmd||true OR set -e;cmd;set +e
# ====== CONFIGURATION ======
CONFIG_MODULES=""
CONFIG_KLIBC_MODULE=""
CONFIG_UCLIBCXX_MODULE=""
CONFIG_RESOLUTION_MODULE=""
CONFIG_KEYLAYOUT_MODULE=""
source "${SRCROOT}/auto.conf"
# ====== COLORS ======
declare -r COL_BLACK="\x1b[30;01m"
outline[${#outline[*]}]="${indent[$xmlindent]}</line>"
# End build Chameleon package
if [[ "${CONFIG_MODULES}" == 'y' ]];then
# build Modules package
echo "================= Modules ================="
###############################
((xmlindent++))
# -
if [ -e ${SYMROOT}/i386/modules/klibc.dylib ]; then
if [[ "${CONFIG_RESOLUTION_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/Resolution.dylib" ]]; then
{
# Start build klibc package module
choiceId="klibc"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
ditto --noextattr --noqtn ${SYMROOT}/i386/modules/${choiceId}.dylib ${PKG_BUILD_DIR}/${choiceId}/Root
# Start build Resolution package module
choiceId="AutoReso"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/Resolution.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root"
echo -e "\t[BUILD] ${choiceId} "
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules"
addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
# End build klibc package module
# End build Resolution package module
}
fi
# -
if [ -e ${SYMROOT}/i386/modules/Resolution.dylib ]; then
if [[ "${CONFIG_KLIBC_MODULE}" == 'm' && -f "${SYMROOT}/i386/modules/klibc.dylib" ]]; then
{
# Start build Resolution package module
choiceId="AutoReso"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
ditto --noextattr --noqtn ${SYMROOT}/i386/modules/Resolution.dylib ${PKG_BUILD_DIR}/${choiceId}/Root
# Start build klibc package module
choiceId="klibc"
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/${choiceId}.dylib" ${PKG_BUILD_DIR}/${choiceId}/Root
echo -e "\t[BUILD] ${choiceId} "
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules"
addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId"
# End build Resolution package module
# End build klibc package module
}
fi
# -
if [ -e ${SYMROOT}/i386/modules/uClibcxx.dylib ]; then
if [[ "${CONFIG_UCLIBCXX_MODULE}" = 'm' && -n "${CONFIG_KLIBC_MODULE}" && \
-f "${SYMROOT}/i386/modules/uClibcxx.dylib" ]]; then
{
klibcPackageRefId=""
if [[ "${CONFIG_KLIBC_MODULE}" == 'm' ]];then
klibcPackageRefId=$(getPackageRefId "${modules_packages_identity}" "klibc")
fi
# Start build uClibc package module
choiceId="uClibc"
mkdir -p ${PKG_BUILD_DIR}/${choiceId}/Root
ditto --noextattr --noqtn ${SYMROOT}/i386/modules/uClibcxx.dylib ${PKG_BUILD_DIR}/${choiceId}/Root
mkdir -p "${PKG_BUILD_DIR}/${choiceId}/Root"
ditto --noextattr --noqtn "${SYMROOT}/i386/modules/uClibcxx.dylib" "${PKG_BUILD_DIR}/${choiceId}/Root"
echo -e "\t[BUILD] ${choiceId} "
packageRefId=$(getPackageRefId "${modules_packages_identity}" "${choiceId}")
buildpackage "$packageRefId" "${choiceId}" "${PKG_BUILD_DIR}/${choiceId}" "/$chamTemp/Extra/modules"
# Add the klibc package because the uClibc module is dependent of klibc module
addChoice "${choiceId}" "start_selected=\"false\"" \
"$packageRefId" $(getPackageRefId "${modules_packages_identity}" "klibc")
addChoice "${choiceId}" "start_selected=\"false\"" "$packageRefId" "$klibcPackageRefId"
# End build uClibc package module
}
fi
# -
# Warning Keylayout module need additional files
if [ -e ${SYMROOT}/i386/modules/Keylayout.dylib ]; then
if [[ "${CONFIG_KEYLAYOUT_MODULE}" = 'm' && -f "${SYMROOT}/i386/modules/Keylayout.dylib" ]]; then
{
# Start build Keylayout package module
choiceId="Keylayout"
}
fi
# End build Modules packages
fi
# build Options packages
outline[${#outline[*]}]="${indent[$xmlindent]}</line>"
done
# build KeyLayout options packages
if [[ -n "${CONFIG_KEYLAYOUT_MODULE}" ]];then
# build KeyLayout options packages
echo "================= Keymaps Options ================="
outline[${#outline[*]}]="${indent[$xmlindent]}<line choice=\"KeyLayout\">"
choices[${#choices[*]}]="\t<choice\n\t\tid=\"KeyLayout\"\n\t\ttitle=\"KeyLayout_title\"\n\t\tdescription=\"KeyLayout_description\">\n\t</choice>\n"
((xmlindent++))
packagesidentity="${chameleon_package_identity}.options.keylayout"
keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout")
keylayoutPackageRefId=""
if [[ "${CONFIG_MODULES}" == 'y' && "${CONFIG_KEYLAYOUT_MODULE}" = 'm' ]];then
keylayoutPackageRefId=$(getPackageRefId "${modules_packages_identity}" "Keylayout")
fi
# ------------------------------------------------------
# Available Keylayout boot options are discovered by
((xmlindent--))
outline[${#outline[*]}]="${indent[$xmlindent]}</line>"
# End build KeyLayout options packages
((xmlindent--))
# End build KeyLayout options packages
fi
((xmlindent--))
outline[${#outline[*]}]="${indent[$xmlindent]}</line>"
# End build options packages

Archive Download the corresponding diff file

Revision: 1758