Unverified Commit e6a494be authored by Michele Guerini Rocco's avatar Michele Guerini Rocco Committed by GitHub
Browse files

Merge pull request #319416 from rnhmjoj/pr-magnetico

magnetico: fix build
parents 85d871cf a2395a2e
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, fetchpatch
, nixosTests
, buildGoModule
, sqlite
}:

buildGoModule rec {
buildGoModule {
  pname = "magnetico";
  version = "unstable-2022-08-10";

@@ -12,10 +14,20 @@ buildGoModule rec {
    owner  = "ireun";
    repo   = "magnetico";
    rev    = "828e230d3b3c0759d3274e27f5a7b70400f4d6ea";
    sha256 = "sha256-V1pBzillWTk9iuHAhFztxYaq4uLL3U3HYvedGk6ffbk=";
    hash   = "sha256-V1pBzillWTk9iuHAhFztxYaq4uLL3U3HYvedGk6ffbk=";
  };

  vendorHash = "sha256-ngYkTtBEZSyYYnfBHi0VrotwKGvMOiowbrwigJnjsuU=";
  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=";

  buildInputs = [ sqlite ];

  buildPhase = ''
    runHook preBuild
@@ -26,18 +38,16 @@ buildGoModule rec {
  '';

  checkPhase = ''
    runHook preBuild
    runHook preCheck

    make test

    runHook postBuild
    runHook postCheck
  '';

  passthru.tests = { inherit (nixosTests) magnetico; };

  meta = with lib; {
    # Build fails with Go >=1.21, couldn't be fixed by updating module dependencies.
    broken = true;
    description  = "Autonomous (self-hosted) BitTorrent DHT search engine suite";
    homepage     = "https://github.com/ireun/magnetico";
    license      = licenses.agpl3Only;