Skip to content

Commit

Permalink
p4v: 2020.1.1966006 -> 2021.3.2186916
Browse files Browse the repository at this point in the history
  • Loading branch information
corngood committed Jan 26, 2022
1 parent 120a601 commit 1613130
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
48 changes: 38 additions & 10 deletions pkgs/applications/version-management/p4v/default.nix
@@ -1,12 +1,38 @@
{ stdenv, fetchurl, lib, qtbase, qtmultimedia, qtscript, qtsensors, qtwebengine, qtwebkit, openssl, xkeyboard_config, patchelfUnstable, wrapQtAppsHook }:
{ stdenv
, fetchurl
, lib
, qtbase
, qtwebengine
, qtdeclarative
, qtwebchannel
, syntax-highlighting
, openssl
, xkeyboard_config
, patchelfUnstable
, wrapQtAppsHook
, writeText
}:
let
# This abomination exists because p4v calls CRYPTO_set_mem_functions and
# expects it to succeed. The function will fail if CRYPTO_malloc has already
# been called, which happens at init time via qtwebengine -> ... -> libssh. I
# suspect it was meant to work with a version of Qt where openssl is
# statically linked or some other library is used.
crypto-hack = writeText "crypto-hack.c" ''
#include <stddef.h>
int CRYPTO_set_mem_functions(
void *(*m)(size_t, const char *, int),
void *(*r)(void *, size_t, const char *, int),
void (*f)(void *, const char *, int)) { return 1; }
'';

stdenv.mkDerivation rec {
in stdenv.mkDerivation rec {
pname = "p4v";
version = "2020.1.1966006";
version = "2021.3.2186916";

src = fetchurl {
url = "https://cdist2.perforce.com/perforce/r20.1/bin.linux26x86_64/p4v.tgz";
sha256 = "0zc70d7jgdrd2jli338n1h05hgb7jmmv8hvq205wh78vvllrlv10";
url = "http://web.archive.org/web/20211118024745/https://cdist2.perforce.com/perforce/r21.3/bin.linux26x86_64/p4v.tgz";
sha256 = "1zldg21xq4srww9pcfbv3p8320ghjnh333pz5r70z1gwbq4vf3jq";
};

dontBuild = true;
Expand All @@ -15,11 +41,10 @@ stdenv.mkDerivation rec {
ldLibraryPath = lib.makeLibraryPath [
stdenv.cc.cc.lib
qtbase
qtmultimedia
qtscript
qtsensors
qtwebengine
qtwebkit
qtdeclarative
qtwebchannel
syntax-highlighting
openssl
];

Expand All @@ -29,14 +54,17 @@ stdenv.mkDerivation rec {
cp -r bin $out
mkdir -p $out/lib
cp -r lib/P4VResources $out/lib
$CC -fPIC -shared -o $out/lib/libcrypto-hack.so ${crypto-hack}
for f in $out/bin/*.bin ; do
patchelf --set-rpath $ldLibraryPath --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $f
# combining this with above breaks rpath (patchelf bug?)
patchelf --add-needed libstdc++.so $f \
patchelf --add-needed libstdc++.so \
--add-needed $out/lib/libcrypto-hack.so \
--clear-symbol-version _ZNSt20bad_array_new_lengthD1Ev \
--clear-symbol-version _ZTVSt20bad_array_new_length \
--clear-symbol-version _ZTISt20bad_array_new_length \
--clear-symbol-version _ZdlPvm \
$f
wrapQtApp $f \
--suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb
Expand Down
3 changes: 1 addition & 2 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -27555,8 +27555,7 @@ with pkgs;
ostinato = libsForQt5.callPackage ../applications/networking/ostinato { };

p4 = callPackage ../applications/version-management/p4 { };
# Broken with Qt5.15 because qtwebkit is broken with it
p4v = libsForQt514.callPackage ../applications/version-management/p4v { };
p4v = libsForQt515.callPackage ../applications/version-management/p4v { };

partio = callPackage ../development/libraries/partio {};

Expand Down

0 comments on commit 1613130

Please sign in to comment.