build, gimp-data: do not hardcode the build directory.

This fixes building with the option -Dwindows-installer=true. We should
**never** hardcode the build directory like what was done in this
script.

Also bumping gimp-data where some scripts had similar issues which were
only visible with -Dwindows-installer=true.
This commit is contained in:
Jehan 2024-10-08 00:52:53 +02:00
parent afc0a6d15d
commit cf3aa1b6b7
3 changed files with 24 additions and 13 deletions

View file

@ -1,9 +1,13 @@
#!/bin/bash #!/bin/bash
BUILD_ROOT="`pwd`"
SOURCE_ROOT="$2"
if [ "$1" = 'cmp' ]; then if [ "$1" = 'cmp' ]; then
cd "$SOURCE_ROOT"
## Get list of GIMP supported languages ## Get list of GIMP supported languages
PO_ARRAY=($(echo $(ls ../po/*.po | PO_ARRAY=($(echo $(ls po/*.po |
sed -e 's|../po/||g' -e 's|.po||g' | sort) | sed -e 's|po/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' ')) tr '\n\r' ' '))
## Create list of lang [Components] ## Create list of lang [Components]
@ -14,21 +18,23 @@ if [ "$1" = 'cmp' ]; then
CMP_LINE=$(sed "s/PO_CLEAN/$PO_CLEAN/g" <<< $CMP_LINE) CMP_LINE=$(sed "s/PO_CLEAN/$PO_CLEAN/g" <<< $CMP_LINE)
# Change desc # Change desc
DESC=$(echo "cat //iso_639_entries/iso_639_entry[@dl_code=\"$PO\"]/@name" | DESC=$(echo "cat //iso_639_entries/iso_639_entry[@dl_code=\"$PO\"]/@name" |
xmllint --shell ../build/windows/installer/lang/iso_639_custom.xml | xmllint --shell build/windows/installer/lang/iso_639_custom.xml |
awk -F'[="]' '!/>/{print $(NF-1)}') awk -F'[="]' '!/>/{print $(NF-1)}')
CMP_LINE=$(sed "s/DESC/$DESC/g" <<< $CMP_LINE) CMP_LINE=$(sed "s/DESC/$DESC/g" <<< $CMP_LINE)
# Create line # Create line
NL=$'\n' NL=$'\n'
CMP_LIST+="${CMP_LINE}${NL}" CMP_LIST+="${CMP_LINE}${NL}"
done done
cd "$BUILD_ROOT"
echo "$CMP_LIST" > build/windows/installer/base_po-cmp.list echo "$CMP_LIST" > build/windows/installer/base_po-cmp.list
fi fi
if [ "$1" = 'files' ]; then if [ "$1" = 'files' ]; then
cd "$SOURCE_ROOT"
## Get list of GIMP supported languages ## Get list of GIMP supported languages
PO_ARRAY=($(echo $(ls ../po/*.po | PO_ARRAY=($(echo $(ls po/*.po |
sed -e 's|../po/||g' -e 's|.po||g' | sort) | sed -e 's|po/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' ')) tr '\n\r' ' '))
## Create list of lang [Files] ## Create list of lang [Files]
@ -42,25 +48,29 @@ if [ "$1" = 'files' ]; then
NL=$'\n' NL=$'\n'
FILES_LIST+="${FILES_LINE}${NL}" FILES_LIST+="${FILES_LINE}${NL}"
done done
cd "$BUILD_ROOT"
echo "$FILES_LIST" > build/windows/installer/base_po-files.list echo "$FILES_LIST" > build/windows/installer/base_po-files.list
fi fi
if [ "$1" = 'msg' ]; then if [ "$1" = 'msg' ]; then
## Get list of Inno supported languages ## Get list of Inno supported languages
PO_INNO_ARRAY=($(echo $(ls ../po-windows-installer/*.po | cd "$SOURCE_ROOT"
sed -e 's|../po-windows-installer/||g' -e 's|.po||g' | sort) | PO_INNO_ARRAY=($(echo $(ls po-windows-installer/*.po |
sed -e 's|po-windows-installer/||g' -e 's|.po||g' | sort) |
tr '\n\r' ' ')) tr '\n\r' ' '))
cd "$BUILD_ROOT"
## Create list of lang [Languages] ## Create list of lang [Languages]
if [ "$1" = 'msg' ]; then if [ "$1" = 'msg' ]; then
cd "$SOURCE_ROOT"
for PO in "${PO_INNO_ARRAY[@]}"; do for PO in "${PO_INNO_ARRAY[@]}"; do
MSG_LINE='Name: "PO"; MessagesFile: "compiler:INNO_CODE,{#ASSETS_DIR}\lang\PO.setup.isl"' MSG_LINE='Name: "PO"; MessagesFile: "compiler:INNO_CODE,{#ASSETS_DIR}\lang\PO.setup.isl"'
# Change po # Change po
MSG_LINE=$(sed "s/PO/$PO/g" <<< $MSG_LINE) MSG_LINE=$(sed "s/PO/$PO/g" <<< $MSG_LINE)
# Change isl # Change isl
INNO_CODE=$(echo "cat //iso_639_entries/iso_639_entry[@dl_code=\"$PO\"]/@inno_code" | INNO_CODE=$(echo "cat //iso_639_entries/iso_639_entry[@dl_code=\"$PO\"]/@inno_code" |
xmllint --shell ../build/windows/installer/lang/iso_639_custom.xml | xmllint --shell build/windows/installer/lang/iso_639_custom.xml |
awk -F'[="]' '!/>/{print $(NF-1)}') awk -F'[="]' '!/>/{print $(NF-1)}')
MSG_LINE=$(sed "s/INNO_CODE/$INNO_CODE/g" <<< $MSG_LINE) MSG_LINE=$(sed "s/INNO_CODE/$INNO_CODE/g" <<< $MSG_LINE)
# Create line # Create line
@ -69,6 +79,7 @@ if [ "$1" = 'msg' ]; then
MSG_LIST+="${MSG_LINE}${NL}" MSG_LIST+="${MSG_LINE}${NL}"
fi fi
done done
cd "$BUILD_ROOT"
echo "$MSG_LIST" > build/windows/installer/base_po-msg.list echo "$MSG_LIST" > build/windows/installer/base_po-msg.list
fi fi
fi fi

View file

@ -106,7 +106,7 @@ custom_target('base_po-cmp',
input : [ 'iso_639_custom.xml' ], input : [ 'iso_639_custom.xml' ],
output: [ 'base_po-cmp.list', ], output: [ 'base_po-cmp.list', ],
command: [ command: [
gen_list, 'cmp', gen_list, 'cmp', '@SOURCE_ROOT@'
], ],
build_by_default: true, build_by_default: true,
) )
@ -115,7 +115,7 @@ custom_target('base_po-files',
input : [ 'iso_639_custom.xml' ], input : [ 'iso_639_custom.xml' ],
output: [ 'base_po-files.list', ], output: [ 'base_po-files.list', ],
command: [ command: [
gen_list, 'files', gen_list, 'files', '@SOURCE_ROOT@'
], ],
build_by_default: true, build_by_default: true,
) )
@ -124,7 +124,7 @@ custom_target('base_po-msg',
input : [ 'iso_639_custom.xml' ], input : [ 'iso_639_custom.xml' ],
output: [ 'base_po-msg.list', ], output: [ 'base_po-msg.list', ],
command: [ command: [
gen_list, 'msg', gen_list, 'msg', '@SOURCE_ROOT@'
], ],
build_by_default: true, build_by_default: true,
) )

@ -1 +1 @@
Subproject commit 1cb035073b0de875e5df00e96c5a345e4e688af9 Subproject commit 31009e305c101967c7e274e31dee364b47f2beb8