Commit 8a3d510d authored by Marcin Serwin's avatar Marcin Serwin Committed by github-actions[bot]
Browse files

sourcehut.hubsrht: 0.17.7 -> 0.20.2

(cherry picked from commit 84bc40a9)
parent 634f3f20
Loading
Loading
Loading
Loading
+21 −16
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
  buildPythonPackage,
  python,
  srht,
  setuptools,
  setuptools-scm,
  pip,
  pyyaml,
  pythonOlder,
@@ -13,43 +13,41 @@
}:

let
  version = "0.17.7";
  version = "0.20.2";
  gqlgen = import ./fix-gqlgen-trimpath.nix {
    inherit unzip;
    gqlgenVersion = "0.17.43";
    gqlgenVersion = "0.17.64";
  };

  patches = [ ./patches/core-go-update/hub/patch-deps.patch ];

  src = fetchFromSourcehut {
    owner = "~sircmpwn";
    repo = "hub.sr.ht";
    rev = version;
    hash = "sha256-IyY7Niy/vZSAXjYZMlxY6uuQ8nH/4yT4+MaRjHtl6G4=";
    hash = "sha256-blaaJ7kQBkswmSpEVEsDm6vaxuMuCcW2wmeN+fbwzjg=";
  };

  hubsrht-api = buildGoModule (
    {
      inherit src version;
      inherit src version patches;
      pname = "hubsrht-api";
      modRoot = "api";
      vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
      vendorHash = "sha256-jKNHZrFydp3+cD8MR2izzE8bi4H2uT/7+x/wmPkEIIc=";
    }
    // gqlgen
  );
in
buildPythonPackage rec {
  inherit src version;
  inherit src version patches;
  pname = "hubsrht";
  pyproject = true;

  disabled = pythonOlder "3.7";

  postPatch = ''
    substituteInPlace Makefile --replace "all: api" ""
  '';

  nativeBuildInputs = [
    pip
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
@@ -57,13 +55,20 @@ buildPythonPackage rec {
    pyyaml
  ];

  preBuild = ''
    export PKGVER=${version}
    export SRHT_PATH=${srht}/${python.sitePackages}/srht
  env = {
    PKGVER = version;
    SRHT_PATH = "${srht}/${python.sitePackages}/srht";
    PREFIX = placeholder "out";
  };

  postBuild = ''
    make SASSC_INCLUDE=-I${srht}/share/sourcehut/scss/ all-share
  '';

  postInstall = ''
    ln -s ${hubsrht-api}/bin/api $out/bin/hubsrht-api
    ln -s ${hubsrht-api}/bin/api $out/bin/hub.sr.ht-api
    install -Dm644 schema.sql $out/share/sourcehut/hub.sr.ht-schema.sql
    make install-share
  '';

  # Module has no tests
+25 −0
Original line number Diff line number Diff line
diff --git a/go.mod b/go.mod
index ea624d5..3674152 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.22.5
 toolchain go1.24.0
 
 require (
-	git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b
+	git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b
 	git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c
 	github.com/99designs/gqlgen v0.17.64
 	github.com/vektah/gqlparser/v2 v2.5.23
diff --git a/go.sum b/go.sum
index f67a555..a366a60 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,7 @@
 git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b h1:d76irAQODAtl5G1zmKfwf60544fyGz74YT9k+7yYVxc=
 git.sr.ht/~sircmpwn/core-go v0.0.0-20250304085405-cbf919e45b5b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b h1:UuQxEJrh/NNdmaVcK34opEz7ypXnPyxeRcT7Aigz+7E=
+git.sr.ht/~sircmpwn/core-go v0.0.0-20250311210855-6ba248d8be1b/go.mod h1:UHi3kXwgfZ/DIbMu5LeqZb3KrY/jsdUDefc8+3YWC3c=
 git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c h1:v2opuaN0C5ZpuCifRNR9ZQ8V9IG+Ja80otK1MFj5RnI=
 git.sr.ht/~sircmpwn/dowork v0.0.0-20241216125407-2b00aa42322c/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
 git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw=