Browse Source

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

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

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

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

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

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

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

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

17
contrib/build_locale.sh

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

10
contrib/osx/make_osx

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

Loading…
Cancel
Save