ricochet-refresh-nixpkgs/default.nix
2023-07-27 12:42:52 +00:00

63 lines
1 KiB
Nix

{ stdenv
, pkg-config
, lib
, qtbase
, qtquickcontrols2
, qtmultimedia
, qttools
, cmake
, fmt_9
, tor
, openssl
, protobuf
, wrapQtAppsHook
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "ricochet-refresh";
version = "3.0.16-release";
src = fetchFromGitHub {
owner = "blueprint-freespeech";
repo = "ricochet-refresh";
rev = "v${version}";
sha256 = "sha256-Jh5KD+XXL7Zbu/G84Z8z4hvBP0xEsOq/G9IutoUrCMI=";
};
buildInputs = [
tor
fmt_9
openssl
qtquickcontrols2
qtmultimedia
protobuf
qttools
qtbase
];
nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
qtWrapperArgs = [ "--prefix PATH : ${tor}/bin" ];
cmakeFlags = [
"-S ../src"
"-DCMAKE_BUILD_TYPE=MinSizeRel"
"-DRICOCHET_REFRESH_INSTALL_DESKTOP=ON"
"-DUSE_SUBMODULE_FMT=OFF"
];
postUnpack = ''
TOR_SRC=$(tar --list --file ${tor.src} --occurrence --wildcards '*')
TOR_DIR=source/src/extern/tor
tar -xf ${tor.src}
rm -d $TOR_DIR
mv $TOR_SRC $TOR_DIR
'';
postInstall = ''
mv $out/usr/* $out
rm -d $out/usr
'';
}