Unverified Commit 2200d554 authored by Marcin Serwin's avatar Marcin Serwin
Browse files

sourcehut.gitsrht: 0.85.9 -> 0.88.10

parent a7e19463
Loading
Loading
Loading
Loading
+45 −41
Original line number Diff line number Diff line
@@ -11,42 +11,44 @@
  pythonOlder,
  unzip,
  pip,
  setuptools,
  setuptools-scm,
}:
let
  version = "0.85.9";
  version = "0.88.10";
  gqlgen = import ./fix-gqlgen-trimpath.nix {
    inherit unzip;
    gqlgenVersion = "0.17.42";
    gqlgenVersion = "0.17.64";
  };

  src = fetchFromSourcehut {
    owner = "~sircmpwn";
    repo = "git.sr.ht";
    rev = version;
    hash = "sha256-tmbBw6x3nqN9nRIR3xOXQ+L5EACXLQYLXQYK3lsOsAI=";
    hash = "sha256-o7d2EIx9oJAQSIrMMG/TYjAo7PJwT6rE8kcVMKoYenY=";
  };

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

  gitApi = buildGoModule (
    {
      inherit src version;
      inherit src version patches;
      pname = "gitsrht-api";
      modRoot = "api";
      vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
      vendorHash = "sha256-20SxOZrvj41L8A5nuOro9DYiK6FyhwJK5cNAvxPB7qw=";
    }
    // gqlgen
  );

  gitDispatch = buildGoModule (
    {
      inherit src version;
      inherit src version patches;
      pname = "gitsrht-dispatch";
      modRoot = "gitsrht-dispatch";
      vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
      modRoot = "dispatch";
      vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";

      postPatch = ''
        substituteInPlace gitsrht-dispatch/main.go \
          --replace /var/log/gitsrht-dispatch /var/log/sourcehut/gitsrht-dispatch
        substituteInPlace dispatch/main.go \
          --replace-fail /var/log/git.sr.ht-dispatch /var/log/sourcehut/git.sr.ht-dispatch
      '';
    }
    // gqlgen
@@ -54,14 +56,14 @@ let

  gitKeys = buildGoModule (
    {
      inherit src version;
      inherit src version patches;
      pname = "gitsrht-keys";
      modRoot = "gitsrht-keys";
      vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
      modRoot = "keys";
      vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";

      postPatch = ''
        substituteInPlace gitsrht-keys/main.go \
          --replace /var/log/gitsrht-keys /var/log/sourcehut/gitsrht-keys
        substituteInPlace keys/main.go \
          --replace-fail /var/log/git.sr.ht-keys /var/log/sourcehut/git.sr.ht-keys
      '';
    }
    // gqlgen
@@ -69,14 +71,14 @@ let

  gitShell = buildGoModule (
    {
      inherit src version;
      inherit src version patches;
      pname = "gitsrht-shell";
      modRoot = "gitsrht-shell";
      vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
      modRoot = "shell";
      vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";

      postPatch = ''
        substituteInPlace gitsrht-shell/main.go \
          --replace /var/log/gitsrht-shell /var/log/sourcehut/gitsrht-shell
        substituteInPlace shell/main.go \
          --replace-fail /var/log/git.sr.ht-shell /var/log/sourcehut/git.sr.ht-shell
      '';
    }
    // gqlgen
@@ -84,34 +86,29 @@ let

  gitUpdateHook = buildGoModule (
    {
      inherit src version;
      inherit src version patches;
      pname = "gitsrht-update-hook";
      modRoot = "gitsrht-update-hook";
      vendorHash = "sha256-4KwnUi6ILUagMDXzuBG9CRT2N8uyjvRM74TwJqIzicc=";
      modRoot = "update-hook";
      vendorHash = "sha256-MXLF7vO8SmUkU1nOxhObuzjT2ZRQQluIX7TRrxL7/3Y=";

      postPatch = ''
        substituteInPlace gitsrht-update-hook/main.go \
          --replace /var/log/gitsrht-update-hook /var/log/sourcehut/gitsrht-update-hook
        substituteInPlace update-hook/main.go \
          --replace-fail /var/log/git.sr.ht-update-hook /var/log/sourcehut/git.sr.ht-update-hook
      '';
    }
    // gqlgen
  );
in
buildPythonPackage rec {
  inherit src version;
  inherit src version patches;
  pname = "gitsrht";
  pyproject = true;

  disabled = pythonOlder "3.7";

  postPatch = ''
    substituteInPlace Makefile \
      --replace "all: api gitsrht-dispatch gitsrht-keys gitsrht-shell gitsrht-update-hook" ""
  '';

  nativeBuildInputs = [
    pip
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
@@ -121,18 +118,25 @@ buildPythonPackage rec {
    minio
  ];

  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 = ''
    mkdir -p $out/bin
    ln -s ${gitApi}/bin/api $out/bin/gitsrht-api
    ln -s ${gitDispatch}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
    ln -s ${gitKeys}/bin/gitsrht-keys $out/bin/gitsrht-keys
    ln -s ${gitShell}/bin/gitsrht-shell $out/bin/gitsrht-shell
    ln -s ${gitUpdateHook}/bin/gitsrht-update-hook $out/bin/gitsrht-update-hook
    ln -s ${gitApi}/bin/api $out/bin/git.sr.ht-api
    ln -s ${gitDispatch}/bin/dispatch $out/bin/git.sr.ht-dispatch
    ln -s ${gitKeys}/bin/keys $out/bin/git.sr.ht-keys
    ln -s ${gitShell}/bin/shell $out/bin/git.sr.ht-shell
    ln -s ${gitUpdateHook}/bin/update-hook $out/bin/git.sr.ht-update-hook
    install -Dm644 schema.sql $out/share/sourcehut/git.sr.ht-schema.sql
    make PREFIX=$out install-share
  '';

  pythonImportsCheck = [ "gitsrht" ];
+26 −0
Original line number Diff line number Diff line
diff --git a/go.mod b/go.mod
index b1e0834..8299f9b 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
 	git.sr.ht/~sircmpwn/scm.sr.ht/srht-keys v0.0.0-20241202093706-8da5ec7e6b94
 	git.sr.ht/~turminal/go-fnmatch v0.0.0-20211021204744-1a55764af6de
diff --git a/go.sum b/go.sum
index 193cce9..9b0bda4 100644
--- a/go.sum
+++ b/go.sum
@@ -35,6 +35,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
 git.sr.ht/~sircmpwn/core-go v0.0.0-20240124105042-864816cfbc0c/go.mod h1:OovCpg5LsbYJjmDTpk5wUgHM4tUor736Pmxekm9BUcQ=
 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-20221010085743-46c4299d76a1/go.mod h1:8neHEO3503w/rNtttnR0JFpQgM/GFhaafVwvkPsFIDw=
 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=