Skip to content

Commit

Permalink
Merge e8b4176 into 3f6528c
Browse files Browse the repository at this point in the history
  • Loading branch information
petterreinholdtsen authored Jul 16, 2022
2 parents 3f6528c + e8b4176 commit e4dd01d
Show file tree
Hide file tree
Showing 16 changed files with 338 additions and 503 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
sudo dpkg -i po4a_0.66-1_all.deb
codename=$(lsb_release -cs)
dch --maintmaint --distribution $codename "GitHub test package."
eatmydata debian/configure
eatmydata debuild -us -uc
sudo apt-get install ../*.deb
eatmydata ./scripts/runtests -p tests/
Expand Down
4 changes: 0 additions & 4 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
linuxcnc-uspace
files
rules
compat
control
tmp
linuxcnc
linuxcnc-dev
Expand All @@ -12,4 +9,3 @@ linuxcnc-doc-*/
/linuxcnc*.install
*.debhelper
shlibs.local
linuxcnc-uspace.lintian-overrides
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
141 changes: 8 additions & 133 deletions debian/configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ set -e
usage () {
P=${0##*/}
cat <<EOF
$P: Set up debian/ files to build for a particular kernel
$P: Obsolete script to set up debian/ files to build for a particular kernel
Usage:
$P [no-docs]
Extra options:
no-docs
Skip building documentation
$P
EOF
}

Expand All @@ -33,12 +29,7 @@ if [ "$1" == "-h" -o "$1" == "-help" -o "$1" == "--help" ]; then
exit 0
fi

EXTRA_FILES=
EXTRA_BUILD=
PYTHON_VERSION_NEXT=$(python3 -c 'import sys; print (sys.version[:2] + str(1+int(sys.version[2])))')
LIBREADLINE_DEV="libreadline-gplv2-dev | libreadline-dev"

ENABLE_BUILD_DOCUMENTATION=--enable-build-documentation=pdf
ENABLE_BUILD_DOCUMENTATION=yes

# Specialize these based on DISTRIB_NAME as needed
# These do not run-time depend on a specific package because
Expand All @@ -62,130 +53,14 @@ elif [ -f /etc/lsb-release ]; then
DISTRIB_NAME=$DISTRIB_ID-$DISTRIB_RELEASE
fi

EXTRAS=extras

if [ -n "$ENABLE_BUILD_DOCUMENTATION" ]; then
DOC_DEPENDS="asciidoc (>= 8.5),\n dblatex (>= 0.2.12),\n docbook-xsl,\n dvipng,\n ghostscript,\n graphviz,\n groff,\n imagemagick,\n inkscape,\n python3-lxml,\n source-highlight,\n w3c-linkchecker,\n xsltproc,\n texlive-extra-utils,\n texlive-font-utils,\n texlive-fonts-recommended,\n texlive-lang-cyrillic,\n texlive-lang-french,\n texlive-lang-german,\n texlive-lang-polish,\n texlive-lang-spanish,\n texlive-latex-recommended,\n asciidoc-dblatex"

case $DISTRIB_NAME in
Debian-9)
;; # No xetex in Debian 9 Stretch
*)
# Not quite sure which packages is needed for xetex, but
# texlive-xetex seem like a safe choice. Need xetex to be
# able to build Chinese PDF.
DOC_DEPENDS="$DOC_DEPENDS,\n texlive-xetex"
;;
esac
else
DOC_DEPENDS=''
fi

MODUTILS_DEPENDS=kmod
PYTHON_PACKAGING_DEPENDS=dh-python
PYTHON_GST=python3-gst-1.0,gstreamer1.0-plugins-base
TCLTK_VERSION=8.6
PYTHON_IMAGING=python3-pil
PYTHON_IMAGING_TK=python3-pil.imagetk
QTVCP_DEPENDS="python3-pyqt5,\n python3-pyqt5.qsci,\n python3-pyqt5.qtsvg,\n python3-pyqt5.qtopengl,\n python3-opencv,\n python3-dbus,python3-espeak,\n python3-dbus.mainloop.pyqt5,\n python3-pyqt5.qtwebkit,\n espeak-ng,\n pyqt5-dev-tools,\n gstreamer1.0-tools,espeak,\n sound-theme-freedesktop"
YAPPS_RUNTIME="python3-yapps"
DEBHELPER="debhelper (>= 9)"
COMPAT="9"

case $DISTRIB_NAME in
Ubuntu-21.*|Debian-11|Debian-11.*|Debian-testing|Debian-unstable)
LIBREADLINE_DEV=libeditreadline-dev
COMPAT=""
DEBHELPER="debhelper-compat (= 13)"
;;
Ubuntu-20.*)
;;
Debian-10|Debian-10.*|Raspbian-10|Raspbian-10.*)
;;
*)
echo "unknown distribution: $DISTRIB_NAME"
echo "detected dependencies may be incomplete or wrong"
echo "please consider fixing it and submitting a pull request"
;;
esac

