Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use debhelper tools for dependency compilation and packaging #408

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
9 changes: 8 additions & 1 deletion Dockerfile.agnos
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
ccache \
clang \
curl \
checkinstall \
dh-make \
dpkg-dev \
git \
pkg-config \
wget

# Enable ccache
ENV PATH="/usr/lib/ccache:$PATH"
ENV CCACHE_DIR=/root/.ccache

# For debhelper
ENV DEB_BUILD_OPTIONS=nocheck
ENV DEBFULLNAME=comma
ENV USER=comma

# capnproto
FROM agnos-compiler AS agnos-compiler-capnp
Expand Down
10 changes: 4 additions & 6 deletions userspace/compile-capnp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ cd /tmp
wget https://capnproto.org/capnproto-c++-${VERSION}.tar.gz
tar xvf capnproto-c++-${VERSION}.tar.gz
cd capnproto-c++-${VERSION}
CXXFLAGS="-fPIC -O2" ./configure

make -j$(nproc)
dh_make --createorig -s -p capnproto_${VERSION} -y

# remove "--fstrans=no" when checkinstall is fixed (still not fixed in 24.04)
# https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/78455
checkinstall -yD --install=no --fstrans=no --pkgname=capnproto
mv capnproto*.deb /tmp/capnproto.deb
dpkg-buildpackage -us -uc -nc

mv ../capnproto*.deb /tmp/capnproto.deb
13 changes: 7 additions & 6 deletions userspace/compile-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ wget https://ffmpeg.org/releases/ffmpeg-${VERSION}.tar.bz2
tar xvf ffmpeg-${VERSION}.tar.bz2
cd ffmpeg-${VERSION}

dh_make --createorig -s -p ffmpeg_${VERSION} -y

# avoid makeinfo: error parsing ./doc/t2h.pm: Undefined subroutine &Texinfo::Config::set_from_init_file called at ./doc/t2h.pm line 24.
# with --disable-htmlpages
# --disable-doc works too, disables building documentation completely
# https://gist.github.com/omegdadi/6904512c0a948225c81114b1c5acb875
# https://github.com/7Ji/archrepo/issues/10
./configure --enable-shared --disable-static --disable-htmlpages
make -j$(nproc)
echo -e "override_dh_auto_configure:\n\t./configure --enable-shared --disable-static --disable-htmlpages" >> debian/rules
echo -e "override_dh_usrlocal:" >> debian/rules

dpkg-buildpackage -us -uc -nc

# remove "--fstrans=no" when checkinstall is fixed (still not fixed in 24.04)
# # https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/78455
checkinstall -yD --install=no --fstrans=no --pkgname=ffmpeg
mv ffmpeg*.deb /tmp/ffmpeg.deb
mv ../ffmpeg*.deb /tmp/ffmpeg.deb
159 changes: 82 additions & 77 deletions userspace/compile-modemmanager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,97 +6,102 @@ LIBQMI_VERSION="1.34.0"

cd /tmp

# meson support for checkinstall
git clone https://github.com/keithbowes/meson-install.git

# libqmi
apt-get update && apt-get install -yq --no-install-recommends \
bash-completion \
gobject-introspection \
gtk-doc-tools \
help2man \
libgirepository1.0-dev \
libglib2.0-dev \
libgudev-1.0-dev \
meson \
ninja-build \
bash-completion \
gobject-introspection \
gtk-doc-tools \
help2man \
libgirepository1.0-dev \
libglib2.0-dev \
libgudev-1.0-dev \
meson \
ninja-build \

git clone -b $LIBQMI_VERSION --depth 1 https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
cd libqmi
meson setup build --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu -Dmbim_qmux=false -Dqrtr=false
ninja -C build

cd build
checkinstall -yD --install=no --fstrans=no --pkgname=libqmi /tmp/meson-install/meson-install
mv libqmi*.deb /tmp/libqmi.deb
dh_make --createorig -s -p libqmi_${LIBQMI_VERSION} -y

echo -e "override_dh_auto_configure:\n\tdh_auto_configure -- --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu -Dmbim_qmux=false -Dqrtr=false" >> debian/rules

dpkg-buildpackage -us -uc -nc

mv ../libqmi*.deb /tmp/libqmi.deb

# ModemManager
cd /tmp

git clone -b $MM_VERSION --depth 1 https://gitlab.freedesktop.org/mobile-broadband/ModemManager.git

apt-get install -y --no-install-recommends \
cmake \
gettext \
libdbus-1-dev \
libpolkit-gobject-1-dev \
libsystemd-dev \
udev
cmake \
gettext \
libdbus-1-dev \
libpolkit-gobject-1-dev \
libsystemd-dev \
udev

apt-get -o Dpkg::Options::="--force-overwrite" install -yq /tmp/libqmi.deb

