2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, pkg-config
|
|
|
|
, zlib
|
|
|
|
, geoip
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mirrorbits";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.5.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "etix";
|
|
|
|
repo = "mirrorbits";
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-Ta3+Y3P74cvx09Z4rB5ObgBZtfF4grVgyeZ57yFPlGM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
vendorHash = null;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
2023-02-02 18:25:31 +00:00
|
|
|
# Add Go Modules support
|
2020-04-24 23:36:52 +00:00
|
|
|
(fetchpatch {
|
2023-02-02 18:25:31 +00:00
|
|
|
url = "https://github.com/etix/mirrorbits/commit/955a8b2e1aacea1cae06396a64afbb531ceb36d4.patch";
|
|
|
|
hash = "sha256-KJgj3ynnjjiXG5qsUmzBiMjGEwfvM/9Ap+ZgUdhclik=";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ zlib geoip ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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.
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|