TARGET=uspace
MAIN_PACKAGE_NAME=linuxcnc
OTHER_MAIN_PACKAGE_NAME=linuxcnc-uspace
EXTRA_RECOMMENDS=hostmot2-firmware-all
MODULE_PATH=usr/lib/linuxcnc/modules
MODULE_EXT=.so
KERNEL_DEPENDS=libudev-dev,iptables
KERNEL_DEPENDS_BUILD=libudev-dev
KERNEL_HEADERS=
KERNEL_VERSION=uspace
MODUTILS_DEPENDS=
EXTRA_FILES="usr/bin/rtapi_app"
DISTRIB_NAME=uspace-$DISTRIB_NAME
MAIN_PACKAGE_NAME=linuxcnc-uspace
OTHER_MAIN_PACKAGE_NAME=linuxcnc

EXTRA_RECOMMENDS="$EXTRA_RECOMMENDS, linux-image-rt-amd64 [linux-amd64], linux-image-rt-686-pae [linux-i386]"
CONFIGURE_REALTIME_ARG=--with-realtime=uspace

subst () {
sed \
-e "s#@COMPAT@#$COMPAT#g" \
-e "s#@DEBHELPER@#$DEBHELPER#g" \
-e "s#@DISTRIB_NAME@#$DISTRIB_NAME#g" \
-e "s#@DOC_DEPENDS@#$DOC_DEPENDS#g" \
-e "s#@EXTRA_BUILD@#$EXTRA_BUILD#g" \
-e "s#@EXTRA_FILES@#$EXTRA_FILES#g" \
-e "s#@EXTRA_RECOMMENDS@#$EXTRA_RECOMMENDS#g" \
-e "s#@EXTRAS@#$EXTRAS#g" \
-e "s#@KERNEL_DEPENDS@#$KERNEL_DEPENDS#g" \
-e "s#@KERNEL_DEPENDS_BUILD@#$KERNEL_DEPENDS_BUILD#g" \
-e "s#@KERNEL_HEADERS@#$KERNEL_HEADERS#g" \
-e "s#@KERNEL_VERSION@#$KERNEL_VERSION#g" \
-e "s#@LIBREADLINE_DEV@#$LIBREADLINE_DEV#g" \
-e "s#@MAIN_PACKAGE_NAME@#$MAIN_PACKAGE_NAME#g" \
-e "s#@MODULE_EXT@#$MODULE_EXT#g" \
-e "s#@MODULE_PATH@#$MODULE_PATH#g" \
-e "s#@MODUTILS_DEPENDS@#$MODUTILS_DEPENDS#g" \
-e "s#@OTHER_MAIN_PACKAGE_NAME@#$OTHER_MAIN_PACKAGE_NAME#g" \
-e "s#@PYTHON_GST@#$PYTHON_GST#g" \
-e "s#@PYTHON_IMAGING@#$PYTHON_IMAGING#g" \
-e "s#@PYTHON_IMAGING_TK@#$PYTHON_IMAGING_TK#g" \
-e "s#@PYTHON_PACKAGING_DEPENDS@#$PYTHON_PACKAGING_DEPENDS#g" \
-e "s#@PYTHON_VERSION_NEXT@#$PYTHON_VERSION_NEXT#g" \
-e "s#@QTVCP_DEPENDS@#$QTVCP_DEPENDS#g" \
-e "s#@RTAI_ARCHITECTURE@#$RTAI_ARCHITECTURE#g" \
-e "s#@TARGET@#$TARGET#g" \
-e "s#@CONFIGURE_REALTIME_ARG@#$CONFIGURE_REALTIME_ARG#g" \
-e "s#@TCLTK_VERSION@#$TCLTK_VERSION#g" \
-e "s#@XENOMAI_ARCHITECTURE@#$XENOMAI_ARCHITECTURE#g" \
-e "s|@YAPPS_RUNTIME@|$YAPPS_RUNTIME|g" \
-e "s#@ENABLE_BUILD_DOCUMENTATION@#$ENABLE_BUILD_DOCUMENTATION#g" \
-e '/^\s*,\s*$/d' \
$*
}

if [[ -z "${COMPAT}" ]]; then
rm -f compat
else
subst compat.in > compat
if [ -z "$ENABLE_BUILD_DOCUMENTATION" ]; then
echo "error: No need to run debian/configure any more."
echo "To build without documentation use:"
echo " DEB_BUILD_OPTIONS=nodoc DEB_BUILD_PROFILES=nodoc debuild"
exit 1
fi

subst control.top.in > control

echo >> control
subst control.main-pkg.in >> control

subst linuxcnc.install.in > ${MAIN_PACKAGE_NAME}.install
subst linuxcnc.lintian-overrides.in > ${MAIN_PACKAGE_NAME}.lintian-overrides

subst rules.in > rules
chmod +x rules

if [ -n "$ENABLE_BUILD_DOCUMENTATION" ]; then
subst control.docs.in >> control
fi


rm -f ../build-stamp
echo "successfully configured for '$DISTRIB_NAME'.."
Loading

0 comments on commit e4dd01d

Please sign in to comment.