summaryrefslogtreecommitdiff
path: root/packages/net-p2p/retroshare/retroshare.exlib
blob: 3c2d1156712fc8e117ac96c8821e3cc38506c6df (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Copyright 2013 Ankur Kothari
# Distributed under the terms of the GNU General Public License v2

require flag-o-matic
require github [ user=RetroShare project=RetroShare tag=v${PV} ]
require qmake [ slot=5 ]
require gtk-icon-cache freedesktop-desktop

export_exlib_phases src_configure src_install pkg_postinst pkg_postrm

SUMMARY="A decentralized, private and secure commmunication and sharing platform"
DESCRIPTION="
RetroShare is basically a platform that establishes encrypted connections
between authenticated friends. This connection is used for various
communication services and filesharing. It is independent of any corporate
system or central servers, all data is only sent to friends and in some cases
relayed by them to their friends, making RetroShare a decentralised Social
Sharing Network designed For the People. Encrypted communication ensures that
all shared information is only known to you and your friends.

Communication services in RetroShare:
    * Private chat with friends
    * Private or public chat lobbies, that allow chatting with friends
      and friends of friends
    * Messages to friends
    * Forums
    * Voice over IP
"
HOMEPAGE="https://retroshare.github.io/"

LICENCES="GPL-2"
SLOT="0"
MYOPTIONS="
    ( providers: libressl openssl ) [[ number-selected = exactly-one ]]
    ( providers: ffmpeg libav ) [[ number-selected = exactly-one ]]
    sqlcipher
    plugins
"

DEPENDENCIES="
    build:
        virtual/pkg-config
    build+run:
        sqlcipher? ( app-crypt/sqlcipher )
        dev-libs/libxml2:2.0
        dev-libs/libxslt
        dev-libs/protobuf
        gnome-desktop/libgnome-keyring:1
        plugins? ( media-libs/opencv
            media-libs/speex
            media-libs/speexdsp
            providers:ffmpeg? ( media/ffmpeg )
            providers:libav? ( media/libav )
        )
        net-libs/libmicrohttpd
        net-libs/libssh
        net-libs/libupnp
        net-misc/curl
        x11-libs/libX11
        x11-libs/libXScrnSaver
        x11-libs/qtbase:5
        x11-libs/qtmultimedia:5
        x11-libs/qttools:5
        x11-libs/qtx11extras:5
        providers:libressl? ( dev-libs/libressl:= )
        providers:openssl? ( dev-libs/openssl )
"

EQMAKE_PARAMS=(
    "CONFIG-=debug"
    "CONFIG+=release"
    "CONFIG-=c++11"
)

DEFAULT_SRC_PREPARE_PATCHES+=(
    "${FILES}"/cflags.patch
    "${FILES}"/clang.patch
    "${FILES}"/disable_key_array_redraw.patch
    "${FILES}"/hidden_service.patch
)

retroshare_src_configure(){
    # weird speex failures, also see
    # https://github.com/RetroShare/RetroShare/issues/393
    append-flags -DHAVE_STDINT_H

    # fix hardcoded extension directory
    edo sed -i \
        -e "s|/usr/lib/retroshare/extensions6/|/usr/$(exhost --target)/lib/${PN}/extensions6/|" \
        libretroshare/src/rsserver/rsinit.cc
    option sqlcipher || EQMAKE_PARAMS+=( "CONFIG+=no_sqlcipher" )
    option plugins || EQMAKE_PARAMS+=( "CONFIG+=no_retroshare_plugins" )

    eqmake \
        BIN_DIR="/usr/$(exhost --target)/bin" \
        LIB_DIR="/usr/$(exhost --target)/lib" \
        PLUGIN_DIR="/usr/$(exhost --target)/lib/${PN}/extensions6/" \
        INC_DIR="/usr/$(exhost --target)/include" \
        RetroShare.pro
}

retroshare_src_install() {
    emake INSTALL_ROOT="${IMAGE}" install

    # overwrite desktop file
    insinto /usr/share/applications
    hereins ${PN}06.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=RetroShare06
Comment=Securely share files with your friends
Exec=RetroShare06
Icon=retroshare06
Terminal=false
Type=Application
Categories=Network;
EOF
}

retroshare_pkg_postinst() {
    freedesktop-mime_pkg_postinst
    freedesktop-desktop_pkg_postinst
    gtk-icon-cache_pkg_postinst
}

retroshare_pkg_postrm() {
    freedesktop-mime_pkg_postrm
    freedesktop-desktop_pkg_postrm
    gtk-icon-cache_pkg_postrm
}