Merge pull request #169636 from WolfangAukang/bashblog

bashblog: init at unstable-2022-03-26
This commit is contained in:
Sandro 2022-05-03 09:45:25 +02:00 committed by GitHub
commit f20de92232
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 86 additions and 0 deletions

View File

@ -0,0 +1,25 @@
From 1990ac93c9dbf3ada0eb2f045ef1aa95bbef7018 Mon Sep 17 00:00:00 2001
From: "P. R. d. O" <d.ol.rod@tutanota.com>
Date: Thu, 21 Apr 2022 07:40:30 -0600
Subject: [PATCH] Setting markdown_bin
---
bb.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bb.sh b/bb.sh
index 9d8e645..40fb54d 100755
--- a/bb.sh
+++ b/bb.sh
@@ -160,7 +160,7 @@ global_variables() {
# Markdown location. Trying to autodetect by default.
# The invocation must support the signature 'markdown_bin in.md > out.html'
- [[ -f Markdown.pl ]] && markdown_bin=./Markdown.pl || markdown_bin=$(which Markdown.pl 2>/dev/null || which markdown 2>/dev/null)
+ markdown_bin=@markdown_path@
}
# Check for the validity of some variables
--
2.35.1

View File

@ -0,0 +1,59 @@
{ stdenv
, lib
, fetchzip
, fetchFromGitHub
, makeWrapper
, substituteAll
, perlPackages
# Flags to enable processors
# Currently, Markdown.pl does not work
, usePandoc ? true
, pandoc }:
let
inherit (perlPackages) TextMarkdown;
# As bashblog supports various markdown processors
# we can set flags to enable a certain processor
markdownpl_path = "${perlPackages.TextMarkdown}/bin/Markdown.pl";
pandoc_path = "${pandoc}/bin/pandoc";
in stdenv.mkDerivation rec {
pname = "bashblog";
version = "unstable-2022-03-26";
src = fetchFromGitHub {
owner = "cfenollosa";
repo = "bashblog";
rev = "c3d4cc1d905560ecfefce911c319469f7a7ff8a8";
sha256 = "sha256-THlP/JuaZzDq9QctidwLRiUVFxRhGNhRKleWbQiqsgg=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ TextMarkdown ]
++ lib.optionals usePandoc [ pandoc ];
patches = [
(substituteAll {
src = ./0001-Setting-markdown_bin.patch;
markdown_path = if usePandoc then pandoc_path else markdownpl_path;
})
];
postPatch = ''
patchShebangs bb.sh
'';
installPhase = ''
mkdir -p $out/bin
install -Dm755 bb.sh $out/bin/bashblog
'';
meta = with lib; {
description = "A single Bash script to create blogs";
homepage = "https://github.com/cfenollosa/bashblog";
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = with maintainers; [ wolfangaukang ];
};
}

View File

@ -1874,6 +1874,8 @@ with pkgs;
awless = callPackage ../tools/virtualization/awless { }; awless = callPackage ../tools/virtualization/awless { };
bashblog = callPackage ../tools/text/bashblog { };
berglas = callPackage ../tools/admin/berglas { }; berglas = callPackage ../tools/admin/berglas { };
betterdiscordctl = callPackage ../tools/misc/betterdiscordctl { }; betterdiscordctl = callPackage ../tools/misc/betterdiscordctl { };