tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
sieve-editor-gui: support darwin
Fugi
5 months ago
44af9e1f
790bfe7a
+47
-9
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
si
sieve-editor-gui
package.nix
+47
-9
pkgs/by-name/si/sieve-editor-gui/package.nix
···
1
1
{
2
2
lib,
3
3
+
stdenv,
3
4
buildNpmPackage,
4
5
fetchFromGitHub,
5
6
electron,
···
7
8
nodePackages,
8
9
makeDesktopItem,
9
10
copyDesktopItems,
11
11
+
runCommand,
12
12
+
zip,
10
13
}:
14
14
+
15
15
+
let
16
16
+
electronArch = if stdenv.hostPlatform.isAarch64 then "arm64" else "x64";
17
17
+
electronZip =
18
18
+
runCommand "electronZip"
19
19
+
{
20
20
+
nativeBuildInputs = [ zip ];
21
21
+
}
22
22
+
''
23
23
+
mkdir $out
24
24
+
25
25
+
cp -r ${electron.dist} electron-dist
26
26
+
chmod -R u+w electron-dist
27
27
+
28
28
+
cd electron-dist
29
29
+
zip -0Xqr $out/electron-v${electron.version}-darwin-${electronArch}.zip .
30
30
+
'';
31
31
+
in
32
32
+
11
33
buildNpmPackage {
12
34
pname = "sieve-editor-gui";
13
35
version = "0.6.1-unstable-2025-03-12";
···
24
46
25
47
nativeBuildInputs = [
26
48
electron
27
27
-
copyDesktopItems
28
49
nodePackages.gulp
29
29
-
];
50
50
+
]
51
51
+
++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ];
30
52
31
53
dontNpmBuild = true;
32
54
···
36
58
37
59
installPhase = ''
38
60
runHook preInstall
61
61
+
''
62
62
+
+ lib.optionalString stdenv.hostPlatform.isLinux ''
39
63
mv build/ $out
64
64
+
65
65
+
makeWrapper ${lib.getExe electron} $out/bin/sieve-editor-gui \
66
66
+
--add-flags $out/electron/resources/main_esm.js
67
67
+
''
68
68
+
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
69
69
+
npx electron-packager ./build/electron/resources \
70
70
+
--electron-zip-dir ${electronZip} \
71
71
+
--electron-version ${electron.version} \
72
72
+
--icon src/common/icons/mac.icns
73
73
+
74
74
+
mkdir -p $out/Applications
75
75
+
cp -r sieve-darwin-*/sieve.app $out/Applications/
76
76
+
77
77
+
makeWrapper $out/Applications/sieve.app/Contents/MacOS/Sieve $out/bin/sieve-editor-gui
78
78
+
''
79
79
+
+ ''
40
80
runHook postInstall
41
81
'';
42
82
···
54
94
})
55
95
];
56
96
57
57
-
postInstall = ''
58
58
-
makeWrapper ${lib.getExe electron} $out/bin/sieve-editor-gui \
59
59
-
--add-flags $out/electron/resources/main_esm.js
60
60
-
'';
61
61
-
62
97
meta = {
63
98
description = "Activate, edit, delete and add Sieve scripts with a convenient interface";
64
99
homepage = "https://github.com/thsmi/sieve";
65
100
license = lib.licenses.agpl3Only;
66
66
-
maintainers = with lib.maintainers; [ Silver-Golden ];
67
67
-
platforms = lib.platforms.linux;
101
101
+
maintainers = with lib.maintainers; [
102
102
+
Silver-Golden
103
103
+
fugi
104
104
+
];
68
105
mainProgram = "sieve-editor-gui";
106
106
+
inherit (electron.meta) platforms;
69
107
};
70
108
}