Skip to content

Commit

Permalink
dietpi-software: WiringPi: Add support for Orange Pi boards
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng committed Feb 28, 2025
1 parent 48ab49d commit a0a6f07
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
v9.12
(2025-03-22)

Enhancemnts:
- WiringPi | Added support for Orange Pi boards, using the wiringOP sources from Xunlong: https://github.com/orangepi-xunlong/wiringOP

Bug fixes:

As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/ADDME
Expand Down
32 changes: 29 additions & 3 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,8 @@ Available commands:
aSOFTWARE_DESC[$software_id]='GPIO interface library (C)'
aSOFTWARE_CATX[$software_id]=10
aSOFTWARE_DOCS[$software_id]='https://dietpi.com/docs/software/hardware_projects/#wiringpi'
# RPi + Odroids only
(( $G_HW_MODEL > 19 )) && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0
# RPi, Odroids and Orange Pi only
(( $G_HW_MODEL > 19 )) && [[ $G_HW_MODEL != ^(80|82|83|87|88|89|91|93)$ ]] && aSOFTWARE_AVAIL_G_HW_MODEL[$software_id,$G_HW_MODEL]=0
#------------------
software_id=71
aSOFTWARE_NAME[$software_id]='WebIOPi'
Expand Down Expand Up @@ -6219,7 +6219,8 @@ See the manual below for instructions on how to do this.
G_EXEC_OUTPUT=1 G_EXEC ./build

# Odroids
else
elif (( $G_HW_MODEL < 20 ))
then
aDEPS+=('automake' 'libtool' 'pkg-config' 'libgpiod-dev' 'libgpiod2') # Add libgpiod2 explicitly so purging *-dev packages, e.g. via dietpi-cleaner, does not break "gpio"
Download_Install 'https://github.com/hardkernel/wiringPi/archive/master.tar.gz'
G_EXEC mv {w,W}iringPi-master
Expand All @@ -6228,6 +6229,29 @@ See the manual below for instructions on how to do this.
G_EXEC_OUTPUT=1 G_EXEC ./configure CFLAGS='-g0 -O3'
G_EXEC_OUTPUT=1 G_EXEC make "-j$(nproc)"
G_EXEC_OUTPUT=1 G_EXEC make install

# Orange Pi
else
# Requires /etc/orangepi-release or /etc/armbian-release with BOARD name
local board=
case $G_HW_MODEL in
80) board='orangepi5';;
82) board='orangepi5plus';;
83) board='orangepizero3';;
87) board='orangepi3b';;
88) board='orangepizero2w';;
89) board='orangepi3-lts';;
91) board='orangepi5max';;
93) board='orangepi5pro';;
*) G_DIETPI-NOTIFY 1 "Invalid hardware model \"$G_HW_MODEL_NAME\" (ID \"$G_HW_MODEL\"). Aborting ..."; exit 1;;
esac
>> /etc/orangepi-release
GCI_PRESERVE=1 G_CONFIG_INJECT 'BOARD=' "BOARD=$board" /etc/orangepi-release
Download_Install 'https://github.com/orangepi-xunlong/wiringOP/archive/next.tar.gz'
G_EXEC mv wiringOP-next WiringPi-master
G_EXEC cd WiringPi-master
G_EXEC mkdir -p /usr/local/include
G_EXEC_OUTPUT=1 G_EXEC ./build
fi

G_EXEC strip --remove-section=.comment --remove-section=.note /usr/local/*bin/gpio
Expand Down Expand Up @@ -13304,6 +13328,8 @@ _EOF_
G_EXEC rm -f /usr/local/lib/libwiringPiDev.so*
# Headers
G_EXEC rm -f /usr/local/include/wiringPi*.h
# Orange Pi
[[ -f '/etc/orangepi-release' ]] && grep -q '^# Added by DietPi:$' /etc/orangepi-release && G_EXEC rm /etc/orangepi-release
fi

if To_Uninstall 61 # Tor Hotspot
Expand Down

0 comments on commit a0a6f07

Please sign in to comment.