about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/version-management/sourcehut/git.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-08-22 13:47:37 +0000
committerAlyssa Ross <hi@alyssa.is>2019-08-22 18:22:22 +0000
commit1b9a13c4689af7e088eb7af5589f8c811282846a (patch)
tree3ed032953008280fb94ef894c869ff3e2a2f7865 /nixpkgs/pkgs/applications/version-management/sourcehut/git.nix
parent4999a38db7c5de0ea9f514a12ecd4133cce647f3 (diff)
parent1412af4b2cfae71d447164097d960d426e9752c0 (diff)
downloadnixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.gz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.bz2
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.lz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.xz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.zst
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.zip
Merge remote-tracking branch 'channels/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/applications/version-management/sourcehut/git.nix')
-rw-r--r--nixpkgs/pkgs/applications/version-management/sourcehut/git.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/version-management/sourcehut/git.nix b/nixpkgs/pkgs/applications/version-management/sourcehut/git.nix
new file mode 100644
index 000000000000..996663761a7d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/version-management/sourcehut/git.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchgit, buildPythonPackage
+, python
+, buildGoModule
+, srht, pygit2, scmsrht }:
+
+let
+  version = "0.32.3";
+
+  buildDispatcher = src: buildGoModule {
+    inherit src version;
+    pname = "git-sr-ht-dispatcher";
+    goPackagePath = "git.sr.ht/~sircmpwn/git.sr.ht/gitsrht-dispatch";
+
+    modSha256 = "1lmgmlin460g09dph2hw6yz25d4agqwjhrjv0qqsis7df9qpf3i1";
+  };
+in buildPythonPackage rec {
+  inherit version;
+  pname = "gitsrht";
+
+  src = fetchgit {
+    url = "https://git.sr.ht/~sircmpwn/git.sr.ht";
+    rev = version;
+    sha256 = "0grycmblhm9dnhcf1kcmn6bclgb9znahk2026dan58m9j9pja5vw";
+  };
+
+  patches = [
+    ./use-srht-path.patch
+  ];
+
+  nativeBuildInputs = srht.nativeBuildInputs;
+
+  propagatedBuildInputs = [
+    srht
+    pygit2
+    scmsrht
+  ];
+
+  preBuild = ''
+    export PKGVER=${version}
+    export SRHT_PATH=${srht}/${python.sitePackages}/srht
+  '';
+
+  # TODO: Remove redundant mkdir?
+  postInstall = ''
+    mkdir -p $out/bin
+    cp ${buildDispatcher "${src}/gitsrht-dispatch"}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://git.sr.ht/~sircmpwn/git.sr.ht;
+    description = "Git repository hosting service for the sr.ht network";
+    license = licenses.agpl3;
+    maintainers = with maintainers; [ eadwu ];
+  };
+}