forked from flathub/org.gaphor.Gaphor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdepends.sh
32 lines (26 loc) · 890 Bytes
/
depends.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -euo pipefail
GAPHOR_VERSION=${1}
BUILD=build/pip
mkdir -p ${BUILD}
pip3 download -q --no-binary dulwich --no-binary pillow --dest ${BUILD} --extra-index-url https://pypi.org/simple gaphor=="${GAPHOR_VERSION}" setuptools_rust wheel
cat << EOF
name: gaphor-bin
buildsystem: simple
build-commands:
- pip3 install --no-index --no-cache-dir --find-links="file://\${PWD}" setuptools_rust wheel
- pip3 install --no-index --no-cache-dir --find-links="file://\${PWD}" --prefix=\${FLATPAK_DEST} gaphor
sources:
EOF
find ${BUILD} -type f -printf '%P\n' | awk -F- '{ print $1 " " $0 }' | \
while read -r DEP FILE
do
curl -sSfL https://pypi.org/pypi/"${DEP}"/json | jq -r '.releases[][] |
select(.filename == "'"${FILE}"'") | "\(.digests.sha256) \(.url)"'
done | \
while read -r SHA URL
do
echo " - type: file"
echo " url: ${URL}"
echo " sha256: ${SHA}"
done