mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-29 08:14:19 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
65 lines
1.4 KiB
Nix
65 lines
1.4 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, openjdk
|
|
, libnotify
|
|
, makeWrapper
|
|
, tor
|
|
, p7zip
|
|
, bash
|
|
, writeScript
|
|
}:
|
|
let
|
|
|
|
briar-tor = writeScript "briar-tor" ''
|
|
#! ${bash}/bin/bash
|
|
exec ${tor}/bin/tor "$@"
|
|
'';
|
|
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "briar-desktop";
|
|
version = "0.6.0-beta";
|
|
|
|
src = fetchurl {
|
|
url = "https://desktop.briarproject.org/jars/linux/${version}/briar-desktop-linux-${version}.jar";
|
|
hash = "sha256-ITlg2THQwP91nVxHhLfXPBtC4e3EU9V7D/15XqWC7FE=";
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
p7zip
|
|
];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/{bin,lib}
|
|
cp ${src} $out/lib/briar-desktop.jar
|
|
makeWrapper ${openjdk}/bin/java $out/bin/briar-desktop \
|
|
--add-flags "-jar $out/lib/briar-desktop.jar" \
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
|
|
libnotify
|
|
]}"
|
|
'';
|
|
|
|
fixupPhase = ''
|
|
# Replace the embedded Tor binary (which is in a Tar archive)
|
|
# with one from Nixpkgs.
|
|
cp ${briar-tor} ./tor
|
|
for arch in {aarch64,armhf,x86_64}; do
|
|
7z a tor_linux-$arch.zip tor
|
|
7z a $out/lib/briar-desktop.jar tor_linux-$arch.zip
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Decentalized and secure messnger";
|
|
mainProgram = "briar-desktop";
|
|
homepage = "https://code.briarproject.org/briar/briar-desktop";
|
|
license = licenses.gpl3;
|
|
maintainers = with maintainers; [ onny ];
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|