diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8ea4d8a6..3de1d34c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,15 +20,20 @@ stages: before_script: - echo "started by ${GITLAB_USER_NAME}" +#reusable templates +.ccache_init: &ccache_init + before_script: + - apt update + - apt install -y build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf wget git + #-----------------------------------------------------------------------# # Linux (AppImage) 32-bit Build Target # #-----------------------------------------------------------------------# build_linux_32: + <<: *ccache_init image: i386/ubuntu:bionic stage: build script: - - apt update - - apt install -y build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf wget git - ./scripts/build-appimage-32.sh artifacts: @@ -40,18 +45,60 @@ build_linux_32: # Linux (AppImage) 64-bit Build Target # #-----------------------------------------------------------------------# build_linux_64: + <<: *ccache_init image: ubuntu:bionic stage: build script: - - apt update - - apt install -y build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf wget git - ./scripts/build-appimage.sh artifacts: paths: - OpenRGB-x86_64.AppImage expire_in: 30 days - + +#-----------------------------------------------------------------------# +# Linux (.deb) 32-bit Build Target # +#-----------------------------------------------------------------------# +build_linux_deb32: + <<: *ccache_init + image: i386/ubuntu:bionic + stage: build + script: + - apt install -y debhelper + - export $( dpkg-architecture -s --target-arch i386; ) + - dpkg-architecture -l + - dpkg-buildpackage --target-arch i386 -us -B + - rm -v ../openrgb-dbgsym*.ddeb + - mv -v ../openrgb*.deb ./ + + artifacts: + paths: + - openrgb*.deb + exclude: + - openrgb-dbgsym*.deb + expire_in: 30 days + +#-----------------------------------------------------------------------# +# Linux (.deb) 64-bit Build Target # +#-----------------------------------------------------------------------# +build_linux_deb64: + <<: *ccache_init + image: ubuntu:bionic + stage: build + script: + - apt install -y debhelper + - dpkg-architecture -l + - dpkg-buildpackage -us -B + - rm -v ../openrgb-dbgsym*.ddeb + - mv -v ../openrgb*.deb ./ + + artifacts: + paths: + - openrgb*.deb + exclude: + - openrgb-dbgsym*.deb + expire_in: 30 days + #-----------------------------------------------------------------------# # Windows (32-bit) Build Target # #-----------------------------------------------------------------------# diff --git a/OpenRGB.pro b/OpenRGB.pro index 1ced5f09..a9966271 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -681,7 +681,9 @@ unix:!macx { desktop.files+=qt/OpenRGB.desktop pixmap.path=$$PREFIX/share/pixmaps/ pixmap.files+=qt/OpenRGB.png - INSTALLS += target desktop pixmap + rules.path=/lib/udev/rules.d/ + rules.files+=60-openrgb.rules + INSTALLS += target desktop pixmap rules } unix:!macx:CONFIG(asan) { @@ -711,3 +713,7 @@ unix:macx { CONFIG += \ c++14 \ } + +DISTFILES += \ + debian/openrgb-udev.postinst \ + debian/openrgb.postinst diff --git a/debian/control b/debian/control index 2e94b92b..9ab9867b 100644 --- a/debian/control +++ b/debian/control @@ -16,10 +16,11 @@ Homepage: https://gitlab.com/CalcProgrammer1/OpenRGB Package: openrgb Architecture: any Depends: + udev, ${shlibs:Depends}, ${misc:Depends}, Recommends: - openrgb-udev, + openrazer-driver-dkms, openrgb-dkms-drivers, Description: Open source RGB lighting control OpenRGB controls RGB lighting diff --git a/debian/files b/debian/files index 0fbf2353..a7bc733c 100644 --- a/debian/files +++ b/debian/files @@ -1 +1,3 @@ -openrgb_0.41.1_source.buildinfo misc optional +openrgb-dbgsym_0.41.1_amd64.ddeb debug optional automatic=yes +openrgb_0.41.1_amd64.buildinfo misc optional +openrgb_0.41.1_amd64.deb misc optional diff --git a/debian/openrgb.install b/debian/openrgb.install index 3ba5ed31..49a1a731 100644 --- a/debian/openrgb.install +++ b/debian/openrgb.install @@ -1,3 +1,4 @@ /usr/bin/ /usr/share/applications/ /usr/share/pixmaps +/lib/udev/rules.d/ diff --git a/debian/openrgb.postinst b/debian/openrgb.postinst new file mode 100644 index 00000000..db2037e5 --- /dev/null +++ b/debian/openrgb.postinst @@ -0,0 +1,17 @@ +#!/bin/bash + +# -e is not set should this step fail for whatever reason the installation is still valid +set -u -o pipefail + +# Reload rules +if [ -f /bin/udevadm ]; then + udevadm control --reload-rules && udevadm trigger; +else + echo + echo "\/-------------------------------------------------------\\" + echo "\| Critical: This system does not have udev installed. \|" + echo "\| \|" + echo "\| Please install udev with: sudo apt -y install udev \|" + echo "\\-------------------------------------------------------\/" + echo +fi