2018-07-21 02:44:44 +02:00
|
|
|
{ lib, buildGoPackage, fetchFromGitHub, fetchpatch
|
2021-01-19 07:50:56 +01:00
|
|
|
, pkg-config, zlib, geoip }:
|
2017-09-18 21:52:51 +02:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "mirrorbits";
|
2017-09-18 21:52:51 +02:00
|
|
|
version = "0.4";
|
|
|
|
rev = "v${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit rev;
|
|
|
|
owner = "etix";
|
|
|
|
repo = "mirrorbits";
|
|
|
|
sha256 = "11f9wczajba147qk5j73pxjrvlxkgr598sjvgjn2b8nxm49g2pan";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/etix/mirrorbits/commit/03a4e02214bdb7bb60240ddf25b887ccac5fb118.patch";
|
|
|
|
sha256 = "08332cfxmp2nsfdj2ymg3lxkav8h44f6cf2h6g9jkn03mkliblm5";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
rm -rf testing
|
|
|
|
'';
|
|
|
|
|
2019-09-05 23:24:31 +02:00
|
|
|
# Fix build with go >=1.12
|
|
|
|
preBuild = ''
|
|
|
|
sed -i s/"_Ctype_struct_GeoIPRecordTag"/"C.struct_GeoIPRecordTag"/ ./go/src/github.com/etix/geoip/geoip.go
|
|
|
|
'';
|
|
|
|
|
2017-09-18 21:52:51 +02:00
|
|
|
goPackagePath = "github.com/etix/mirrorbits";
|
2020-08-31 11:59:33 +02:00
|
|
|
deleteVendor = true;
|
2017-09-18 21:52:51 +02:00
|
|
|
goDeps = ./deps.nix;
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-18 21:52:51 +02:00
|
|
|
buildInputs = [ zlib geoip ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "geographical download redirector for distributing files efficiently across a set of mirrors";
|
|
|
|
homepage = "https://github.com/etix/mirrorbits";
|
|
|
|
longDescription = ''
|
|
|
|
Mirrorbits is a geographical download redirector written in Go for
|
|
|
|
distributing files efficiently across a set of mirrors. It offers
|
|
|
|
a simple and economic way to create a Content Delivery Network
|
|
|
|
layer using a pure software stack. It is primarily designed for
|
|
|
|
the distribution of large-scale Open-Source projects with a lot
|
|
|
|
of traffic.
|
|
|
|
'';
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ fpletz ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
};
|
|
|
|
}
|