2021-07-17 13:28:45 +02:00
|
|
|
#!/bin/sh
|
2023-02-11 23:50:01 +01:00
|
|
|
|
2021-07-17 13:28:45 +02:00
|
|
|
set -e
|
|
|
|
|
2023-02-11 23:50:01 +01:00
|
|
|
breakline() {
|
|
|
|
printf "================================================================================\n\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Configured in the CI step
|
|
|
|
install_prefix="appdir/usr"
|
|
|
|
|
|
|
|
# The directory we finally pack into our .deb package
|
|
|
|
packaging_dir="package"
|
|
|
|
|
2024-08-26 00:01:14 +02:00
|
|
|
# Get the Ubuntu Release (e.g. 20.04, 22.04 or 24.04)
|
2023-02-11 23:50:01 +01:00
|
|
|
ubuntu_release="$(lsb_release -rs)"
|
|
|
|
|
2023-02-13 10:34:40 +01:00
|
|
|
# The final path where we'll save the .deb package
|
2023-02-13 11:33:25 +01:00
|
|
|
deb_path="Chatterino-ubuntu-${ubuntu_release}-x86_64.deb"
|
2023-02-13 10:34:40 +01:00
|
|
|
|
2023-02-11 23:50:01 +01:00
|
|
|
# Refactor opportunity:
|
|
|
|
case "$ubuntu_release" in
|
|
|
|
20.04)
|
2024-02-10 12:47:15 +01:00
|
|
|
# Qt6 static-linked deb, see https://github.com/Chatterino/docker
|
2024-08-26 00:01:14 +02:00
|
|
|
dependencies="libc6, libstdc++6, libblkid1, libbsd0, libexpat1, libffi7, libfontconfig1, libfreetype6, libglib2.0-0, libglvnd0, libglx0, libgraphite2-3, libharfbuzz0b, libicu66, libjpeg-turbo8, libmount1, libopengl0, libpcre2-16-0, libpcre3, libpng16-16, libselinux1, libssl1.1, libuuid1, libx11-xcb1, libxau6, libxcb1, libxcb-cursor0, libxcb-glx0, libxcb-icccm4, libxcb-image0, libxcb-keysyms1, libxcb-randr0, libxcb-render0, libxcb-render-util0, libxcb-shape0, libxcb-shm0, libxcb-sync1, libxcb-util1, libxcb-xfixes0, libxcb-xkb1, libxdmcp6, libxkbcommon0, libxkbcommon-x11-0, zlib1g"
|
2023-02-11 23:50:01 +01:00
|
|
|
;;
|
|
|
|
22.04)
|
2024-02-10 12:47:15 +01:00
|
|
|
# Qt6 static-linked deb, see https://github.com/Chatterino/docker
|
2024-08-26 00:01:14 +02:00
|
|
|
dependencies="libc6, libstdc++6, libglx0, libopengl0, libpng16-16, libharfbuzz0b, libfreetype6, libfontconfig1, libjpeg-turbo8, libxcb-glx0, libegl1, libx11-6, libxkbcommon0, libx11-xcb1, libxkbcommon-x11-0, libxcb-cursor0, libxcb-icccm4, libxcb-image0, libxcb-keysyms1, libxcb-randr0, libxcb-render-util0, libxcb-shm0, libxcb-sync1, libxcb-xfixes0, libxcb-render0, libxcb-shape0, libxcb-xkb1, libxcb1, libbrotli1, libglib2.0-0, zlib1g, libicu70, libpcre2-16-0, libssl3, libgraphite2-3, libexpat1, libuuid1, libxcb-util1, libxau6, libxdmcp6, libffi8, libmount1, libselinux1, libpcre3, libbsd0, libblkid1, libpcre2-8-0, libmd0"
|
|
|
|
;;
|
|
|
|
24.04)
|
|
|
|
# Qt6 static-linked deb, see https://github.com/Chatterino/docker
|
|
|
|
dependencies="libc6, libstdc++6, libglx0, libopengl0, libpng16-16, libharfbuzz0b, libfreetype6, libfontconfig1, libjpeg-turbo8, libxcb-glx0, libegl1, libx11-6, libxkbcommon0, libx11-xcb1, libxkbcommon-x11-0, libxcb-cursor0, libxcb-icccm4, libxcb-image0, libxcb-keysyms1, libxcb-randr0, libxcb-render-util0, libxcb-shm0, libxcb-sync1, libxcb-xfixes0, libxcb-render0, libxcb-shape0, libxcb-xkb1, libxcb1, libbrotli1, libglib2.0-0, zlib1g, libicu74, libpcre2-16-0, libssl3, libgraphite2-3, libexpat1, libuuid1, libxcb-util1, libxau6, libxdmcp6, libffi8, libmount1, libselinux1, libpcre3, libbsd0, libblkid1, libpcre2-8-0, libmd0"
|
2023-02-11 23:50:01 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unsupported Ubuntu release $ubuntu_release"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
echo "Building Ubuntu .deb file on '$ubuntu_release'"
|
|
|
|
echo "Dependencies: $dependencies"
|
|
|
|
|
2021-07-17 13:28:45 +02:00
|
|
|
if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then
|
|
|
|
echo "ERROR: No chatterino binary file found. This script must be run in the build folder, and chatterino must be built first."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-02-13 22:39:59 +01:00
|
|
|
chatterino_version=$(git describe 2>/dev/null) || true
|
|
|
|
if [ "$(echo "$chatterino_version" | cut -c1-1)" = 'v' ]; then
|
|
|
|
chatterino_version="$(echo "$chatterino_version" | cut -c2-)"
|
|
|
|
else
|
2022-11-08 23:07:44 +01:00
|
|
|
chatterino_version="0.0.0-dev"
|
|
|
|
fi
|
2021-07-17 13:28:45 +02:00
|
|
|
|
2023-02-11 23:50:01 +01:00
|
|
|
# Make sure no old remnants of a previous packaging remains
|
|
|
|
rm -vrf "$packaging_dir"
|
2021-07-17 13:28:45 +02:00
|
|
|
|
2023-02-11 23:50:01 +01:00
|
|
|
mkdir -p "$packaging_dir/DEBIAN"
|
2021-07-17 13:28:45 +02:00
|
|
|
|
|
|
|
echo "Making control file"
|
|
|
|
cat >> "$packaging_dir/DEBIAN/control" << EOF
|
|
|
|
Package: chatterino
|
2023-02-11 23:50:01 +01:00
|
|
|
Version: $chatterino_version
|
2021-07-17 13:28:45 +02:00
|
|
|
Architecture: amd64
|
|
|
|
Maintainer: Mm2PL <mm2pl@kotmisia.pl>
|
2023-02-11 23:50:01 +01:00
|
|
|
Depends: $dependencies
|
|
|
|
Section: net
|
|
|
|
Priority: optional
|
|
|
|
Homepage: https://github.com/Chatterino/chatterino2
|
|
|
|
Description: Ubuntu package built for $ubuntu_release
|
2021-07-17 13:28:45 +02:00
|
|
|
EOF
|
2023-02-11 23:50:01 +01:00
|
|
|
cat "$packaging_dir/DEBIAN/control"
|
|
|
|
breakline
|
|
|
|
|
|
|
|
|
|
|
|
echo "Running make install"
|
|
|
|
make install
|
|
|
|
find "$install_prefix"
|
|
|
|
breakline
|
|
|
|
|
|
|
|
|
|
|
|
echo "Merge install into packaging dir"
|
|
|
|
cp -rv "$install_prefix/" "$packaging_dir/"
|
|
|
|
find "$packaging_dir"
|
|
|
|
breakline
|
2021-07-17 13:28:45 +02:00
|
|
|
|
|
|
|
|
2023-02-11 23:50:01 +01:00
|
|
|
echo "Building package"
|
2023-02-13 10:34:40 +01:00
|
|
|
dpkg-deb --build "$packaging_dir" "$deb_path"
|
2023-02-11 23:50:01 +01:00
|
|
|
breakline
|
|
|
|
|
|
|
|
|
|
|
|
echo "Package info"
|
2023-02-13 10:34:40 +01:00
|
|
|
dpkg --info "$deb_path"
|
2023-02-11 23:50:01 +01:00
|
|
|
breakline
|
|
|
|
|
|
|
|
|
|
|
|
echo "Package contents"
|
2023-02-13 10:34:40 +01:00
|
|
|
dpkg --contents "$deb_path"
|
2023-02-11 23:50:01 +01:00
|
|
|
breakline
|