You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

#!/bin/bash
set -e
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../../.."
CONTRIB="$PROJECT_ROOT/contrib"
CONTRIB_SDIST="$CONTRIB/build-linux/sdist"
DISTDIR="$PROJECT_ROOT/dist"
LOCALE="$PROJECT_ROOT/electrum/locale/"
. "$CONTRIB"/build_tools_util.sh
# note that at least py3.7 is needed, to have https://bugs.python.org/issue30693
python3 --version || fail "python interpreter not found"
break_legacy_easy_install
# upgrade to modern pip so that it knows the flags we need.
build: android reprod: "pip install" needs "--no-build-isolation" maybe fixes https://github.com/spesmilo/electrum/issues/7640 Looks like by default pip is ignoring the locally available setuptools and wheel, and downloading the latest ones from the internet at build time... https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/?highlight=no-build-isolation#disabling-build-isolation https://stackoverflow.com/a/62889268 > When making build requirements available, pip does so in an isolated environment. That is, pip does not install those requirements into the user’s site-packages, but rather installs them in a temporary directory which it adds to the user’s sys.path for the duration of the build. This ensures that build requirements are handled independently of the user’s runtime environment. For example, a project that needs a recent version of setuptools to build can still be installed, even if the user has an older version installed (and without silently replacing that version). > > In certain cases, projects (or redistributors) may have workflows that explicitly manage the build environment. For such workflows, build isolation can be problematic. If this is the case, pip provides a --no-build-isolation flag to disable build isolation. Users supplying this flag are responsible for ensuring the build environment is managed appropriately (including ensuring that all required build dependencies are installed). If only it were that easy! If we add the "--no-build-isolation" flag, it becomes our responsibility to install *all* build time deps, hence we now have "requirements-build-makepackages.txt".
3 years ago
# (make_packages will later install a pinned version of pip in a venv)
python3 -m pip install --upgrade pip
"$CONTRIB"/make_packages || fail "make_packages failed"
git submodule update --init
(
cd "$CONTRIB/deterministic-build/electrum-locale/"
if ! which msgfmt > /dev/null 2>&1; then
echo "Please install gettext"
exit 1
fi
# We include both source (.po) and compiled (.mo) locale files in the source dist.
# Maybe we should exclude the compiled locale files? see https://askubuntu.com/a/144139
# (also see MANIFEST.in)
rm -rf "$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
cp $i/electrum.po "$PROJECT_ROOT/electrum/$i/electrum.po"
done
)
(
cd "$PROJECT_ROOT"
find -exec touch -h -d '2000-11-11T11:11:11+00:00' {} +
# note: .zip sdists would not be reproducible due to https://bugs.python.org/issue40963
TZ=UTC faketime -f '2000-11-11 11:11:11' python3 setup.py --quiet sdist --format=gztar
)
info "done."
ls -la "$DISTDIR"
sha256sum "$DISTDIR"/*