tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
p4v: add support for x86_64-darwin
Noah Fontes
3 years ago
a289e7fe
0defcde4
+139
-95
4 changed files
expand all
collapse all
unified
split
pkgs
applications
version-management
p4v
darwin.nix
default.nix
linux.nix
top-level
all-packages.nix
+24
pkgs/applications/version-management/p4v/darwin.nix
···
1
1
+
{ stdenv, undmg }:
2
2
+
3
3
+
{ pname, version, src, meta }:
4
4
+
stdenv.mkDerivation {
5
5
+
inherit pname version src meta;
6
6
+
7
7
+
nativeBuildInputs = [ undmg ];
8
8
+
9
9
+
sourceRoot = ".";
10
10
+
11
11
+
installPhase = ''
12
12
+
mkdir -p $out/Applications $out/bin
13
13
+
14
14
+
# Install Qt applications.
15
15
+
for f in p4admin.app p4merge.app p4v.app; do
16
16
+
mv $f $out/Applications
17
17
+
done
18
18
+
19
19
+
# Install p4vc separately (it's a tiny shell script).
20
20
+
mv p4vc $out/bin
21
21
+
substituteInPlace $out/bin/p4vc \
22
22
+
--replace /Applications $out/Applications
23
23
+
'';
24
24
+
}
+25
-94
pkgs/applications/version-management/p4v/default.nix
···
1
1
{ stdenv
2
2
, fetchurl
3
3
, lib
4
4
-
, autoPatchelfHook
5
5
-
, cups
6
6
-
, dbus
7
7
-
, fontconfig
8
8
-
, gccForLibs
9
9
-
, libX11
10
10
-
, libXcomposite
11
11
-
, libXcursor
12
12
-
, libXdamage
13
13
-
, libXext
14
14
-
, libXi
15
15
-
, libXrandr
16
16
-
, libXrender
17
17
-
, libXtst
18
18
-
, libinput
19
19
-
, libxcb
20
20
-
, libxkbcommon
21
21
-
, nss
22
22
-
, qttools
23
23
-
, qtwebengine
24
24
-
, xcbutilimage
25
25
-
, xcbutilkeysyms
26
26
-
, xcbutilrenderutil
27
27
-
, xcbutilwm
4
4
+
, callPackage
5
5
+
, libsForQt5
28
6
}:
29
7
30
8
let
31
31
-
pname = "p4v";
32
32
-
version = "2022.2.2336701";
33
33
-
34
34
-
unwrapped = stdenv.mkDerivation {
35
35
-
pname = "${pname}-unwrapped";
36
36
-
inherit version;
37
37
-
38
38
-
src = fetchurl {
39
39
-
url = "https://web.archive.org/web/20220902181457/https://ftp.perforce.com/perforce/r22.2/bin.linux26x86_64/p4v.tgz";
9
9
+
# Upstream replaces minor versions, so use archived URLs.
10
10
+
srcs = {
11
11
+
"x86_64-linux" = fetchurl {
12
12
+
url = "https://web.archive.org/web/20220902181457id_/https://ftp.perforce.com/perforce/r22.2/bin.linux26x86_64/p4v.tgz";
40
13
sha256 = "8fdade4aafe25f568a61cfd80823aa90599c2a404b7c6b4a0862c84b07a9f8d2";
41
14
};
15
15
+
"x86_64-darwin" = fetchurl {
16
16
+
url = "https://web.archive.org/web/20220902194716id_/https://ftp.perforce.com/perforce/r22.2/bin.macosx1015x86_64/P4V.dmg";
17
17
+
sha256 = "c4a9460c0f849be193c68496c500f8a785c740f5bea5b5e7f617969c20be3cd7";
18
18
+
};
19
19
+
};
42
20
43
43
-
nativeBuildInputs = [ autoPatchelfHook ];
44
44
-
buildInputs = [
45
45
-
cups
46
46
-
dbus
47
47
-
fontconfig
48
48
-
gccForLibs
49
49
-
libX11
50
50
-
libXcomposite
51
51
-
libXcursor
52
52
-
libXdamage
53
53
-
libXext
54
54
-
libXi
55
55
-
libXrandr
56
56
-
libXrender
57
57
-
libXtst
58
58
-
libinput
59
59
-
libxcb
60
60
-
libxkbcommon
61
61
-
nss
62
62
-
qttools
63
63
-
qtwebengine
64
64
-
xcbutilimage
65
65
-
xcbutilkeysyms
66
66
-
xcbutilrenderutil
67
67
-
xcbutilwm
68
68
-
];
21
21
+
mkDerivation =
22
22
+
if stdenv.isDarwin then callPackage ./darwin.nix { }
23
23
+
else libsForQt5.callPackage ./linux.nix { };
24
24
+
in mkDerivation {
25
25
+
pname = "p4v";
26
26
+
version = "2022.2.2336701";
69
27
70
70
-
dontBuild = true;
28
28
+
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
71
29
72
72
-
# Don't wrap the Qt apps; upstream has its own wrapper scripts.
73
73
-
dontWrapQtApps = true;
74
74
-
75
75
-
installPhase = ''
76
76
-
mkdir -p $out
77
77
-
cp -r bin lib $out
78
78
-
addAutoPatchelfSearchPath $out/lib
79
79
-
'';
80
80
-
81
81
-
meta = {
82
82
-
description = "Perforce Helix Visual Client";
83
83
-
homepage = "https://www.perforce.com";
84
84
-
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
85
85
-
license = lib.licenses.unfreeRedistributable;
86
86
-
platforms = [ "x86_64-linux" ];
87
87
-
maintainers = with lib.maintainers; [ impl nathyong nioncode ];
88
88
-
};
30
30
+
meta = {
31
31
+
description = "Perforce Helix Visual Client";
32
32
+
homepage = "https://www.perforce.com";
33
33
+
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
34
34
+
license = lib.licenses.unfreeRedistributable;
35
35
+
platforms = builtins.attrNames srcs;
36
36
+
maintainers = with lib.maintainers; [ impl nathyong nioncode ];
89
37
};
90
90
-
in
91
91
-
stdenv.mkDerivation {
92
92
-
inherit pname version;
93
93
-
94
94
-
# Build a "clean" version of the package so that we don't add extra ".bin" or
95
95
-
# configuration files to users' PATHs. We can't easily put the unwrapped
96
96
-
# package files in libexec (where they belong, probably) because the upstream
97
97
-
# wrapper scripts have the bin directory hardcoded.
98
98
-
buildCommand = ''
99
99
-
mkdir -p $out/bin
100
100
-
for f in p4admin p4merge p4v p4vc; do
101
101
-
ln -s ${unwrapped}/bin/$f $out/bin
102
102
-
done
103
103
-
'';
104
104
-
preferLocalBuild = true;
105
105
-
106
106
-
inherit (unwrapped) meta passthru;
107
38
}
+89
pkgs/applications/version-management/p4v/linux.nix
···
1
1
+
{ stdenv
2
2
+
, autoPatchelfHook
3
3
+
, cups
4
4
+
, dbus
5
5
+
, fontconfig
6
6
+
, gccForLibs
7
7
+
, libX11
8
8
+
, libXcomposite
9
9
+
, libXcursor
10
10
+
, libXdamage
11
11
+
, libXext
12
12
+
, libXi
13
13
+
, libXrandr
14
14
+
, libXrender
15
15
+
, libXtst
16
16
+
, libinput
17
17
+
, libxcb
18
18
+
, libxkbcommon
19
19
+
, nss
20
20
+
, qttools
21
21
+
, qtwebengine
22
22
+
, xcbutilimage
23
23
+
, xcbutilkeysyms
24
24
+
, xcbutilrenderutil
25
25
+
, xcbutilwm
26
26
+
}:
27
27
+
28
28
+
{ pname, version, src, meta }:
29
29
+
let
30
30
+
unwrapped = stdenv.mkDerivation {
31
31
+
pname = "${pname}-unwrapped";
32
32
+
inherit version src meta;
33
33
+
34
34
+
nativeBuildInputs = [ autoPatchelfHook ];
35
35
+
buildInputs = [
36
36
+
cups
37
37
+
dbus
38
38
+
fontconfig
39
39
+
gccForLibs
40
40
+
libX11
41
41
+
libXcomposite
42
42
+
libXcursor
43
43
+
libXdamage
44
44
+
libXext
45
45
+
libXi
46
46
+
libXrandr
47
47
+
libXrender
48
48
+
libXtst
49
49
+
libinput
50
50
+
libxcb
51
51
+
libxkbcommon
52
52
+
nss
53
53
+
qttools
54
54
+
qtwebengine
55
55
+
xcbutilimage
56
56
+
xcbutilkeysyms
57
57
+
xcbutilrenderutil
58
58
+
xcbutilwm
59
59
+
];
60
60
+
61
61
+
dontBuild = true;
62
62
+
63
63
+
# Don't wrap the Qt apps; upstream has its own wrapper scripts.
64
64
+
dontWrapQtApps = true;
65
65
+
66
66
+
installPhase = ''
67
67
+
mkdir -p $out
68
68
+
cp -r bin lib $out
69
69
+
addAutoPatchelfSearchPath $out/lib
70
70
+
'';
71
71
+
};
72
72
+
in
73
73
+
stdenv.mkDerivation {
74
74
+
inherit pname version;
75
75
+
76
76
+
# Build a "clean" version of the package so that we don't add extra ".bin" or
77
77
+
# configuration files to users' PATHs. We can't easily put the unwrapped
78
78
+
# package files in libexec (where they belong, probably) because the upstream
79
79
+
# wrapper scripts have the bin directory hardcoded.
80
80
+
buildCommand = ''
81
81
+
mkdir -p $out/bin
82
82
+
for f in p4admin p4merge p4v p4vc; do
83
83
+
ln -s ${unwrapped}/bin/$f $out/bin
84
84
+
done
85
85
+
'';
86
86
+
preferLocalBuild = true;
87
87
+
88
88
+
inherit (unwrapped) meta passthru;
89
89
+
}
+1
-1
pkgs/top-level/all-packages.nix
···
30207
30207
30208
30208
p4 = callPackage ../applications/version-management/p4 { };
30209
30209
p4d = callPackage ../applications/version-management/p4d { };
30210
30210
-
p4v = libsForQt515.callPackage ../applications/version-management/p4v { };
30210
30210
+
p4v = callPackage ../applications/version-management/p4v { };
30211
30211
30212
30212
partio = callPackage ../development/libraries/partio {};
30213
30213