Skip to content

Commit 39d87e0

Browse files
committed
fix: fix build 3rd parties
Signed-off-by: Kim Ebert <[email protected]>
1 parent 6f16338 commit 39d87e0

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

build-scripts/ubuntu-2204/build-3rd-parties.sh

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
set -e
44
set -x
55

6-
OUTPUT_PATH="${1:-.}"
6+
# Ensure OUTPUT_PATH is defined as a fully qualified path
7+
pushd $(dirname $(realpath "$0"))
8+
OUTPUT_PATH=${1:-.}
9+
if [ ! -d "${OUTPUT_PATH}" ]; then
10+
mkdir -p ${OUTPUT_PATH}
11+
fi
12+
OUTPUT_PATH=$(realpath ${OUTPUT_PATH})
13+
popd
14+
15+
wheel2debconf="$(dirname "$(realpath "$0")")"/wheel2deb.yml
716

817
function build_from_pypi {
918
PACKAGE_NAME="$1"
@@ -42,14 +51,43 @@ function build_from_pypi {
4251
rm "${PREREM_TMP}"
4352
}
4453

54+
function build_from_pypi_wheel {
55+
PACKAGE_NAME=$1
56+
57+
if [ -z $2 ]; then
58+
PACKAGE_VERSION=""
59+
# Get the most recent package version from PyPI to be included in the package name of the Debian artifact
60+
curl -X GET "https://pypi.org/pypi/${PACKAGE_NAME}/json" > "${PACKAGE_NAME}.json"
61+
PACKAGE_VERSION="==$(cat "${PACKAGE_NAME}.json" | jq --raw-output '.info.version')"
62+
rm "${PACKAGE_NAME}.json"
63+
else
64+
PACKAGE_VERSION="==$2"
65+
fi
66+
67+
rm -rvf /tmp/wheel
68+
mkdir /tmp/wheel
69+
pushd /tmp/wheel
70+
pip3 wheel ${PACKAGE_NAME}${PACKAGE_VERSION}
71+
# Can't build cytoolz using wheel for rlp, but can't build rlp with fpm
72+
rm -f /tmp/wheel/cytoolz*
73+
wheel2deb --config ${wheel2debconf}
74+
popd
75+
mv /tmp/wheel/output/*.deb ${OUTPUT_PATH}
76+
rm -rvf /tmp/wheel
77+
}
78+
79+
# Install any python requirements needed for the builds.
80+
pip3 install wheel2deb
81+
apt-get update -y && apt-get install -y debhelper
82+
4583
# build 3rd parties:
4684
# build_from_pypi <pypi-name> <version>
4785
# TODO duplicates list from Jenkinsfile.cd
4886

4987
SCRIPT_PATH="${BASH_SOURCE[0]}"
5088
pushd `dirname ${SCRIPT_PATH}` >/dev/null
5189

52-
build_from_pypi importlib-metadata 3.10.1
90+
build_from_pypi_wheel importlib-metadata 3.10.1
5391
build_from_pypi timeout-decorator
5492
build_from_pypi distro 1.7.0
5593

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# change setting for all wheels
2+
.:
3+
maintainer_name: "Hyperledger"
4+
maintainer_email: "[email protected]"
5+
extended_desc: "Hyperledger package for indy-plenum"
6+
version_template: "{upstream_version}"

0 commit comments

Comments
 (0)