Browse Source

build: use build-locale.sh in all build scripts

patch-4
SomberNight 2 years ago
parent
commit
c2b5e3ec15
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 13
      contrib/android/make_apk
  2. 14
      contrib/build-linux/appimage/make_appimage.sh
  3. 2
      contrib/build-linux/sdist/make_sdist.sh
  4. 14
      contrib/build-wine/build-electrum-git.sh
  5. 17
      contrib/build_locale.sh
  6. 10
      contrib/osx/make_osx

13
contrib/android/make_apk

@ -25,17 +25,10 @@ popd
# update locale
info "preparing electrum-locale."
(
cd "$CONTRIB"/deterministic-build/electrum-locale
if ! which msgfmt > /dev/null 2>&1; then
fail "Please install gettext"
fi
LOCALE="$PROJECT_ROOT/electrum/locale/"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -rf "$PROJECT_ROOT/electrum/locale/"
for i in ./locale/*; do
dir="$PROJECT_ROOT/electrum/$i/LC_MESSAGES"
mkdir -p $dir
msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true
done
rm -rf "$LOCALE"
"$CONTRIB/build_locale.sh" "$CONTRIB/deterministic-build/electrum-locale/locale/" "$LOCALE"
)
pushd "$CONTRIB_ANDROID"

14
contrib/build-linux/appimage/make_appimage.sh

@ -93,18 +93,10 @@ info "preparing electrum-locale."
cd "$PROJECT_ROOT"
git submodule update --init
pushd "$CONTRIB"/deterministic-build/electrum-locale
if ! which msgfmt > /dev/null 2>&1; then
fail "Please install gettext"
fi
LOCALE="$PROJECT_ROOT/electrum/locale/"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -rf "$PROJECT_ROOT/electrum/locale/"
for i in ./locale/*; do
dir="$PROJECT_ROOT/electrum/$i/LC_MESSAGES"
mkdir -p $dir
msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true
done
popd
rm -rf "$LOCALE"
"$CONTRIB/build_locale.sh" "$CONTRIB/deterministic-build/electrum-locale/locale/" "$LOCALE"
)

2
contrib/build-linux/sdist/make_sdist.sh

@ -33,7 +33,7 @@ git submodule update --init
rm -rf "$LOCALE"
cp -r "$CONTRIB/deterministic-build/electrum-locale/locale/" "$LOCALE/"
if ([ "$OMIT_UNCLEAN_FILES" != 1 ]); then
"$CONTRIB/build_locale.sh" "$LOCALE"
"$CONTRIB/build_locale.sh" "$LOCALE" "$LOCALE"
fi
)

14
contrib/build-wine/build-electrum-git.sh

@ -18,18 +18,10 @@ info "Last commit: $VERSION"
# Load electrum-locale for this release
git submodule update --init
pushd ./contrib/deterministic-build/electrum-locale
if ! which msgfmt > /dev/null 2>&1; then
fail "Please install gettext"
fi
LOCALE="$WINEPREFIX/drive_c/electrum/electrum/locale/"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -rf "$WINEPREFIX/drive_c/electrum/electrum/locale/"
for i in ./locale/*; do
dir="$WINEPREFIX/drive_c/electrum/electrum/$i/LC_MESSAGES"
mkdir -p $dir
msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true
done
popd
rm -rf "$LOCALE"
"$CONTRIB/build_locale.sh" "$CONTRIB/deterministic-build/electrum-locale/locale/" "$LOCALE"
find -exec touch -h -d '2000-11-11T11:11:11+00:00' {} +
popd

17
contrib/build_locale.sh

@ -1,7 +1,10 @@
#!/bin/bash
if [ ! -d "$1" ]; then
echo "usage: $0 path/to/locale"
set -e
if [[ ! -d "$1" || -z "$2" ]]; then
echo "usage: $0 locale_source_dir locale_dest_dir"
echo " The dirs can match, to build in place."
exit 1
fi
@ -10,7 +13,11 @@ if ! which msgfmt > /dev/null 2>&1; then
exit 1
fi
for i in "$1/"*; do
mkdir -p "$i/LC_MESSAGES"
(msgfmt --output-file="$i/LC_MESSAGES/electrum.mo" "$i/electrum.po" || true)
cd "$1"
mkdir -p "$2"
for i in *; do
dir="$2/$i/LC_MESSAGES"
mkdir -p "$dir"
(msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true)
done

10
contrib/osx/make_osx

@ -175,14 +175,10 @@ info "generating locale"
brew install gettext
brew link --force gettext
fi
cd "$CONTRIB"/deterministic-build/electrum-locale
LOCALE="$PROJECT_ROOT/electrum/locale/"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -rf "$PROJECT_ROOT/electrum/locale/"
for i in ./locale/*; do
dir="$PROJECT_ROOT/electrum/$i/LC_MESSAGES"
mkdir -p "$dir"
msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true
done
rm -rf "$LOCALE"
"$CONTRIB/build_locale.sh" "$CONTRIB/deterministic-build/electrum-locale/locale/" "$LOCALE"
) || fail "failed generating locale"

Loading…
Cancel
Save