Skip to content

Commit

Permalink
chore: Fix android build after saltine upgrade.
Browse files Browse the repository at this point in the history
Latest libsodium (saltine) bindings need pkg-config.
  • Loading branch information
iphydf committed Sep 3, 2023
1 parent d44ec3a commit 1dd28ed
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 4 additions & 2 deletions android/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

export THIS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. "$HOME/ghc-build/set-env-android.sh"
cd -
cd - || exit
set -x

export PKG_CONFIG_PATH="$NDK_ADDON_PREFIX/lib/pkgconfig"

"$NDK_TARGET-cabal" update

"$THIS_DIR/user-scripts/install-libsodium.sh"
"$THIS_DIR/user-scripts/cabal-prepare.sh" comonad-5.0.8 distributive-0.6.2.1 entropy-0.4.1.6 network-3.1.1.1

(cd network-3.1.1.1 && patch -p1 <../android/patches/hs-network-ffi.patch)

"$NDK_TARGET-cabal" new-install -j4 --with-happy="$(which happy)" --ghc-option="-fPIC"
"$NDK_TARGET-cabal" new-install -j4 --with-happy="$GHC_HOST/bin/happy" --ghc-option="-fPIC"
10 changes: 10 additions & 0 deletions src/Data/Binary/Bits/Get.hs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@ shiftl_w16 :: Word16 -> Int -> Word16
shiftl_w32 :: Word32 -> Int -> Word32
shiftl_w64 :: Word64 -> Int -> Word64

#if __GLASGOW_HASKELL__ < 900
uncheckedShiftLWord8# = uncheckedShiftL#
uncheckedShiftLWord16# = uncheckedShiftL#
uncheckedShiftLWord32# = uncheckedShiftL#

uncheckedShiftRLWord8# = uncheckedShiftRL#
uncheckedShiftRLWord16# = uncheckedShiftRL#
uncheckedShiftRLWord32# = uncheckedShiftRL#
#endif

#if !defined(__HADDOCK__)
shiftl_w8 (W8# w) (I# i) = W8# (w `uncheckedShiftLWord8#` i)
shiftl_w16 (W16# w) (I# i) = W16# (w `uncheckedShiftLWord16#` i)
Expand Down
4 changes: 2 additions & 2 deletions toxcore.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ library
executable toxsave-convert
default-language: Haskell2010
hs-source-dirs: tools
ghc-options: -Wall -fno-warn-unused-imports
ghc-options: -Wall -Wno-unused-imports
main-is: toxsave-convert.hs
build-depends:
base <5
Expand Down Expand Up @@ -138,7 +138,7 @@ test-suite testsuite
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: test
ghc-options: -Wall -fno-warn-unused-imports
ghc-options: -Wall -Wno-unused-imports
main-is: testsuite.hs
other-modules:
Data.Result
Expand Down

0 comments on commit 1dd28ed

Please sign in to comment.