pyside6-debian/build.sh

60 lines
2 KiB
Bash
Raw Normal View History

2023-05-25 15:44:45 +00:00
#!/bin/bash
2023-05-26 17:44:55 +00:00
2024-09-17 18:14:50 +00:00
DISTRIBUTION=${DISTRIBUTION:-noble}
2023-05-28 10:52:20 +00:00
REVISION=${REVISION:-1}
2023-05-26 17:44:55 +00:00
2023-05-25 15:44:45 +00:00
rm -rf output
2024-09-17 18:14:50 +00:00
rm -rf *.whl
rm wheel2deb.yml
2023-05-25 15:44:45 +00:00
# Download latest weels
python3 -m pip wheel PySide6-Essentials
python3 -m pip wheel PySide6-Addons
2024-09-17 18:14:50 +00:00
# Create wheel for distribution
cp wheel2deb.src.yml wheel2deb.yml
sed -i -e "s/\\[DIST\\]/$DISTRIBUTION/g" wheel2deb.yml
2023-05-25 15:44:45 +00:00
wheel2deb convert -c ./wheel2deb.yml
echo -e "\n[Writing modifications]\n"
for i in output/*; do
cp copyright "$i/debian" # Add copyrights
perl -i -p0e 's/python3 \(<< 3.(\d)+\),//gm' "$i/debian/control" # Remove upper limit from control.
2023-05-26 17:44:55 +00:00
sed -i "s/stable;/$DISTRIBUTION;/g" "$i/debian/changelog" # Change distribution.
2023-05-28 10:52:20 +00:00
sed -i "s/1~w2d0/$REVISION/g" "$i/debian/changelog" # Change suffix
mv "$i" "${i/1~w2d0/$REVISION}"
2023-05-25 15:44:45 +00:00
done
2024-09-27 20:30:53 +00:00
# Removing android deploy libs because they cause issues at installation.
rm -rf output/python3-pyside6-essentials_*_amd64/src/PySide6/scripts/deploy_lib/android
2023-05-26 17:44:55 +00:00
# Remove conflicting files between Essentials and Addons
2024-09-27 20:30:53 +00:00
rm output/python3-pyside6-addons_*_amd64/src/PySide6/{__init__.py,_config.py,_git_pyside_version.py,__feature__.pyi,py.typed}
for file in output/python3-pyside6-essentials_*_amd64/src/PySide6/Qt*.pyi; do
if [ ! -f "${file%.*}.abi3.so" ]; then
echo "Removing $file..."
rm "$file"
fi
done
for file in output/python3-pyside6-addons_*_amd64/src/PySide6/Qt*.pyi; do
if [ ! -f "${file%.*}.abi3.so" ]; then
echo "Removing $file..."
rm "$file"
fi
done
2024-09-17 18:14:50 +00:00
# Removing conflictual directories
rm -rf output/python3-pyside6-addons_*_amd64/src/shiboken6*
rm -rf output/python3-pyside6-essentials_*_amd64/src/shiboken6*
rm -rf output/python3-shiboken6_*_amd64/src/PySide6
function filter() { cat "$1" | awk "$2" > "$1"; }
2024-09-27 20:30:53 +00:00
# filter output/python3-shiboken6_*_amd64/debian/install '/^src\/shiboken6/ { print $0; }'
# filter output/python3-pyside6-essentials_*_amd64/debian/install '/^src\/PySide6/ { print $0; }'
# filter output/python3-pyside6-addons_*_amd64/debian/install '/^src\/PySide6/ { print $0; }'