p4v: add support for x86_64-darwin

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