tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
quba: Add support for darwin
Alexis Hildebrandt
1 year ago
2beaf5e5
46897ae2
+50
-19
1 changed file
expand all
collapse all
unified
split
pkgs
by-name
qu
quba
package.nix
+50
-19
pkgs/by-name/qu/quba/package.nix
···
1
1
{
2
2
lib,
3
3
+
stdenvNoCC,
3
4
appimageTools,
4
5
fetchurl,
6
6
+
_7zz,
5
7
}:
6
8
7
9
let
10
10
+
pname = "quba";
8
11
version = "1.4.2";
9
9
-
pname = "quba";
12
12
+
13
13
+
meta = {
14
14
+
description = "Viewer for electronic invoices";
15
15
+
homepage = "https://github.com/ZUGFeRD/quba-viewer";
16
16
+
downloadPage = "https://github.com/ZUGFeRD/quba-viewer/releases";
17
17
+
license = lib.licenses.asl20;
18
18
+
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
19
19
+
maintainers = with lib.maintainers; [ onny ];
20
20
+
platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
21
21
+
};
10
22
11
23
src = fetchurl {
12
24
url = "https://github.com/ZUGFeRD/quba-viewer/releases/download/v${version}/Quba-${version}.AppImage";
···
14
26
};
15
27
16
28
appimageContents = appimageTools.extractType1 { inherit pname version src; };
17
17
-
in
18
18
-
appimageTools.wrapType1 {
19
19
-
inherit pname version src;
29
29
+
30
30
+
linux = appimageTools.wrapType1 {
31
31
+
inherit
32
32
+
pname
33
33
+
version
34
34
+
src
35
35
+
meta
36
36
+
;
37
37
+
38
38
+
extraInstallCommands = ''
39
39
+
install -m 444 -D ${appimageContents}/quba.desktop -t $out/share/applications
40
40
+
substituteInPlace $out/share/applications/quba.desktop \
41
41
+
--replace-fail 'Exec=AppRun' 'Exec=quba'
42
42
+
cp -r ${appimageContents}/usr/share/icons $out/share
43
43
+
'';
44
44
+
};
45
45
+
46
46
+
darwin = stdenvNoCC.mkDerivation {
47
47
+
inherit pname version meta;
48
48
+
49
49
+
src = fetchurl {
50
50
+
url = "https://github.com/ZUGFeRD/quba-viewer/releases/download/v${version}/Quba-${version}-universal.dmg";
51
51
+
hash = "sha256-q7va2D9AT0BoPhfkub/RFQxGyF12uFaCDpSYIxslqMc=";
52
52
+
};
20
53
21
21
-
extraInstallCommands = ''
22
22
-
install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
23
23
-
substituteInPlace $out/share/applications/${pname}.desktop \
24
24
-
--replace-fail 'Exec=AppRun' 'Exec=${pname}'
25
25
-
cp -r ${appimageContents}/usr/share/icons $out/share
26
26
-
'';
54
54
+
unpackCmd = "7zz x -bd -osource -xr'!*/Applications' -xr'!*com.apple.provenance' $curSrc";
27
55
28
28
-
meta = {
29
29
-
description = "Viewer for electronic invoices";
30
30
-
homepage = "https://github.com/ZUGFeRD/quba-viewer";
31
31
-
downloadPage = "https://github.com/ZUGFeRD/quba-viewer/releases";
32
32
-
license = lib.licenses.asl20;
33
33
-
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
34
34
-
maintainers = with lib.maintainers; [ onny ];
35
35
-
platforms = [ "x86_64-linux" ];
56
56
+
nativeBuildInputs = [ _7zz ];
57
57
+
58
58
+
installPhase = ''
59
59
+
runHook preInstall
60
60
+
61
61
+
mkdir -p $out/Applications
62
62
+
mv Quba.app $out/Applications
63
63
+
64
64
+
runHook postInstall
65
65
+
'';
36
66
};
37
37
-
}
67
67
+
in
68
68
+
if stdenvNoCC.hostPlatform.isLinux then linux else darwin