From cf28956238a10b198849f32ad78233e3ceaf230c Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 11 Dec 2018 18:52:09 +0000 Subject: [PATCH] Add pi-fm-rds-git --- .../0001-Add-compile-flags-for-aarch64.patch | 26 +++++++++ ...event-undefined-reference-to-makedev.patch | 24 ++++++++ pi-fm-rds/git/PKGBUILD | 57 +++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 pi-fm-rds/git/0001-Add-compile-flags-for-aarch64.patch create mode 100644 pi-fm-rds/git/0002-Prevent-undefined-reference-to-makedev.patch create mode 100644 pi-fm-rds/git/PKGBUILD diff --git a/pi-fm-rds/git/0001-Add-compile-flags-for-aarch64.patch b/pi-fm-rds/git/0001-Add-compile-flags-for-aarch64.patch new file mode 100644 index 00000000..71f4a595 --- /dev/null +++ b/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 +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 + diff --git a/pi-fm-rds/git/0002-Prevent-undefined-reference-to-makedev.patch b/pi-fm-rds/git/0002-Prevent-undefined-reference-to-makedev.patch new file mode 100644 index 00000000..a9d400f3 --- /dev/null +++ b/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 +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 + #include + #include ++#include + + #include "mailbox.h" + +-- +2.20.0 + diff --git a/pi-fm-rds/git/PKGBUILD b/pi-fm-rds/git/PKGBUILD new file mode 100644 index 00000000..3b1e994d --- /dev/null +++ b/pi-fm-rds/git/PKGBUILD @@ -0,0 +1,57 @@ +# Maintainer: Martchus + +# 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" +}