Skip to content

Commit 353731e

Browse files
committed
Fix build on emus
1 parent 0cf596e commit 353731e

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

.github/workflows/test.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,17 @@ jobs:
113113
run: |
114114
curl -O https://hackage.haskell.org/package/bytestring-0.11.3.0/bytestring-0.11.3.0.tar.gz
115115
tar xf bytestring-0.11.3.0.tar.gz
116-
cd bytestring-0.11.3.0/
117-
runhaskell Setup.hs configure
118-
runhaskell Setup.hs install --global
119-
cd ..
116+
rm bytestring-0.11.3.0.tar.gz
117+
cd bytestring-0.11.3.0
118+
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
119+
cd cbits/
120+
gcc -c -I../include -I/usr/lib/ghc/include/ -std=c11 -DNDEBUG=1 *.c
121+
gcc -shared -o libfoo.so *.o
122+
cd ../..
120123
ghc --version
121-
ghc --make -o Main tests/Test.hs -itests/ +RTS -s
124+
ghc --make -o Main tests/Test.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
122125
./Main +RTS -s
123-
ghc --make -o Main tests/Main.hs -itests/ +RTS -s
126+
ghc --make -o Main tests/Main.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
124127
./Main +RTS -s
125128
126129
emulated-i386:
@@ -138,14 +141,17 @@ jobs:
138141
run: |
139142
curl -O https://hackage.haskell.org/package/bytestring-0.11.3.0/bytestring-0.11.3.0.tar.gz
140143
tar xf bytestring-0.11.3.0.tar.gz
141-
cd bytestring-0.11.3.0/
142-
runhaskell Setup.hs configure
143-
runhaskell Setup.hs install --global
144-
cd ..
144+
rm bytestring-0.11.3.0.tar.gz
145+
cd bytestring-0.11.3.0
146+
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
147+
cd cbits/
148+
gcc -c -I../include -I/usr/lib/ghc/include/ -std=c11 -fPIC -DNDEBUG=1 *.c
149+
gcc -shared -o libshortbytestring.so *.o
150+
cd ../../
145151
ghc --version
146-
ghc --make -o Main tests/Test.hs -itests/ +RTS -s
152+
ghc --make -o Main tests/Test.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
147153
./Main +RTS -s
148-
ghc --make -o Main tests/Main.hs -itests/ +RTS -s
154+
ghc --make -o Main tests/Main.hs -itests/ -ibytestring-0.11.3.0/ -L./bytestring-0.11.3.0/cbits/ -lshortbytestring +RTS -s
149155
./Main +RTS -s
150156
shell: bash
151157

System/FilePath/Data/ByteString/Short/Word16.hs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
4545
-- * Basic interface
4646
snoc,
4747
cons,
48-
#if MIN_VERSION_bytestring(0,11,3)
4948
append,
50-
#endif
5149
last,
5250
tail,
5351
uncons,
@@ -61,9 +59,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
6159
-- * Transforming ShortByteStrings
6260
map,
6361
reverse,
64-
#if MIN_VERSION_bytestring(0,11,3)
6562
intercalate,
66-
#endif
6763

6864
-- * Reducing 'ShortByteString's (folds)
6965
foldl,
@@ -79,9 +75,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
7975
-- ** Special folds
8076
all,
8177
any,
82-
#if MIN_VERSION_bytestring(0,11,3)
8378
concat,
84-
#endif
8579

8680
-- ** Generating and unfolding ByteStrings
8781
replicate,
@@ -106,7 +100,6 @@ module System.FilePath.Data.ByteString.Short.Word16 (
106100
splitAt,
107101
split,
108102
splitWith,
109-
#if MIN_VERSION_bytestring(0,11,3)
110103
stripSuffix,
111104
stripPrefix,
112105

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

118111
-- ** Search for arbitrary substrings
119112
breakSubstring,
120-
#endif
121113

122114
-- * Searching ShortByteStrings
123115

@@ -153,9 +145,7 @@ module System.FilePath.Data.ByteString.Short.Word16 (
153145
useAsCWStringLen
154146
)
155147
where
156-
#if MIN_VERSION_bytestring(0,11,3)
157148
import Data.ByteString.Short ( append, intercalate, concat, stripSuffix, stripPrefix, isInfixOf, isPrefixOf, isSuffixOf, breakSubstring )
158-
#endif
159149
import Data.ByteString.Short ( length, empty, null, ShortByteString(..) )
160150
import Data.ByteString.Short
161151
( fromShort, toShort )

0 commit comments

Comments
 (0)