Skip to content

Commit

Permalink
Add pi-fm-rds-git
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Dec 11, 2018
1 parent 768c12c commit cf28956
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pi-fm-rds/git/0001-Add-compile-flags-for-aarch64.patch
@@ -0,0 +1,26 @@
From f4648419ea49d653c97eb95211284877e519e48f Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Tue, 11 Dec 2018 18:31:12 +0000
Subject: [PATCH 1/2] Add compile flags for aarch64

---
src/Makefile | 3 +++
1 file changed, 3 insertions(+)

diff --git a/src/Makefile b/src/Makefile
index 0df77a3..6cebd28 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -12,6 +12,9 @@ ifeq ($(UNAME), armv6l)
else ifeq ($(UNAME), armv7l)
CFLAGS = $(STD_CFLAGS) -march=armv7-a -mtune=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp -ffast-math -DRASPI=2
TARGET = pi2
+else ifeq ($(UNAME), aarch64)
+ CFLAGS = $(STD_CFLAGS) -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -ffast-math -DRASPI=2
+ TARGET = pi2
else
CFLAGS = $(STD_CFLAGS)
TARGET = other
--
2.20.0

24 changes: 24 additions & 0 deletions pi-fm-rds/git/0002-Prevent-undefined-reference-to-makedev.patch
@@ -0,0 +1,24 @@
From 6586b4fa75d3fe190133364dcb29882dbf72154e Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Tue, 11 Dec 2018 18:31:37 +0000
Subject: [PATCH 2/2] Prevent "undefined reference to `makedev'"

---
src/mailbox.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/mailbox.c b/src/mailbox.c
index 902f6bb..0a5c7fc 100644
--- a/src/mailbox.c
+++ b/src/mailbox.c
@@ -35,6 +35,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>

#include "mailbox.h"

--
2.20.0

57 changes: 57 additions & 0 deletions pi-fm-rds/git/PKGBUILD
@@ -0,0 +1,57 @@
# Maintainer: Martchus <martchus@gmx.net>

# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.

_reponame=PiFmRds
pkgname=pi-fm-rds-git
_name=${pkgname%-git}
pkgver=65.e4e246e
pkgrel=1
arch=('armv6h' 'armv7h' 'aarch64')
pkgdesc="FM-RDS transmitter using the Raspberry Pi's PWM"
license=('GPL-3.0')
depends=('libsndfile')
optdepends=('python-scipy: generate_pulses and generate_waveforms'
'python-numpy: generate_pulses and generate_waveforms'
'python-matplotlib: generate_waveforms'
'python-pydemod: generate_waveforms')
makedepends=('git')
provides=("${_name}")
conflicts=("${_name}")
url="https://github.com/ChristopheJacquet/${_reponame}"
source=("${_reponame}::git://github.com/ChristopheJacquet/${_reponame}.git"
'0001-Add-compile-flags-for-aarch64.patch'
'0002-Prevent-undefined-reference-to-makedev.patch')
sha256sums=('SKIP'
'4d5727b0657de420d12908203e8b44fdea1c1adfc3bde451266da29008440c3b'
'b21eea03a5bf79398f46fce0b4d4f5c67af0938446458fe324b1726f6e28db90')

prepare() {
cd "$srcdir/$_reponame"

# apply patches; further descriptions can be found in patch files itself
for patch in "$srcdir/"*.patch; do
msg2 "Applying patch $patch"
patch -p1 -i "$patch"
done
}

pkgver() {
cd "$srcdir/$_reponame"
echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

build() {
cd "$srcdir/$_reponame/src"
make
make rds_wav
}

package() {
cd "$srcdir/$_reponame/src"
install -Dm0755 "pi_fm_rds" "$pkgdir/usr/bin/pi_fm_rds"
install -Dm0755 "rds_wav" "$pkgdir/usr/bin/rds_wav"
install -Dm0755 "generate_pulses.py" "$pkgdir/usr/bin/generate_pulses"
install -Dm0755 "generate_waveforms.py" "$pkgdir/usr/bin/generate_waveforms"
}

0 comments on commit cf28956

Please sign in to comment.