commit f1516d60ec3fb37f2faa885a177330dc2d657d6a parent ec56a4612c0168ed2e01927be7ec2786d024bc19 Author: SomberNight <somber.night@protonmail.com> Date: Wed, 3 Jul 2019 17:37:02 +0200 mac build: fix locale in binaries Diffstat:
M | contrib/osx/base.sh | | | 4 | ++++ |
M | contrib/osx/make_osx | | | 21 | ++++++++++++++++++--- |
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/contrib/osx/base.sh b/contrib/osx/base.sh @@ -21,3 +21,7 @@ function DoCodeSignMaybe { # ARGS: infoName fileOrDirName codesignIdentity info "Code signing ${infoName}..." codesign -f -v $deep -s "$identity" "$file" || fail "Could not code sign ${infoName}" } + +function realpath() { + [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" +} diff --git a/contrib/osx/make_osx b/contrib/osx/make_osx @@ -9,6 +9,10 @@ LIBSECP_VERSION="b408c6a8b287003d1ade5709e6f7bc3c7f1d5be7" . $(dirname "$0")/base.sh +CONTRIB_OSX="$(dirname "$(realpath "$0")")" +CONTRIB="$CONTRIB_OSX/.." +ROOT_FOLDER="$CONTRIB/.." + src_dir=$(dirname "$0") cd $src_dir/../.. @@ -65,13 +69,24 @@ pyinstaller --version rm -rf ./dist -git submodule init -git submodule update +git submodule update --init rm -rf $BUILDDIR > /dev/null 2>&1 mkdir $BUILDDIR -cp -R ./contrib/deterministic-build/electrum-locale/locale/ ./electrum/locale/ +info "generating locale" +( + if ! which msgfmt > /dev/null 2>&1; then + brew install gettext + brew link --force gettext + fi + cd "$CONTRIB"/deterministic-build/electrum-locale + for i in ./locale/*; do + dir="$ROOT_FOLDER"/electrum/$i/LC_MESSAGES + mkdir -p $dir + msgfmt --output-file=$dir/electrum.mo $i/electrum.po || true + done +) || fail "failed generating locale" info "Downloading libusb..."