Browse Source

Start moving gencat back to the install step

signals
Gavin Howard 3 years ago
parent
commit
5d0d10ed0e
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 4
      Makefile.in
  2. 4
      README.md
  3. 39
      catalogs.sh
  4. 30
      configure.sh
  5. 6
      locale_install.sh
  6. 1
      locales/catalogs/en.UTF-8.cat
  7. BIN
      locales/catalogs/en.cat
  8. 1
      locales/catalogs/en_US.UTF-8.cat
  9. 1
      locales/catalogs/en_US.cat
  10. 2
      release.sh

4
Makefile.in

@ -116,7 +116,6 @@ LINK = ./link.sh
KARATSUBA = ./karatsuba.py
LOCALE_INSTALL = ./locale_install.sh
LOCALE_UNINSTALL = ./locale_uninstall.sh
CATALOGS = ./catalogs.sh
VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
RONN_ARGS = --roff --organization="Gavin D. Howard" --manual="General Commands Manual"
@ -234,9 +233,6 @@ manpages:
ronn $(RONN_ARGS) $(BC_RONN)
ronn $(RONN_ARGS) $(DC_RONN)
catalogs:
$(CATALOGS)
clean:
@printf 'Cleaning files...\n'
@$(RM) -f $(OBJ)

4
README.md

@ -112,9 +112,6 @@ Currently, this `bc` only has support for English (and US English) locales.
Patches are welcome for translations; use the existing `*.msg` files in
`locales/` as a starting point.
When submitting a translations, you need to run `make catalogs` before
committing; this will generate `*.cat` files for all of the translations.
## Other Projects
Other projects based on this bc are:
@ -146,7 +143,6 @@ Files:
.gitignore The git ignore file (maintainer use only).
.travis.yml The Travis CI file (maintainer use only).
catalogs.sh A script to generate catalogs (maintainer use only).
codecov.yml The Codecov file (maintainer use only).
configure.sh The configure script.
functions.sh A script with functions used by other scripts.

39
catalogs.sh

@ -1,39 +0,0 @@
#! /bin/sh
#
# Copyright 2018 Gavin D. Howard
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
script="$0"
scriptdir=$(dirname "$script")
. "$scriptdir/functions.sh"
localedir="$scriptdir/locales"
for file in $localedir/*.msg; do
base=$(basename "$file")
name=$(removeext "$base")
f="$localedir/catalogs/$name.cat"
if [ -L "$file" ]; then
link=$(readlink "$file")
link=$(removeext "$link")
rm -rf "$localedir/catalogs/$name.cat"
ln -s "$link.cat" "$localedir/catalogs/$name.cat"
else
gencat "$f" "$file"
fi
done

30
configure.sh

@ -458,7 +458,7 @@ if [ "$nls" -eq 1 ]; then
flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/"
flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
"$CC" $CFLAGS $flags -c "src/vm.c" > /dev/null 2>&1
"$CC" $CFLAGS $flags -c "src/vm.c" -o "$scriptdir/vm.o" > /dev/null 2>&1
err="$?"
@ -471,7 +471,31 @@ if [ "$nls" -eq 1 ]; then
printf 'Disabling NLS...\n'
nls=0
else
printf 'NLS works.\n'
printf 'NLS works.\n\n'
if [ "$HOSTCC" != "$CC" ]; then
printf 'Cross-compile detected.\n\n'
printf 'WARNING: Catalog files generated with gencat may not be portable\n'
printf ' across different architectures.\n\n'
else
printf 'Testing gencat...\n'
gencat "$scriptdir/en.cat" "$scriptdir/locales/en.msg" > /dev/null 2>&1
err="$?"
rm -rf "$scriptdir/en.cat"
if [ "$err" -ne 0 ]; then
printf 'gencat does not work.\n'
printf 'Disabling NLS...\n\n'
nls=0
else
printf 'gencat works.\n\n'
fi
fi
fi
set -e
@ -489,7 +513,7 @@ if [ "$hist" -eq 1 ]; then
flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I./include/"
flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
"$CC" $CFLAGS $flags -c "src/history/history.c" > /dev/null 2>&1
"$CC" $CFLAGS $flags -c "src/history/history.c" -o "$scriptdir/vm.o" > /dev/null 2>&1
err="$?"

6
locale_install.sh

@ -34,9 +34,9 @@ shift
main_exec="$1"
shift
catalog_dir="$scriptdir/locales/catalogs"
locales_dir="$scriptdir/locales"
for file in $catalog_dir/*.cat; do
for file in $locales_dir/*.msg; do
base=$(basename "$file")
name=$(removeext "$base")
@ -50,7 +50,7 @@ for file in $catalog_dir/*.cat; do
linkname=$(removeext "$link")
"$INSTALL" -Dlm 755 "../../$linkname/LC_MESSAGES/$main_exec.cat" "$loc"
else
"$INSTALL" -Dm 755 "$file" "$loc"
gencat "$loc" "$file"
fi
done

1
locales/catalogs/en.UTF-8.cat

@ -1 +0,0 @@
en.cat

BIN
locales/catalogs/en.cat

Binary file not shown.

1
locales/catalogs/en_US.UTF-8.cat

@ -1 +0,0 @@
en.UTF-8.cat

1
locales/catalogs/en_US.cat

@ -1 +0,0 @@
en.cat

2
release.sh

@ -370,7 +370,7 @@ if [ "$run_tests" -ne 0 ]; then
printf '\n'
printf 'Then run the GitHub release script as follows:\n'
printf '\n'
printf ' <github_release> %s <msg> .travis.yml catalogs.sh codecov.yml release.sh \\\n' "$version"
printf ' <github_release> %s <msg> .travis.yml codecov.yml release.sh \\\n' "$version"
printf ' RELEASE.md tests/afl.py tests/randmath.py tests/bc/scripts/timeconst.bc\n'
fi

Loading…
Cancel
Save