-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github/workflow: creates deb for Ubuntu 22.04
Include files to generate debs, targeting Ubuntu 22.04. Uses the ENABLE_PACKAGING cmake flag to generate the packages. Uses dependencies available in the main package manager repositories. The workflow runs in master, this branch and on published release. Can also create rpm, but this is not uploaded by the workflow. Note: Ubuntu libcurl4 flavor is openssl, rpm generated in Ubuntu will mostly not work with Fedora/OpenSUSE. Signed-off-by: Jorge Marques <[email protected]>
- Loading branch information
Showing
3 changed files
with
94 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
on: | ||
push: | ||
branches: [master, deb] | ||
release: | ||
type: [published] | ||
name: deb build for Ubuntu 22.04 | ||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get update && | ||
sudo apt-get install -y | ||
build-essential cmake git | ||
libgtk-3-dev libxml2-dev | ||
libcurl4-openssl-dev libad9361-dev | ||
libaio-dev libiio-dev libgtkdatabox-dev | ||
libjansson-dev libmatio-dev libfftw3-dev | ||
|
||
- name: Generate deb package | ||
run: mkdir build && cd $_ && | ||
cmake -DENABLE_PACKAGING=ON .. && make package | ||
|
||
- name: Upload deb package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: iio-oscilloscope-Ubuntu22.04.deb | ||
path: build/iio-oscilloscope-*-Linux.deb | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# support creating some basic binpkgs via `make package` | ||
set(CPACK_SET_DESTDIR ON) | ||
set(CPACK_GENERATOR TGZ) | ||
|
||
FIND_PROGRAM(RPMBUILD_CMD rpmbuild) | ||
if (RPMBUILD_CMD) | ||
# Check if optional dependency is included | ||
if(LIBAD9361_LIBRARIES) | ||
set(LIBAD9361_RPM ", libad9361 >= 0.2") | ||
endif() | ||
if(LIBAD9166_LIBRARIES) | ||
set(LIBAD9166_RPM ", libad9166 >= 0.2") | ||
endif() | ||
# Manual setup of rpm requires, Fedora >= 36 centric | ||
set(CPACK_PACKAGE_RELOCATABLE OFF) | ||
set(CPACK_GENERATOR ${CPACK_GENERATOR};RPM) | ||
set(CPACK_RPM_PACKAGE_REQUIRES "libiio >= 0.23, gtk3 >= 3.24, gtkdatabox >= 1.0.0, jansson >= 2.12, matio >= 1.5.17, fftw >= 3.3.8, curl >= 7.68.0${LIBAD9361_RPM}${LIBAD9166_RPM}") | ||
message(STATUS "Package dependencies (.rpm): " ${CPACK_RPM_PACKAGE_REQUIRES}) | ||
endif() | ||
|
||
FIND_PROGRAM(DEBBUILD_CMD dpkg) | ||
if (DEBBUILD_CMD) | ||
# Check if optional dependency is included | ||
if(LIBAD9361_LIBRARIES) | ||
set(LIBAD9361_DEB ", libad9361-0 (>= 0.2) | libad9361 (>= 0.2)") | ||
endif() | ||
if(LIBAD9166_LIBRARIES) | ||
set(LIBAD9166_DEB ", libad9166 (>= 0.2)") | ||
endif() | ||
set(CPACK_GENERATOR ${CPACK_GENERATOR};DEB) | ||
|
||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libiio0 (>= 0.23) | libiio (>= 0.23), libgtk-3-0 (>= 3.24.18), libgtkdatabox1 (>= 1.0.0), libjansson4 (>= 2.12), libmatio11 (>= 1.5.21), libfftw3-3 (>= 3.3.8), libcurl4 (>= 7.68.0)${LIBAD9361_DEB}${LIBAD9166_DEB}") | ||
message(STATUS "Package dependencies (.deb): " ${CPACK_DEBIAN_PACKAGE_DEPENDS}) | ||
endif() | ||
|
||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) | ||
set(CPACK_PACKAGE_VERSION_MAJOR ${OSC_VERSION_MAJOR}) | ||
set(CPACK_PACKAGE_VERSION_MINOR ${OSC_VERSION_MINOR}) | ||
set(CPACK_PACKAGE_VERSION_PATCH ${OSC_VERSION_GIT}) | ||
set(CPACK_BUNDLE_NAME osc) | ||
set(CPACK_PACKAGE_VERSION ${OSCIO_VERSION}) | ||
if (DEBBUILD_CMD) | ||
# debian specific package settings | ||
set(CPACK_PACKAGE_CONTACT "Engineerzone <https://ez.analog.com/sw-interface-tools>") | ||
endif() | ||
|
||
include(CPack) |