forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
61 lines
1.6 KiB
Nix
61 lines
1.6 KiB
Nix
{ lib, stdenv
|
|
, fetchurl
|
|
, gcc-unwrapped
|
|
, dpkg
|
|
, bash
|
|
, nodePackages
|
|
, makeWrapper
|
|
, electron_6
|
|
}:
|
|
|
|
let
|
|
electron = electron_6;
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "openbazaar-client";
|
|
version = "2.4.9";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/OpenBazaar/openbazaar-desktop/releases/download/v${version}/openbazaar2client_${version}_amd64.deb";
|
|
sha256 = "1l6l72kb5h5f32dl5wqv31sigl3fh2byixv0h0d3icmjf558c39p";
|
|
};
|
|
|
|
dontBuild = true;
|
|
dontConfigure = true;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
unpackPhase = ''
|
|
${dpkg}/bin/dpkg-deb -x $src .
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin $out/share/{${pname},applications,pixmaps}
|
|
|
|
cp -a usr/lib/openbazaar2client/{locales,resources} $out/share/${pname}
|
|
cp -a usr/share/applications/openbazaar2client.desktop $out/share/applications/${pname}.desktop
|
|
cp -a usr/share/pixmaps/openbazaar2client.png $out/share/pixmaps/${pname}.png
|
|
|
|
substituteInPlace $out/share/applications/${pname}.desktop \
|
|
--replace 'openbazaar2client' 'openbazaar-client'
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
postFixup = ''
|
|
makeWrapper ${electron}/bin/electron $out/bin/${pname} \
|
|
--add-flags $out/share/${pname}/resources/app \
|
|
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ gcc-unwrapped.lib ]}"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Decentralized Peer to Peer Marketplace for Bitcoin - client";
|
|
homepage = "https://www.openbazaar.org/";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ prusnak ];
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|