2025-01-04 14:39:37 -05:00
|
|
|
#!/usr/bin/make -f
|
2025-01-05 11:22:11 -05:00
|
|
|
# export DH_VERBOSE = 1
|
2025-01-04 14:39:37 -05:00
|
|
|
|
|
|
|
|
# Use the "dh" sequencer
|
|
|
|
|
%:
|
|
|
|
|
dh $@
|
|
|
|
|
|
2025-01-05 11:22:11 -05:00
|
|
|
# https://docs.platformio.org/en/latest/envvars.html
|
|
|
|
|
PIO_ENV:=\
|
2025-01-05 16:26:31 -05:00
|
|
|
PLATFORMIO_CORE_DIR=pio/core \
|
2025-01-05 11:22:11 -05:00
|
|
|
PLATFORMIO_LIBDEPS_DIR=pio/libdeps \
|
|
|
|
|
PLATFORMIO_PACKAGES_DIR=pio/packages
|
|
|
|
|
|
2025-02-20 20:55:38 -05:00
|
|
|
# Raspbian armhf builds should be compatible with armv6-hardfloat
|
|
|
|
|
# https://www.valvers.com/open-software/raspberry-pi/bare-metal-programming-in-c-part-1/#rpi1-compiler-flags
|
|
|
|
|
ifneq (,$(findstring Raspbian,$(shell lsb_release -is)))
|
|
|
|
|
ifeq ($(DEB_BUILD_ARCH),armhf)
|
|
|
|
|
PIO_ENV+=\
|
|
|
|
|
PLATFORMIO_BUILD_FLAGS="-mfloat-abi=hard -mfpu=vfp -march=armv6zk"
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2025-01-04 14:39:37 -05:00
|
|
|
override_dh_auto_build:
|
2025-01-06 20:25:05 -05:00
|
|
|
# Extract tarballs within source deb
|
2025-01-05 19:58:34 -06:00
|
|
|
tar -xf pio.tar
|
2025-01-06 19:59:02 -06:00
|
|
|
mkdir -p web && tar -xf web.tar -C web
|
2025-01-06 20:25:05 -05:00
|
|
|
gunzip web/ -r
|
|
|
|
|
# Build with platformio
|
2025-01-05 11:22:11 -05:00
|
|
|
$(PIO_ENV) platformio run -e native
|
2025-01-04 14:39:37 -05:00
|
|
|
# Move the binary and default config to the correct name
|
|
|
|
|
mv .pio/build/native/program .pio/build/native/meshtasticd
|
2025-01-06 19:59:02 -06:00
|
|
|
cp bin/config-dist.yaml bin/config.yaml
|