From 941843ba5f68b5afdd9c13b47fa95bbc6b2d603c Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:20:07 +0930
Subject: [PATCH 01/12] arcan: use -latomic on ppc

---
 srcpkgs/arcan/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/arcan/template b/srcpkgs/arcan/template
index 5dd372b486c..57c143cf3a7 100644
--- a/srcpkgs/arcan/template
+++ b/srcpkgs/arcan/template
@@ -26,7 +26,7 @@ case "${XBPS_TARGET_MACHINE}" in
 		configure_args+=" -DDISABLE_JIT=ON"
 		makedepends+=" MesaLib-devel lua51-devel"
 		;;
-	armv[56]*)
+	armv[56]*|ppc*)
 		configure_args+=" -DDISABLE_JIT=ON"
 		makedepends+=" MesaLib-devel lua51-devel libatomic-devel"
 		CFLAGS+=" -latomic"

From fe88743b8672f0eeb66af083bb38d085f0562f54 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:25:12 +0930
Subject: [PATCH 02/12] chatterino2: use -latomic on ppc

---
 srcpkgs/chatterino2/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chatterino2/template b/srcpkgs/chatterino2/template
index 663bfb354c6..3b08256d381 100644
--- a/srcpkgs/chatterino2/template
+++ b/srcpkgs/chatterino2/template
@@ -24,7 +24,7 @@ addb1ec2e06c40e6b467b4bdcdbca0407098fe36009c62ac7e92f157d47b2cb5
 5a5cd8338fcb0a14a4bbe0840f83505d0444a9000956145e85e5550feeb744b0"
 
 case "${XBPS_TARGET_MACHINE}" in
-	armv[56]*)
+	armv[56]*|ppc|ppc-musl)
 		makedepends+=" libatomic-devel"
 		configure_args+="LIBS+=-latomic"
 		;;

From 87600c5630657d2e12c50a42d86a5d3d156fc3f1 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:33:21 +0930
Subject: [PATCH 03/12] encfs: use -latomic on ppc

---
 srcpkgs/encfs/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/encfs/template b/srcpkgs/encfs/template
index 5af379b8f25..39ed4563dfe 100644
--- a/srcpkgs/encfs/template
+++ b/srcpkgs/encfs/template
@@ -17,7 +17,7 @@ checksum=4709f05395ccbad6c0a5b40a4619d60aafe3473b1a79bafb3aa700b1f756fd63
 if [ "$CROSS_BUILD" ]; then
 	configure_args="-DBUILD_UNIT_TESTS=0"
 	case "${XBPS_TARGET_MACHINE}" in
-		armv[56]*) makedepends+=" libatomic-devel"; LDFLAGS="-latomic" ;;
+		armv[56]*|ppc|ppc-musl) makedepends+=" libatomic-devel"; LDFLAGS="-latomic" ;;
 	esac
 fi
 

From fab8a47c9a4f3fe97fed75b632139524cf479867 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:35:02 +0930
Subject: [PATCH 04/12] fswatch: use -latomic on ppc

---
 srcpkgs/fswatch/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fswatch/template b/srcpkgs/fswatch/template
index f3ca3b312bf..781b69a56a0 100644
--- a/srcpkgs/fswatch/template
+++ b/srcpkgs/fswatch/template
@@ -13,7 +13,7 @@ distfiles="https://github.com/emcrisostomo/fswatch/releases/download/${version}/
 checksum=44d5707adc0e46d901ba95a5dc35c5cc282bd6f331fcf9dbf9fad4af0ed5b29d
 
 case "$XBPS_TARGET_MACHINE" in
-	armv[56]*)
+	armv[56]*|ppc|ppc-musl)
 		makedepends+=" libatomic-devel"
 		LDFLAGS=" -latomic"
 		;;

From a4f7cba0673e29ff8c64d7d59dfe3dd14032d1e7 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:36:34 +0930
Subject: [PATCH 05/12] haproxy: use -latomic on ppc

---
 srcpkgs/haproxy/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/haproxy/template b/srcpkgs/haproxy/template
index fa576622448..f14075402db 100644
--- a/srcpkgs/haproxy/template
+++ b/srcpkgs/haproxy/template
@@ -24,7 +24,7 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 
 case "$XBPS_TARGET_MACHINE" in
-	armv[56]*|mips*) ADDLIB="-latomic"; makedepends+=" libatomic-devel";;
+	armv[56]*|mips*|ppc|ppc-musl) ADDLIB="-latomic"; makedepends+=" libatomic-devel";;
 esac
 
 

From 5687da5a456c5662ca2f2e7716e77ab8e2d30dd8 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:37:51 +0930
Subject: [PATCH 06/12] jack_capture: use -latomic on ppc

---
 srcpkgs/jack_capture/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/jack_capture/template b/srcpkgs/jack_capture/template
index 60a3faef5d6..023e2d9139f 100644
--- a/srcpkgs/jack_capture/template
+++ b/srcpkgs/jack_capture/template
@@ -14,7 +14,7 @@ checksum=21afb0257ed7437708cc9e5bec2f6299599461b7eec8bf66967d8ecadb0751de
 CFLAGS+=" -D__USE_GNU"
 
 case "$XBPS_TARGET_MACHINE" in
-	armv6l*)
+	armv6l*|ppc|ppc-musl)
 		makedepends+=" libatomic-devel"
 		LDFLAGS+=" -latomic"
 		;;

From 46c61b8137998e41dd5c9fcbcf8e8a5ec8d51d2d Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 10:48:51 +0930
Subject: [PATCH 07/12] libbitcoin-explorer: use -latomic on ppc

