Skip to content

Commit

Permalink
Merge 96fdcfc into 0e88f03
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Mar 27, 2020
2 parents 0e88f03 + 96fdcfc commit 38db33f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 22 deletions.
33 changes: 31 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
---
language: generic
dist: xenial
os: linux

env:
global:
# HACKAGE_USERNAME=[secure]
- secure: "hjaL3IXi+SN0S3rUxV61nkBk7ZCZ/aJS1vx/DQlILTBLCV9E7X9AjBJy5oSChCYF1si05a26GAw+K3w8F0vR9zXjqHbkq5PDhZJmy+MItIDTahXbF8sNrcqGsLPsr6vmLF+/WIU8BqwC2xnkdJMR43OvbcghhX+l5ZmDYmY4RajU6cTeKeBS4vYRpy+yv3RmDVQO1BhhmZ+MlH/x+4efGJSvrpj/1gjwlPv9uyYuikUqJb8i3LO4XIvpj/uDwzv5YwUjCTs0Hjkv+K3MVk8gKWwAZNpN59nmWBzrdUmyyl3Po9LdUbqyI9l5GDpK20Hyi9GRDkMMukf/NteestouIcaCVzRUx/zhCzpfWfchZrlCg6zEovbW2NAYt0MCj0kNG3YsJyKpAE+v5MGe0KN9WIZhxwzdbJ3aj9woBVwG165pzjeEYi88+1C+sZb7ttyJc2Zu17RIULB6udh6ti8aWAYwLaL/oRKGD+q/eMmGgH/kq/G8ZcfPepc4Go7qJA6PRtMrmnInvesS4goU6m7Yla0KDrkPJQpSJlIxUYqXErH2FjUVNmHfpPNC9vrN7NrpWAj0bvPFxTY6ESoqONLL0qDvpGpMYSM2kio5djtJW50iP1l1NuWmNiDW63nM9lAvJUAlIxcKLfviTF8Pua+VWVLTlmH6/aH1kFFu1u9m734="
# HACKAGE_PASSWORD=[secure]
- secure: "txywsEfVghfbFxdB8sOq5lDAcR7Na7ltOm2Ro4HRIHhLZ54Ud4/CRBt62yKO8+b/tj5ik5IyyHG8D6R2+zmohaFAIv6uGoXt2UKb/P79tRuLruaNdycy6oeT6DF2E4JBBF9SURoUynUsNDRnmG8LCA16Zs/3I6QMfRGZBl5IAdonSKoULGC6cGT+l+U5Uh656MX4ZgRLEGOK1mjAVZOW9qCj0uyva8M8sdcJJH8d9qmk4AA/Kw8NDst6uYl1cqeHJYxLW/2y2omoBpnwM4nyEG7yHD2L8GRr6DcvPwyYKqNP/PP9dP+GDbatu2nZT8vb5KJ2nx0o4386hSkUI5ZhjgljP+iwN06CBQd6poa+apvAPhxTlRkh6+bG3s3O5ft/9ccLydDRwPraqsH3Ot3IPcpsXJovaO0EaKZGSoM3ZMvXLM/7uufin9+zfB2MC4amhbz//O8OJnwdJXL4GRdorpg5jln5T0idxQ95Po4hRSHI75dz1oYA1o/e5ivhUzL78sHci0sUoOxuMWlLDKj4NssTTVEZSBTJir6NaWa6Qs1Mw+ommdkogPiwYB6okwtEFz3Rukk0S8QLcmr3/WV6a2e4uT46yHX9uvu+3r6xnwWyhCvtBBhVHvc1s1fVI2Qeu+IlrUdZ9qlgyb+fSIc3GtToYd3qAU4JPxsIpLD89wc="

cache:
timeout: 600
Expand All @@ -9,7 +18,7 @@ cache:

before_install:
- export PATH=$HOME/.local/bin:$PATH
- travis_retry curl -L https://github.com/TokTok/hs-tools/releases/download/v0.1/hs-tools-v0.1.tar.gz | tar xz -C $HOME
- travis_retry curl -L https://github.com/TokTok/hs-tools/releases/download/v0.6/hs-tools-v0.6.tar.gz | tar xz -C $HOME

install:
# Where to find libraries.
Expand All @@ -27,4 +36,24 @@ script:
- stylish-haskell-lhs -i .
- git diff --exit-code
- stack --no-terminal test --coverage --extra-include-dirs=$HOME/.local/include --extra-lib-dirs=$HOME/.local/lib
- shc toxcore testsuite
- shc toxcore-c testsuite
- stack sdist --tar-dir .

