diff --git a/.gitignore b/.gitignore index 357702a..34a30be 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ cmake_install.cmake joycond install_manifest.txt .ccls-cache +build diff --git a/build_deb.sh b/build_deb.sh new file mode 100755 index 0000000..064a3a4 --- /dev/null +++ b/build_deb.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# This is a hacky little script to generate a deb. +# +# NOTE: This only works for building an arm64 .deb as is. Change +# the Architecture below if desired. + +architecture="arm64" +install_root="$(pwd)/build/deb/joycond" +package_version="0.1-0" + +mkdir -p "$install_root" || exit +cmake . || exit +make DESTDIR="$install_root" install || exit + +cd "$install_root" || exit + +mkdir -p DEBIAN +cd DEBIAN || exit + +cat < control +Package: joycond +Architecture: $architecture +Maintainer: Daniel J. Ogorchock +Priority: optional +Version: $package_version +Description: Pairs joy-cons together into a virtual controller +Depends: libevdev2, libudev1 +EOF + +cat < conffiles +EOF + +cat < postinst +#!/bin/bash +echo "Enabling and starting joycond service..." +systemctl enable --now joycond +EOF +chmod 755 postinst + +cd ../.. + +fakeroot dpkg-deb --build joycond || exit