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
49 lines
1.5 KiB
Nix
49 lines
1.5 KiB
Nix
{ lib, stdenv
|
|
, fetchurl
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "openbazaar";
|
|
version = "0.14.3";
|
|
|
|
suffix = {
|
|
i686-linux = "linux-386";
|
|
x86_64-darwin = "darwin-10.6-amd64";
|
|
x86_64-linux = "linux-amd64";
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/OpenBazaar/openbazaar-go/releases/download/v${version}/${pname}-go-${suffix}";
|
|
sha256 = {
|
|
i686-linux = "098dgxpz9m4rfswc9yg77s3bvaifd4453s20n8kmh55g5ipgs2x1";
|
|
x86_64-darwin = "0q989m4zj7x9d6vimmpfkla78hmx2zr7bxm9yg61ir00w60l14jx";
|
|
x86_64-linux = "093rwn4nfirknbxz58n16v0l0apj2h0yr63f64fqysmy78883al2";
|
|
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
};
|
|
|
|
dontUnpack = true;
|
|
dontConfigure = true;
|
|
dontBuild = true;
|
|
dontStrip = true;
|
|
dontPatchELF = true;
|
|
preferLocalBuild = true;
|
|
|
|
installPhase = ''
|
|
install -D $src $out/bin/openbazaard
|
|
'';
|
|
|
|
postFixup = stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
|
patchelf \
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
$out/bin/openbazaard
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Decentralized Peer to Peer Marketplace for Bitcoin - daemon";
|
|
homepage = "https://www.openbazaar.org/";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ prusnak ];
|
|
platforms = [ "i686-linux" "x86_64-darwin" "x86_64-linux" ];
|
|
};
|
|
}
|