deploy:
provider: releases
token:
secure: "Q3NyBZiF2weHVcnx+34YfomLhkoM7pC1yxx+tokmgBeIH6fl3LuUx4ibPCuicBmHk3dRd8/bv3jR2bgSdCK730x8dbbQFC3QF69RIkDNPsqa6jZ5oSruC7V3gyeI6WDfVJqTjO4Co7f1k6KZxkuBQHpwNW/dmj4Wufs9Cie9f9cx477oxtxQEjL3mZ5GSkMYSkomWwLFnrRkAPw/736fgwH7IKSLFrFBWgj6QeSXUDUJero+v2lEvVjBtVAEekI1oofgBzXG3inD0+Zoh43+tvhpPq3FbgOUO0fi/6aXWwcC3cCln+NlAqnkZ7u6Fr4GPD3wJGPA2L/b8Mi74cR9oUDLkQiGqNhlQNuZJRjHAZDaD/I9nXgB7oF5JJ/+zFvSA5MiptFdvsIEUHaAo34ZacK1DvxomfcHTPWduWOowk07zlgrn3J1fH+rYEEIYWOpLiwtHufT3aJQoDm2tld8M4kbg10th1YhProgJNvECm2rj5LYci2szay4An31K+ltqFtJC9tfOMf8mTBBgxarzHoLqCR9QhqzC2U0+h2MyRfpuDVr/44Ikqeote8Em2OxMAG/Vy/YwO+bS9lB6pVmzE1wfbGbJYD5yTytkj6174jtqSXSrZkwgfWfjqs7kzHxVMhv/hJxP8NzuRfzahdAdiHdnoLrosXNTv2mtzzfbm4="
file: toxcore-c-0.2.11.tar.gz
skip_cleanup: true
on:
repo: TokTok/hs-toxcore-c
tags: true

after_deploy:
- mkdir -p "$HOME/.stack/upload"
- echo "{\"username\":\"$HACKAGE_USERNAME\",\"password\":\"$HACKAGE_PASSWORD\"}" > $HOME/.stack/upload/credentials.json
- stack --no-terminal upload .

# Only build pull requests and releases, don't build master on pushes,
# except through api or cron.
if: type IN (pull_request, api, cron) OR tag IS present
12 changes: 9 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ load("@rules_haskell//haskell:defs.bzl", "haskell_binary", "haskell_library")
load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_test")
load("//tools/project:build_defs.bzl", "project")

project()
VERSION = "0.2.11"

project(
# TODO(iphydf): Make this package standard travis.
standard_travis = False,
version = VERSION,
)

haskell_library(
name = "hs-toxcore-c",
srcs = glob(["src/**/*.*hs"]),
compiler_flags = ["-Wno-unused-imports"],
src_strip_prefix = "src",
version = "0.2.0",
version = VERSION,
visibility = ["//visibility:public"],
deps = [
"//c-toxcore",
Expand All @@ -35,7 +41,7 @@ haskell_binary(
)

hspec_test(
name = "test",
name = "testsuite",
timeout = "short",
compiler_flags = ["-Wno-unused-imports"],
deps = [
Expand Down
33 changes: 16 additions & 17 deletions toxcore.cabal → toxcore-c.cabal
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
name: toxcore
name: toxcore-c
synopsis: Haskell bindings to the C reference implementation of Tox
version: 0.2.0
version: 0.2.11
cabal-version: >= 1.10
license: GPL-3
license-file: LICENSE
build-type: Simple
author: iphy
maintainer: iphy
copyright: © 2016-2018 iphy
copyright: © 2016-2020 The TokTok Team
homepage: https://toktok.github.io
category: Network
description:
Haskell bindings to the C reference implementation of Tox.
.
See <https://github.com/TokTok/toxcore>.
See <https://github.com/TokTok/c-toxcore>.

source-repository head
type: git
location: https://github.com/TokTok/hs-toxcore
location: https://github.com/TokTok/hs-toxcore-c

library
default-language: Haskell2010
hs-source-dirs:
src
ghc-options:
-Wall
-- -fno-warn-unused-imports
extra-libraries: toxcore
build-depends:
base < 5
, bytestring
, data-default-class
exposed-modules:
Network.Tox.C
Network.Tox.C.CEnum
Expand All @@ -40,6 +35,10 @@ library
Network.Tox.C.Tox
Network.Tox.C.Type
Network.Tox.C.Version
build-depends:
base < 5
, bytestring
, data-default-class

executable groupbot
default-language: Haskell2010
Expand All @@ -49,13 +48,13 @@ executable groupbot
-Wall
-fno-warn-unused-imports
extra-libraries: toxcore
main-is: Main.hs
build-depends:
base < 5
, base16-bytestring
, bytestring
, directory
, toxcore
main-is: Main.hs
, toxcore-c

test-suite testsuite
default-language: Haskell2010
Expand All @@ -65,6 +64,10 @@ test-suite testsuite
ghc-options:
-Wall
-fno-warn-unused-imports
main-is: testsuite.hs
other-modules:
Network.Tox.C.ToxSpec
Network.Tox.CSpec
build-depends:
base < 5
, QuickCheck >= 2.9.1
Expand All @@ -74,8 +77,4 @@ test-suite testsuite
, data-default-class
, hspec
, saltine
, toxcore
main-is: testsuite.hs
other-modules:
Network.Tox.C.ToxSpec
Network.Tox.CSpec
, toxcore-c

0 comments on commit 38db33f

Please sign in to comment.