Skip to content

Commit

Permalink
Fix build on emus
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Mar 19, 2022
1 parent 0cf596e commit 353731e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,17 @@ jobs:
run: |
curl -O https://hackage.haskell.org/package/bytestring-0.11.3.0/bytestring-0.11.3.0.tar.gz
tar xf bytestring-0.11.3.0.tar.gz
cd bytestring-0.11.3.0/
runhaskell Setup.hs configure
runhaskell Setup.hs install --global
cd ..
rm bytestring-0.11.3.0.tar.gz
cd bytestring-0.11.3.0
find . -type f -not -path './Data/ByteString/Short.hs' -a -not -path './Data/ByteString/Internal.hs' -a -not -path './Data/ByteString/Short/Internal.hs' -a -not -path './cbits/*' -a -not -path './include/*' -delete
cd cbits/
gcc -c -I../include -I/usr/lib/ghc/include/ -std=c11 -DNDEBUG=1 *.c
gcc -shared -o libfoo.so *.o
cd ../..
ghc --version
ghc --make -o Main tests/Test.hs -itests/ +RTS -s
ghc --make -o Main tests/Test.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
./Main +RTS -s
ghc --make -o Main tests/Main.hs -itests/ +RTS -s
ghc --make -o Main tests/Main.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
./Main +RTS -s
emulated-i386:
Expand All @@ -138,14 +141,17 @@ jobs:
run: |
curl -O https://hackage.haskell.org/package/bytestring-0.11.3.0/bytestring-0.11.3.0.tar.gz
tar xf bytestring-0.11.3.0.tar.gz
cd bytestring-0.11.3.0/
runhaskell Setup.hs configure
runhaskell Setup.hs install --global
cd ..
rm bytestring-0.11.3.0.tar.gz
cd bytestring-0.11.3.0
find . -type f -not -path './Data/ByteString/Short.hs' -a -not -path './Data/ByteString/Internal.hs' -a -not -path './Data/ByteString/Short/Internal.hs' -a -not -path './cbits/*' -a -not -path './include/*' -delete
cd cbits/
gcc -c -I../include -I/usr/lib/ghc/include/ -std=c11 -fPIC -DNDEBUG=1 *.c
gcc -shared -o libshortbytestring.so *.o
cd ../../
ghc --version
ghc --make -o Main tests/Test.hs -itests/ +RTS -s
ghc --make -o Main tests/Test.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
./Main +RTS -s
ghc --make -o Main tests/Main.hs -itests/ +RTS -s
ghc --make -o Main tests/Main.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
./Main +RTS -s
shell: bash

Expand Down
10 changes: 0 additions & 10 deletions System/FilePath/Data/ByteString/Short/Word16.hs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
-- * Basic interface
snoc,
cons,
#if MIN_VERSION_bytestring(0,11,3)
append,
#endif
last,
tail,
uncons,
Expand All @@ -61,9 +59,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
-- * Transforming ShortByteStrings
map,
reverse,
#if MIN_VERSION_bytestring(0,11,3)
intercalate,
#endif

-- * Reducing 'ShortByteString's (folds)
foldl,
Expand All @@ -79,9 +75,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
-- ** Special folds
all,
any,
#if MIN_VERSION_bytestring(0,11,3)
concat,
#endif

-- ** Generating and unfolding ByteStrings
replicate,
Expand All @@ -106,7 +100,6 @@ module System.FilePath.Data.ByteString.Short.Word16 (
splitAt,
split,
splitWith,
#if MIN_VERSION_bytestring(0,11,3)
stripSuffix,
stripPrefix,

Expand All @@ -117,7 +110,6 @@ module System.FilePath.Data.ByteString.Short.Word16 (

-- ** Search for arbitrary substrings
breakSubstring,
#endif

-- * Searching ShortByteStrings

Expand Down Expand Up @@ -153,9 +145,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
useAsCWStringLen
)
where
#if MIN_VERSION_bytestring(0,11,3)
import Data.ByteString.Short ( append, intercalate, concat, stripSuffix, stripPrefix, isInfixOf, isPrefixOf, isSuffixOf, breakSubstring )
#endif
import Data.ByteString.Short ( length, empty, null, ShortByteString(..) )
import Data.ByteString.Short
( fromShort, toShort )
Expand Down

0 comments on commit 353731e

Please sign in to comment.