-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathrune.nix
159 lines (129 loc) · 3.27 KB
/
rune.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
{
lib,
stdenv,
flutter324,
protoc-gen-prost,
rustPlatform,
alsa-lib,
fetchFromGitHub,
replaceVars,
pkg-config,
openssl,
dbus,
libnotify,
libayatana-appindicator,
protobuf_26,
protoc-gen-dart,
targetFlutterPlatform ? "linux",
}:
let
version = "1.1.0";
metaCommon = {
description = "Experience timeless melodies with a music player that blends classic design with modern technology";
homepage = "https://github.com/Losses/rune";
license = with lib.licenses; [
mpl20
mit
asl20
];
maintainers = with lib.maintainers; [ losses ];
};
pubspecLock = lib.importJSON ./pubspec.lock.json;
gitHashes = {
macos_secure_bookmarks = "sha256-qC3Ytxkg5bGh6rns0Z/hG3uLYf0Qyw6y6Hq+da1Je0I=";
fluent_ui = "sha256-r40uN7mwr6MCNg41AKdk2Z9Zd4pUCxV0xwLXKgNauqo=";
scrollable_positioned_list = "sha256-tkRlxnmyG5r5yZwEvj9KDfEf4OuSM0HEwPOYm7T7LnQ=";
system_tray = "sha256-1XMVu1uHy4ZgPKDqfQ7VTDVJvDxky5+/BbocGz8rKYs=";
};
src = flutter324.buildFlutterApplication {
inherit version pubspecLock gitHashes;
pname = "source";
src = fetchFromGitHub {
owner = "Losses";
repo = "rune";
tag = "v${version}";
hash = "sha256-vYbi6vguKPI7UoCIKjlGHTQi+OoVjPbIOLNyoW2DOv0=";
};
nativeBuildInputs = [
protobuf_26
protoc-gen-prost
protoc-gen-dart
];
buildPhase = ''
runHook preBuild
packageRun rinf message
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r . $out
mkdir $debug
runHook postInstall
'';
meta = metaCommon;
};
libhub = rustPlatform.buildRustPackage {
inherit version src;
pname = "libhub";
useFetchCargoVendor = true;
cargoHash = "sha256-+7zUUUpXYKmeCVA+XZLMR1Z41ZIIfHvPTelCCY/UOfI=";
nativeBuildInputs = [
pkg-config
protobuf_26
];
buildInputs = [
openssl
alsa-lib
dbus
];
doCheck = false; # test failed
passthru.libraryPath = "lib/libhub.so";
meta = metaCommon // {
mainProgram = "rune-cli";
};
};
in
flutter324.buildFlutterApplication {
inherit
version
src
pubspecLock
gitHashes
;
pname = "rune-${targetFlutterPlatform}";
buildInputs = [
libnotify
libayatana-appindicator
];
customSourceBuilders = {
rinf =
{ version, src, ... }:
stdenv.mkDerivation {
pname = "rinf";
inherit version src;
inherit (src) passthru;
patches = [
(replaceVars ./rinf.patch {
output_lib = "${libhub}/${libhub.passthru.libraryPath}";
})
];
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
};
};
postInstall = ''
mkdir -p $out/share
cp -r --no-preserve=mode $src/assets/icons $out/share/icons
ln -s $out/share/icons/Papirus $out/share/icons/hicolor
ln -s $out/share/icons/Papirus $out/share/icons/Papirus-Dark
ln -s $out/share/icons/Papirus $out/share/icons/Papirus-Light
ln -s $out/share/icons/breeze/apps/1024/rune.png $out/share/icons/rune.png
install -Dm0644 assets/source/linux/rune.desktop $out/share/applications/rune.desktop
'';
meta = metaCommon // {
mainProgram = "rune";
};
}