---
 srcpkgs/libbitcoin-explorer/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libbitcoin-explorer/template b/srcpkgs/libbitcoin-explorer/template
index f56a5fd5802..76833b98186 100644
--- a/srcpkgs/libbitcoin-explorer/template
+++ b/srcpkgs/libbitcoin-explorer/template
@@ -20,7 +20,7 @@ checksum=630cffd577c0d10345b44ce8160f4604519b0ca69bf201f524f104c207b930aa
 conf_files="/etc/libbitcoin/bx.cfg"
 
 case "$XBPS_TARGET_MACHINE" in
-	armv6*) makedepends+=" libatomic-devel" LDFLAGS="-latomic" ;;
+	armv6*|ppc|ppc-musl) makedepends+=" libatomic-devel" LDFLAGS="-latomic" ;;
 esac
 
 pre_configure() {

From 439d1a6ac4c27fdf00af78209601f483c3ea9506 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 11:02:24 +0930
Subject: [PATCH 08/12] monero: use -latomic on ppc

---
 srcpkgs/monero/template | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/srcpkgs/monero/template b/srcpkgs/monero/template
index 380cb6fc1a3..678aaee9f3d 100644
--- a/srcpkgs/monero/template
+++ b/srcpkgs/monero/template
@@ -43,6 +43,10 @@ case "$XBPS_TARGET_MACHINE" in
 	;;
 	ppc64*) configure_args+=" -DARCH=ppc64"
 	;;
+	ppc*) configure_arch+=" -DARCH=ppc"
+                makedepends+=" libatomic-devel"
+                CFLAGS+=" -latomic"
+        ;;
 	*) configure_args+=" -DARCH=default"
 	;;
 esac

From 53378418f09f08d6be7ff70d3db2399561bcbcc2 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 11:02:45 +0930
Subject: [PATCH 09/12] monero-gui: use -latomic on ppc

---
 srcpkgs/monero-gui/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/monero-gui/template b/srcpkgs/monero-gui/template
index 9e7cd5459bd..417c25c04ad 100644
--- a/srcpkgs/monero-gui/template
+++ b/srcpkgs/monero-gui/template
@@ -18,7 +18,7 @@ pre_configure() {
 	echo "var GUI_VERSION = \"${version}\"" > version.js
 	echo "var GUI_MONERO_VERSION = \"${version}\"" >> version.js
 	case "$XBPS_TARGET_MACHINE" in
-		armv[56]*) # armv[56]* need to link libatomic.a for __atomic_fetch_sub_8
+		armv[56]*|ppc|ppc-musl) # armv[56]* and ppc need to link libatomic.a for __atomic_fetch_sub_8
 			sed -i *.pro -e "s;-leasylogging;-leasylogging -latomic;"
 			;;
 	esac

From 025b4b44e3741475e3a7d91dad152174183a9ab4 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 11:06:46 +0930
Subject: [PATCH 10/12] musikcube: use -latomic on ppc

---
 srcpkgs/musikcube/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template
index 032e3642196..787ec98f96b 100644
--- a/srcpkgs/musikcube/template
+++ b/srcpkgs/musikcube/template
@@ -16,7 +16,7 @@ distfiles="https://github.com/clangen/musikcube/archive/${version}.tar.gz"
 checksum=e05d045d9b1fcfbb7d21c5fbdc4ab482388f47b57ac5ad894786d0613def6bc5
 
 case "${XBPS_TARGET_MACHINE}" in
-	armv[56]*)
+	armv[56]*|ppc|ppc-musl)
 		makedepends+=" libatomic-devel"
 		configure_args+=" -DCMAKE_EXE_LINKER_FLAGS='-latomic'"
 		;;

From e654d25423aff8343acc59bc4c3cfbb038f532fd Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 11:13:23 +0930
Subject: [PATCH 11/12] namecoin: use -latomic on ppc

---
 srcpkgs/namecoin/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/namecoin/template b/srcpkgs/namecoin/template
index 0c80529e76d..f40e0f92231 100644
--- a/srcpkgs/namecoin/template
+++ b/srcpkgs/namecoin/template
@@ -17,7 +17,7 @@ distfiles="https://github.com/namecoin/namecoin-core/archive/nc${version}.tar.gz
 checksum=b9e56cebd6756ad8ff7c8f6c9e633cb56cb139c7c4437189945b3f25acbe0082
 
 case "${XBPS_TARGET_MACHINE}" in
-	armv[56]*)
+	armv[56]*|ppc|ppc-musl)
 		makedepends+=" libatomic-devel"
 		LDFLAGS+=" -latomic"
 		;;

From 89ccaf05ca90203c2b8554ddeec790872bc148c9 Mon Sep 17 00:00:00 2001
From: Thomas Batten <stenstorpmc@gmail.com>
Date: Fri, 31 May 2019 12:10:05 +0930
Subject: [PATCH 12/12] stockfish: use -latomic on ppc

---
 srcpkgs/stockfish/template | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/srcpkgs/stockfish/template b/srcpkgs/stockfish/template
index d162273a549..bfaa10703dd 100644
--- a/srcpkgs/stockfish/template
+++ b/srcpkgs/stockfish/template
@@ -38,6 +38,11 @@ case $XBPS_TARGET_MACHINE in
 	ppc64*)
 		make_build_args+="ARCH=ppc-64"
 		;;
+	ppc*)
+		make_build_args+="ARCH=ppc-32"
+		makedepends+="libatomic-devel"
+		LDFLAGS+=" -latomic"
+		;;
 esac
 
 do_install() {