cd ModemManager
meson setup build \
--prefix=/usr \
--libdir=/usr/lib/aarch64-linux-gnu \
--sysconfdir=/etc \
--buildtype=release \
-Dqmi=true \
-Dmbim=false \
-Dqrtr=false \
-Dplugin_generic=enabled \
-Dplugin_altair_lte=disabled \
-Dplugin_anydata=disabled \
-Dplugin_broadmobi=disabled \
-Dplugin_cinterion=disabled \
-Dplugin_dell=disabled \
-Dplugin_dlink=disabled \
-Dplugin_fibocom=disabled \
-Dplugin_foxconn=disabled \
-Dplugin_gosuncn=disabled \
-Dplugin_haier=disabled \
-Dplugin_huawei=disabled \
-Dplugin_intel=disabled \
-Dplugin_iridium=disabled \
-Dplugin_linktop=disabled \
-Dplugin_longcheer=disabled \
-Dplugin_mbm=disabled \
-Dplugin_motorola=disabled \
-Dplugin_mtk=disabled \
-Dplugin_nokia=disabled \
-Dplugin_nokia_icera=disabled \
-Dplugin_novatel=disabled \
-Dplugin_novatel_lte=disabled \
-Dplugin_option=disabled \
-Dplugin_option_hso=disabled \
-Dplugin_pantech=disabled \
-Dplugin_qcom_soc=disabled \
-Dplugin_quectel=enabled \
-Dplugin_samsung=disabled \
-Dplugin_sierra_legacy=disabled \
-Dplugin_sierra=disabled \
-Dplugin_simtech=disabled \
-Dplugin_telit=disabled \
-Dplugin_thuraya=disabled \
-Dplugin_tplink=disabled \
-Dplugin_ublox=disabled \
-Dplugin_via=disabled \
-Dplugin_wavecom=disabled \
-Dplugin_x22x=disabled \
-Dplugin_zte=disabled

ninja -C build

cd build
checkinstall -yD --install=no --fstrans=no --pkgname=modemmanager /tmp/meson-install/meson-install
mv modemmanager*.deb /tmp/modemmanager.deb

dh_make --createorig -s -p modemmanager_${MM_VERSION} -y


cat <<EOF >> debian/rules
override_dh_auto_configure:
dh_auto_configure -- \
--prefix=/usr \
--libdir=/usr/lib/aarch64-linux-gnu \
--sysconfdir=/etc \
--buildtype=release \
-Dqmi=true \
-Dmbim=false \
-Dqrtr=false \
-Dplugin_generic=enabled \
-Dplugin_altair_lte=disabled \
-Dplugin_anydata=disabled \
-Dplugin_broadmobi=disabled \
-Dplugin_cinterion=disabled \
-Dplugin_dell=disabled \
-Dplugin_dlink=disabled \
-Dplugin_fibocom=disabled \
-Dplugin_foxconn=disabled \
-Dplugin_gosuncn=disabled \
-Dplugin_haier=disabled \
-Dplugin_huawei=disabled \
-Dplugin_intel=disabled \
-Dplugin_iridium=disabled \
-Dplugin_linktop=disabled \
-Dplugin_longcheer=disabled \
-Dplugin_mbm=disabled \
-Dplugin_motorola=disabled \
-Dplugin_mtk=disabled \
-Dplugin_nokia=disabled \
-Dplugin_nokia_icera=disabled \
-Dplugin_novatel=disabled \
-Dplugin_novatel_lte=disabled \
-Dplugin_option=disabled \
-Dplugin_option_hso=disabled \
-Dplugin_pantech=disabled \
-Dplugin_qcom_soc=disabled \
-Dplugin_quectel=enabled \
-Dplugin_samsung=disabled \
-Dplugin_sierra_legacy=disabled \
-Dplugin_sierra=disabled \
-Dplugin_simtech=disabled \
-Dplugin_telit=disabled \
-Dplugin_thuraya=disabled \
-Dplugin_tplink=disabled \
-Dplugin_ublox=disabled \
-Dplugin_via=disabled \
-Dplugin_wavecom=disabled \
-Dplugin_x22x=disabled \
-Dplugin_zte=disabled
EOF
sed -i 's/^ /\t/' debian/rules

dpkg-buildpackage -us -uc -nc

mv ../modemmanager*.deb /tmp/modemmanager.deb
13 changes: 5 additions & 8 deletions userspace/compile-qtwayland5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ git apply /tmp/agnos/patch-qtwayland-v5.12
# https://stackoverflow.com/a/75855054/639708
ln -s libdl.so.2 /usr/lib/aarch64-linux-gnu/libdl.so

mkdir /tmp/build && cd /tmp/build
qmake /tmp/qtwayland
dh_make --createorig -s -p qtwayland5_${VERSION} -y

export MAKEFLAGS="-j$(nproc)"
make
echo -e "override_dh_shlibdeps:\n\tdh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info" >> debian/rules

# remove "--fstrans=no" when checkinstall is fixed (still not fixed in 24.04)
# # https://bugs.launchpad.net/ubuntu/+source/checkinstall/+bug/78455
checkinstall -yD --install=no --fstrans=no --pkgversion="${VERSION}" --pkgname=qtwayland5 --pkgarch=arm64 --replaces=qtwayland5,libqt5waylandclient5,libqt5waylandcompositor5
mv qtwayland5*.deb /tmp/qtwayland5.deb
dpkg-buildpackage -us -uc -nc

mv ../qtwayland5*.deb /tmp/qtwayland5.deb