summaryrefslogtreecommitdiff
path: root/packages/net-im/spectrum/spectrum.exlib
blob: 86066121fe515586c92313f322df873342fc18c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Distributed under the terms of the GNU General Public License v2
# Copyright 2018 Gluzskiy Alexandr <sss@sss.chaoslab.ru>

if ! ever at_least 2.0.7; then
    SCM_EXTERNAL_REFS="
        msvc-deps/curl:curl
    "
    SCM_SECONDARY_REPOSITORIES="curl"
    SCM_curl_REPOSITORY="https://github.com/curl/curl.git"
fi

require github [ user=hanzz project=libtransport force_git_clone=true ]
require cmake [ api=2 ]


LICENCES="GPL-2"
SLOT="0"

SUMMARY="Spectrum is an XMPP transport/gateway"
HOMEPAGE="http://spectrum.im"

MYOPTIONS="
    doc
    frotz
    irc
    mysql
    postgres
    purple
    smstools
    sqlite
    twitter
    ( providers: libressl openssl ) [[ number-selected = exactly-one ]]
"


DEPENDENCIES+="
    build:
        sys-devel/gettext
    build+run:
        dev-libs/jsoncpp
        dev-libs/popt
        dev-libs/libev
        dev-libs/log4cxx
        net-im/swiften
        doc? ( app-doc/doxygen )
        frotz? ( dev-libs/protobuf )
        irc? (
            dev-libs/protobuf
            net-im/libcommuni
        )
        mysql? ( virtual/mysql )
        postgres? ( dev-db/libpqxx )
        purple? (
            dev-libs/protobuf
            net-im/pidgin
        )
        sqlite? ( dev-db/sqlite:3 )
        providers:libressl? ( dev-libs/libressl:= )
        providers:openssl? ( dev-libs/openssl )
    test:
        dev-cpp/cppunit
"

if ! ever is_scm; then
    DEFAULT_SRC_PREPARE_PATCHES=(
        "${FILES}"/6d220b0a083b3adf7fd4ae65ca011b29488493b7.diff
    )
#elif ever at_least 2.0.8; then
#    DEFAULT_SRC_PREPARE_PATCHES=(
#        "${FILES}"/cmake_jsoncpp.patch
#    )
fi

CMAKE_SRC_CONFIGURE_TESTS=( '-DENABLE_TESTS=ON -DENABLE_TESTS=OFF' )

CMAKE_SRC_CONFIGURE_OPTION_ENABLES=(
    'doc DOCS'
    FROTZ
    IRC
    MYSQL
    'postgres PQXX'
    'smstools SMSTOOLS3'
    'sqlite SQLITE3'
    TWITTER
)

CMAKE_SRC_CONFIGURE_PARAMS+=( -DENABLE_XMPP=TRUE )

if ever at_least 2.0.8; then
    export_exlib_phases src_prepare
    spectrum_src_prepare() {
        # replace complicated broken module by simple pkg-config search
        # https://github.com/SpectrumIM/spectrum2/issues/300
        edo rm "${WORKBASE}/${PNV}"/cmake_modules/Findjsoncpp.cmake
        edo cp "${FILES}"/Findjsoncpp.cmake "${WORKBASE}/${PNV}"/cmake_modules/Findjsoncpp.cmake
    }
fi