Merge pull request #329974 from rnhmjoj/pr-magnetico

magnetico: unstable-2022-08-10 -> 0.12.1
This commit is contained in:
Michele Guerini Rocco 2024-07-26 08:04:44 +02:00 committed by GitHub
commit 4a8e77c706
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,55 +1,37 @@
{ lib
, fetchFromGitHub
, fetchpatch
, nixosTests
, stdenv
, fetchFromGitea
, buildGoModule
, nixosTests
, sqlite
}:
buildGoModule {
buildGoModule rec {
pname = "magnetico";
version = "unstable-2022-08-10";
version = "0.12.1";
src = fetchFromGitHub {
owner = "ireun";
src = fetchFromGitea {
domain = "maxwell.ydns.eu/git";
owner = "rnhmjoj";
repo = "magnetico";
rev = "828e230d3b3c0759d3274e27f5a7b70400f4d6ea";
hash = "sha256-V1pBzillWTk9iuHAhFztxYaq4uLL3U3HYvedGk6ffbk=";
rev = "v${version}";
hash = "sha256-cO5TVtQ1jdW1YkFtj35kmRfJG46/lXjXyz870NCPT0g=";
};
patches = [
# https://github.com/ireun/magnetico/pull/15
(fetchpatch {
url = "https://github.com/ireun/magnetico/commit/90db34991aa44af9b79ab4710c638607c6211c1c.patch";
hash = "sha256-wC9lVQqfngQ5AaRgb4TtoWSgbQ2iSHeQ2UBDUyWjMK8=";
})
];
vendorHash = "sha256-JDrBXjnQAcWp8gKvnm+q1F5oV+FozKUvhHK/Me/Cyj8=";
vendorHash = "sha256-jIVMQtPCq9RYaYsH4LSZJFspH6TpCbgzHN0GX8cM/CI=";
buildInputs = [ sqlite ];
buildPhase = ''
runHook preBuild
tags = [ "fts5" "libsqlite3" ];
ldflags = [ "-s" "-w" ];
make magneticow magneticod
runHook postBuild
'';
checkPhase = ''
runHook preCheck
make test
runHook postCheck
'';
doCheck = !stdenv.hostPlatform.isStatic;
passthru.tests = { inherit (nixosTests) magnetico; };
meta = with lib; {
description = "Autonomous (self-hosted) BitTorrent DHT search engine suite";
homepage = "https://github.com/ireun/magnetico";
homepage = "https://maxwell.ydns.eu/git/rnhmjoj/magnetico";
license = licenses.agpl3Only;
badPlatforms = platforms.darwin;
maintainers = with maintainers; [ rnhmjoj ];