generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
108 lines (96 loc) · 2.43 KB
/
default.nix
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
{ lib
, stdenv
, fetchFromGitHub
, fetchFromGitLab
, makeDesktopItem
, copyDesktopItems
, pkg-config
, cmake
, qtbase
, qttools
, qtmultimedia
, qtquick1
, qtquickcontrols
, qtquickcontrols2
, openssl
, protobuf
, wrapQtAppsHook
, fmt
, tor
}:
stdenv.mkDerivation rec {
pname = "ricochet-refresh";
version = "3.0.19";
src = fetchFromGitHub {
repo = "ricochet-refresh";
# https://github.com/blueprint-freespeech/ricochet-refresh
owner = "blueprint-freespeech";
# fix: undefined reference to symbol
# https://github.com/blueprint-freespeech/ricochet-refresh/pull/182
rev = "c785fbc9c705a3be8e8910257744423da0dd05b5";
sha256 = "sha256-fF+nZ9OQzB+QVt+5G9Ho8bIOLl32KtCv89f1BSxO0GQ=";
# no. this is slow
#fetchSubmodules = true;
};
# fetch git modules manually, this is faster
# https://github.com/blueprint-freespeech/ricochet-refresh/blob/main/.gitmodules
# https://github.com/blueprint-freespeech/ricochet-refresh/tree/main/src/extern
postUnpack = ''
pushd $sourceRoot
echo unpacking ${tor.src}
rm -rf src/extern/tor
mkdir src/extern/tor
tar -x -f ${tor.src} -C src/extern/tor --strip-components=1
popd
'';
postPatch = ''
# fix: error: Cannot format an argument
# https://github.com/blueprint-freespeech/ricochet-refresh/issues/180
substituteInPlace src/libtego/source/protocol/FileChannel.cpp \
--replace \
'fmt::format("Unknown FileChannel::direction()", direction)' \
'"Unknown FileChannel::direction()"' \
'';
desktopItem = [
(makeDesktopItem {
name = "ricochet-refresh";
exec = "ricochet-refresh";
icon = "ricochet-refresh";
desktopName = "Ricochet Refresh";
genericName = "Ricochet Refresh";
categories = [ "Network" "InstantMessaging" ];
})
];
buildInputs = [
qtbase
qtmultimedia
qtquick1
qtquickcontrols
qtquickcontrols2
openssl
protobuf
fmt
];
nativeBuildInputs = [
pkg-config
cmake
qttools
copyDesktopItems
wrapQtAppsHook
];
preConfigure = ''
cd src
'';
cmakeFlags = [
# TODO more?
"-DRICOCHET_REFRESH_INSTALL_DESKTOP=ON"
"-DUSE_SUBMODULE_FMT=OFF"
];
meta = with lib; {
description = "Private, anonymous, and metadata resistant instant messaging using Tor onion services";
homepage = "https://www.ricochetrefresh.net";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = [ ];
};
}