Browse Source

ARM builds

v2
Xerbo 1 year ago
parent
commit
8c6cba0aa3
No known key found for this signature in database GPG Key ID: 34103F6D8F11CEB0
5 changed files with 67 additions and 3 deletions
  1. +26
    -1
      .github/workflows/build.yml
  2. +1
    -0
      .gitignore
  3. +3
    -2
      CMakeLists.txt
  4. +18
    -0
      build_arm.sh
  5. +19
    -0
      cmake/toolchain-armhf.cmake

+ 26
- 1
.github/workflows/build.yml View File

@@ -72,10 +72,35 @@ jobs:
fetch-depth: 0 fetch-depth: 0


- name: Run build script - name: Run build script
run: vcvarsx86_amd64 & ./build_windows.bat
shell: cmd
run: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" & build_windows.bat


- name: Upload ZIP package - name: Upload ZIP package
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: ZIP package (MSVC) name: ZIP package (MSVC)
path: winbuild/aptdec_*.zip path: winbuild/aptdec_*.zip
build_linux_armhf:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0

- name: Run build script
run: docker run -v $(pwd):/aptdec:z -w /aptdec debian:11 ./build_arm.sh

- name: Upload DEB package
uses: actions/upload-artifact@v3
with:
name: DEB package (ARM)
path: build/aptdec_*.deb

- name: Upload TGZ package
uses: actions/upload-artifact@v3
with:
name: TGZ package (ARM)
path: build/aptdec_*.tar.gz

+ 1
- 0
.gitignore View File

@@ -89,3 +89,4 @@ zlib/
libpng/ libpng/
libsndfile-*-win64.zip libsndfile-*-win64.zip
libsndfile-*-win64/ libsndfile-*-win64/
root/

+ 3
- 2
CMakeLists.txt View File

@@ -79,13 +79,14 @@ endif()
install(TARGETS aptdec PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aptdec LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(TARGETS aptdec PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/aptdec LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})


# Packaging # Packaging
set(CPACK_PACKAGE_VERSION "${VERSION}")
string(REPLACE v "" CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
set(CPACK_PACKAGE_NAME "aptdec") set(CPACK_PACKAGE_NAME "aptdec")
set(CPACK_PACKAGE_CONTACT "Xerbo (xerbo@protonmail.com)") set(CPACK_PACKAGE_CONTACT "Xerbo (xerbo@protonmail.com)")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NOAA APT satellite imagery decoder") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NOAA APT satellite imagery decoder")
set(CPACK_PACKAGE_DESCRIPTION "Aptdec is a FOSS library/program that decodes images transmitted by the NOAA POES weather satellites. These satellites transmit constantly (among other things) medium resolution (4km/px) images of the earth over a analog mode called APT.") set(CPACK_PACKAGE_DESCRIPTION "Aptdec is a FOSS library/program that decodes images transmitted by the NOAA POES weather satellites. These satellites transmit constantly (among other things) medium resolution (4km/px) images of the earth over a analog mode called APT.")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsndfile1, libpng16-16")


if(WIN32) if(WIN32)
file(GLOB DLLS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/*.dll) file(GLOB DLLS ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/*.dll)


+ 18
- 0
build_arm.sh View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# This script only works on Debian Bullseye
# If you have docker this is trivially easy:
# docker run -v $(pwd):/aptdec:z -w /aptdec debian:11 ./build_arm.sh

apt-get update
apt-get install -y debootstrap cmake gcc-arm-linux-gnueabihf

# Prepare armhf root environment
if [ ! -d root ]; then
debootstrap --keyring=/usr/share/keyrings/debian-archive-keyring.gpg --arch=armhf --include=libsndfile1-dev,libpng-dev --download-only bullseye root http://deb.debian.org/debian/
for i in root/var/cache/apt/archives/*.deb; do dpkg -x "$i" root; done
fi

# Build aptdec
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain-armhf.cmake -DCMAKE_INSTALL_PREFIX=/aptdec/root
cmake --build build -j$(nproc)
cmake --build build --target package

+ 19
- 0
cmake/toolchain-armhf.cmake View File

@@ -0,0 +1,19 @@
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR armhf)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/arm-linux-gnueabihf/ ${CMAKE_INSTALL_PREFIX})
# Hack
link_directories(${CMAKE_INSTALL_PREFIX}/lib/arm-linux-gnueabihf)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

Loading…
Cancel
Save