about summary refs log tree commit diff
path: root/nixpkgs/pkgs
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-22 11:52:07 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-30 09:49:13 +0000
commit2833e04273a923911617750c8aa8e8b63e92a1ce (patch)
tree88637f54179b8a3f1b8bf9ed9d307a9c70184d25 /nixpkgs/pkgs
parent17779f15adfd0829399fb3520d00d01081aee3e7 (diff)
downloadnixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.tar
nixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.tar.gz
nixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.tar.bz2
nixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.tar.lz
nixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.tar.xz
nixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.tar.zst
nixlib-2833e04273a923911617750c8aa8e8b63e92a1ce.zip
cgit-pink: init at 1.3.0
cgit-pink is a fork of cgit that aims to be better maintained, because
cgit doesn't get a lot of attention any more, and almost every patch
sent in the last couple of years has been ignored.

The build system is exactly the same as cgit's, so I've created a
common cgit builder function.  This way, improvements to cgit
packaging (I've already noticed a couple to make!) can be shared
between both packages.  If the build systems diverge, we can separate
them out in future.

(cherry picked from commit deab83e11674f1cfbc9d5e5626d12ed9344d8091)
Diffstat (limited to 'nixpkgs/pkgs')
-rw-r--r--nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix78
-rw-r--r--nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix77
-rw-r--r--nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix24
-rw-r--r--nixpkgs/pkgs/top-level/all-packages.nix5
4 files changed, 112 insertions, 72 deletions
diff --git a/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix b/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix
new file mode 100644
index 000000000000..f0e3e4a29d81
--- /dev/null
+++ b/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix
@@ -0,0 +1,78 @@
+{ pname, version, src, gitSrc, buildInputs ? []
+, homepage, repo, description, maintainers
+}:
+
+{ lib, stdenv, openssl, zlib, asciidoc, libxml2, libxslt
+, docbook_xsl, pkg-config
+, coreutils, gnused, groff, docutils
+, gzip, bzip2, lzip, xz, zstd
+, python3Packages
+}:
+
+stdenv.mkDerivation {
+  inherit pname version src gitSrc;
+
+  nativeBuildInputs = [
+    pkg-config asciidoc
+  ] ++ (with python3Packages; [ python wrapPython ]);
+  buildInputs = buildInputs ++ [
+    openssl zlib libxml2 libxslt docbook_xsl
+  ];
+  pythonPath = with python3Packages; [ pygments markdown ];
+
+  postPatch = ''
+    sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
+        -e 's|"bzip2"|"${bzip2.bin}/bin/bzip2"|' \
+        -e 's|"lzip"|"${lzip}/bin/lzip"|' \
+        -e 's|"xz"|"${xz.bin}/bin/xz"|' \
+        -e 's|"zstd"|"${zstd}/bin/zstd"|' \
+        -i ui-snapshot.c
+
+    substituteInPlace filters/html-converters/man2html \
+      --replace 'groff' '${groff}/bin/groff'
+
+    substituteInPlace filters/html-converters/rst2html \
+      --replace 'rst2html.py' '${docutils}/bin/rst2html.py'
+  '';
+
+  # Give cgit a git source tree and pass configuration parameters (as make
+  # variables).
+  preBuild = ''
+    mkdir -p git
+    tar --strip-components=1 -xf "$gitSrc" -C git
+  '';
+
+  makeFlags = [
+    "prefix=$(out)"
+    "CGIT_SCRIPT_PATH=$(out)/cgit/"
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "AR=${stdenv.cc.targetPrefix}ar"
+  ];
+
+  # Install manpage.
+  postInstall = ''
+    # xmllint fails:
+    #make install-man
+
+    # bypassing xmllint works:
+    a2x --no-xmllint -f manpage cgitrc.5.txt
+    mkdir -p "$out/share/man/man5"
+    cp cgitrc.5 "$out/share/man/man5"
+
+    wrapPythonProgramsIn "$out/lib/cgit/filters" "$out $pythonPath"
+
+    for script in $out/lib/cgit/filters/*.sh $out/lib/cgit/filters/html-converters/txt2html; do
+      wrapProgram $script --prefix PATH : '${lib.makeBinPath [ coreutils gnused ]}'
+    done
+  '';
+
+  stripDebugList = [ "cgit" ];
+
+  meta = {
+    inherit homepage description;
+    repositories.git = repo;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = maintainers ++ (with lib.maintainers; [ qyliss ]);
+  };
+}
diff --git a/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix b/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix
index b8f7cee7358c..7d84b286d5f1 100644
--- a/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix
+++ b/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix
@@ -1,11 +1,6 @@
-{ lib, stdenv, fetchurl, openssl, zlib, asciidoc, libxml2, libxslt
-, docbook_xsl, pkg-config, luajit
-, coreutils, gnused, groff, docutils
-, gzip, bzip2, lzip, xz, zstd
-, python, wrapPython, pygments, markdown
-}:
+{ lib, fetchurl, callPackage, luajit }:
 
-stdenv.mkDerivation rec {
+callPackage (import ./common.nix rec {
   pname = "cgit";
   version = "1.2.3";
 
@@ -22,66 +17,10 @@ stdenv.mkDerivation rec {
     sha256 = "09lzwa183nblr6l8ib35g2xrjf9wm9yhk3szfvyzkwivdv69c9r2";
   };
 
-  nativeBuildInputs = [ pkg-config asciidoc ] ++ [ python wrapPython ];
-  buildInputs = [
-    openssl zlib libxml2 libxslt docbook_xsl luajit
-  ];
-  pythonPath = [ pygments markdown ];
+  buildInputs = [ luajit ];
 
-  postPatch = ''
-    sed -e 's|"gzip"|"${gzip}/bin/gzip"|' \
-        -e 's|"bzip2"|"${bzip2.bin}/bin/bzip2"|' \
-        -e 's|"lzip"|"${lzip}/bin/lzip"|' \
-        -e 's|"xz"|"${xz.bin}/bin/xz"|' \
-        -e 's|"zstd"|"${zstd}/bin/zstd"|' \
-        -i ui-snapshot.c
-
-    substituteInPlace filters/html-converters/man2html \
-      --replace 'groff' '${groff}/bin/groff'
-
-    substituteInPlace filters/html-converters/rst2html \
-      --replace 'rst2html.py' '${docutils}/bin/rst2html.py'
-  '';
-
-  # Give cgit a git source tree and pass configuration parameters (as make
-  # variables).
-  preBuild = ''
-    mkdir -p git
-    tar --strip-components=1 -xf "$gitSrc" -C git
-  '';
-
-  makeFlags = [
-    "prefix=$(out)"
-    "CGIT_SCRIPT_PATH=$(out)/cgit/"
-    "CC=${stdenv.cc.targetPrefix}cc"
-    "AR=${stdenv.cc.targetPrefix}ar"
-  ];
-
-  # Install manpage.
-  postInstall = ''
-    # xmllint fails:
-    #make install-man
-
-    # bypassing xmllint works:
-    a2x --no-xmllint -f manpage cgitrc.5.txt
-    mkdir -p "$out/share/man/man5"
-    cp cgitrc.5 "$out/share/man/man5"
-
-    wrapPythonProgramsIn "$out/lib/cgit/filters" "$out $pythonPath"
-
-    for script in $out/lib/cgit/filters/*.sh $out/lib/cgit/filters/html-converters/txt2html; do
-      wrapProgram $script --prefix PATH : '${lib.makeBinPath [ coreutils gnused ]}'
-    done
-  '';
-
-  stripDebugList = [ "cgit" ];
-
-  meta = {
-    homepage = "https://git.zx2c4.com/cgit/about/";
-    repositories.git = "git://git.zx2c4.com/cgit";
-    description = "Web frontend for git repositories";
-    license = lib.licenses.gpl2;
-    platforms = lib.platforms.linux;
-    maintainers = with lib.maintainers; [ bjornfor ];
-  };
-}
+  homepage = "https://git.zx2c4.com/cgit/about/";
+  repo = "git://git.zx2c4.com/cgit";
+  description = "Web frontend for git repositories";
+  maintainers = with lib.maintainers; [ bjornfor ];
+}) {}
diff --git a/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix b/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix
new file mode 100644
index 000000000000..2719bc122530
--- /dev/null
+++ b/nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, callPackage }:
+
+callPackage (import ./common.nix rec {
+  pname = "cgit-pink";
+  version = "1.3.0";
+
+  src = fetchurl {
+    url = "https://git.causal.agency/cgit-pink/snapshot/cgit-pink-${version}.tar.gz";
+    sha256 = "sha256-oL46NWgqi1VqKNEt0QGBWNXbi2l7nOQDZy1aMivcWuM=";
+  };
+
+  # cgit-pink is tightly coupled with git and needs a git source tree to build.
+  # IMPORTANT: Remember to check which git version cgit-pink needs on every
+  # version bump (look for "GIT_VER" in the top-level Makefile).
+  gitSrc = fetchurl {
+    url    = "mirror://kernel/software/scm/git/git-2.35.1.tar.xz";
+    sha256 = "sha256-12hSjmRD9logMDYmbxylD50Se6iXUeMurTcRftkZEIA=";
+  };
+
+  homepage = "https://git.causal.agency/cgit-pink/about/";
+  repo = "https://git.causal.agency/cgit-pink";
+  description = "cgit fork aiming for better maintenance";
+  maintainers = with lib.maintainers; [ qyliss sternenseemann ];
+}) {}
diff --git a/nixpkgs/pkgs/top-level/all-packages.nix b/nixpkgs/pkgs/top-level/all-packages.nix
index cba32d94217a..20517a1dc852 100644
--- a/nixpkgs/pkgs/top-level/all-packages.nix
+++ b/nixpkgs/pkgs/top-level/all-packages.nix
@@ -25021,9 +25021,8 @@ with pkgs;
 
   centerim = callPackage ../applications/networking/instant-messengers/centerim { };
 
-  cgit = callPackage ../applications/version-management/git-and-tools/cgit {
-    inherit (python3Packages) python wrapPython pygments markdown;
-  };
+  cgit = callPackage ../applications/version-management/git-and-tools/cgit { };
+  cgit-pink = callPackage ../applications/version-management/git-and-tools/cgit/pink.nix { };
 
   chatty = callPackage ../applications/networking/instant-messengers/chatty { };