void-packages/srcpkgs/stack/patches/ppc.patch
Đoàn Trần Công Danh 4b97cd2fb4 srcpkgs/s*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

31 lines
1.3 KiB
Diff

--- a/src/Stack/Setup.hs
+++ b/src/Stack/Setup.hs
@@ -95,5 +95,6 @@ import System.IO.Error (isPermissionError)
import System.FilePath (searchPathSeparator)
import qualified System.FilePath as FP
import System.Permissions (setFileExecutable)
+import System.Endian (getSystemEndianness, Endianness (..))
import System.Uname (getRelease)
import Data.List.Split (splitOn)
@@ -1264,4 +1265,9 @@ getOSKey platform =
Platform X86_64 Cabal.Windows -> return "windows64"
Platform Arm Cabal.Linux -> return "linux-armv7"
Platform AArch64 Cabal.Linux -> return "linux-aarch64"
+ Platform PPC Cabal.Linux -> return "linux-powerpc"
+ Platform PPC64 Cabal.Linux ->
+ case getSystemEndianness of
+ LittleEndian -> return "linux-powerpc64le"
+ BigEndian -> return "linux-powerpc64"
Platform arch os -> throwM $ UnsupportedSetupCombo os arch
downloadFromInfo
--- a/stack.cabal
+++ b/stack.cabal
@@ -235,6 +235,7 @@ library
, conduit
, conduit-extra
, containers
+ , cpu >=0.1.2
, cryptonite
, cryptonite-conduit
, deepseq