Merge master into staging-next
This commit is contained in:
commit
58f8f1f058
6
.github/CODEOWNERS
vendored
6
.github/CODEOWNERS
vendored
@ -42,6 +42,12 @@
|
||||
# Nixpkgs build-support
|
||||
/pkgs/build-support/writers @lassulus @Profpatsch
|
||||
|
||||
# Nixpkgs documentation
|
||||
/maintainers/scripts/db-to-md.sh @jtojnar @ryantm
|
||||
/maintainers/scripts/doc @jtojnar @ryantm
|
||||
/doc/build-aux/pandoc-filters @jtojnar
|
||||
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar
|
||||
|
||||
# NixOS Internals
|
||||
/nixos/default.nix @nbp @infinisil
|
||||
/nixos/lib/from-env.nix @nbp @infinisil
|
||||
|
@ -3,12 +3,17 @@ MD_TARGETS=$(addsuffix .xml, $(basename $(shell find . -type f -regex '.*\.md$$'
|
||||
PANDOC ?= pandoc
|
||||
|
||||
pandoc_media_dir = media
|
||||
# NOTE: Keep in sync with NixOS manual (/nixos/doc/manual/md-to-db.sh).
|
||||
# NOTE: Keep in sync with NixOS manual (/nixos/doc/manual/md-to-db.sh) and conversion script (/maintainers/scripts/db-to-md.sh).
|
||||
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
|
||||
pandoc_commonmark_enabled_extensions = +attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
|
||||
# Not needed:
|
||||
# - docbook-reader/citerefentry-to-rst-role.lua (only relevant for DocBook → MarkDown/rST/MyST)
|
||||
pandoc_flags = --extract-media=$(pandoc_media_dir) \
|
||||
--lua-filter=$(PANDOC_LUA_FILTERS_DIR)/diagram-generator.lua \
|
||||
--lua-filter=labelless-link-is-xref.lua \
|
||||
--lua-filter=build-aux/pandoc-filters/myst-reader/roles.lua \
|
||||
--lua-filter=build-aux/pandoc-filters/link-unix-man-references.lua \
|
||||
--lua-filter=build-aux/pandoc-filters/docbook-writer/rst-roles.lua \
|
||||
--lua-filter=build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua \
|
||||
-f commonmark$(pandoc_commonmark_enabled_extensions)+smart
|
||||
|
||||
.PHONY: all
|
||||
|
@ -0,0 +1,23 @@
|
||||
--[[
|
||||
Converts Code AST nodes produced by pandoc’s DocBook reader
|
||||
from citerefentry elements into AST for corresponding role
|
||||
for reStructuredText.
|
||||
|
||||
We use subset of MyST syntax (CommonMark with features from rST)
|
||||
so let’s use the rST AST for rST features.
|
||||
|
||||
Reference: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage
|
||||
]]
|
||||
|
||||
function Code(elem)
|
||||
elem.classes = elem.classes:map(function (x)
|
||||
if x == 'citerefentry' then
|
||||
elem.attributes['role'] = 'manpage'
|
||||
return 'interpreted-text'
|
||||
else
|
||||
return x
|
||||
end
|
||||
end)
|
||||
|
||||
return elem
|
||||
end
|
@ -1,3 +1,13 @@
|
||||
--[[
|
||||
Converts Link AST nodes with empty label to DocBook xref elements.
|
||||
|
||||
This is a temporary script to be able use cross-references conveniently
|
||||
using syntax taken from MyST, while we still use docbook-xsl
|
||||
for generating the documentation.
|
||||
|
||||
Reference: https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing
|
||||
]]
|
||||
|
||||
local function starts_with(start, str)
|
||||
return str:sub(1, #start) == start
|
||||
end
|
36
doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua
Normal file
36
doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua
Normal file
@ -0,0 +1,36 @@
|
||||
--[[
|
||||
Converts AST for reStructuredText roles into corresponding
|
||||
DocBook elements.
|
||||
|
||||
Currently, only a subset of roles is supported.
|
||||
|
||||
Reference:
|
||||
List of roles:
|
||||
https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
|
||||
manpage:
|
||||
https://tdg.docbook.org/tdg/5.1/citerefentry.html
|
||||
file:
|
||||
https://tdg.docbook.org/tdg/5.1/filename.html
|
||||
]]
|
||||
|
||||
function Code(elem)
|
||||
if elem.classes:includes('interpreted-text') then
|
||||
local tag = nil
|
||||
local content = elem.text
|
||||
if elem.attributes['role'] == 'manpage' then
|
||||
tag = 'citerefentry'
|
||||
local title, volnum = content:match('^(.+)%((%w+)%)$')
|
||||
if title == nil then
|
||||
-- No volnum in parentheses.
|
||||
title = content
|
||||
end
|
||||
content = '<refentrytitle>' .. title .. '</refentrytitle>' .. (volnum ~= nil and ('<manvolnum>' .. volnum .. '</manvolnum>') or '')
|
||||
elseif elem.attributes['role'] == 'file' then
|
||||
tag = 'filename'
|
||||
end
|
||||
|
||||
if tag ~= nil then
|
||||
return pandoc.RawInline('docbook', '<' .. tag .. '>' .. content .. '</' .. tag .. '>')
|
||||
end
|
||||
end
|
||||
end
|
18
doc/build-aux/pandoc-filters/link-unix-man-references.lua
Normal file
18
doc/build-aux/pandoc-filters/link-unix-man-references.lua
Normal file
@ -0,0 +1,18 @@
|
||||
--[[
|
||||
Turns a manpage reference into a link, when a mapping is defined
|
||||
in the unix-man-urls.lua file.
|
||||
]]
|
||||
|
||||
local man_urls = {
|
||||
["tmpfiles.d(5)"] = "https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html",
|
||||
["nix.conf(5)"] = "https://nixos.org/manual/nix/stable/#sec-conf-file",
|
||||
["systemd.time(7)"] = "https://www.freedesktop.org/software/systemd/man/systemd.time.html",
|
||||
["systemd.timer(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.timer.html",
|
||||
}
|
||||
|
||||
function Code(elem)
|
||||
local is_man_role = elem.classes:includes('interpreted-text') and elem.attributes['role'] == 'manpage'
|
||||
if is_man_role and man_urls[elem.text] ~= nil then
|
||||
return pandoc.Link(elem, man_urls[elem.text])
|
||||
end
|
||||
end
|
29
doc/build-aux/pandoc-filters/myst-reader/roles.lua
Normal file
29
doc/build-aux/pandoc-filters/myst-reader/roles.lua
Normal file
@ -0,0 +1,29 @@
|
||||
--[[
|
||||
Replaces Str AST nodes containing {role}, followed by a Code node
|
||||
by a Code node with attrs that would be produced by rST reader
|
||||
from the role syntax.
|
||||
|
||||
This is to emulate MyST syntax in Pandoc.
|
||||
(MyST is a CommonMark flavour with rST features mixed in.)
|
||||
|
||||
Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
|
||||
]]
|
||||
|
||||
function Inlines(inlines)
|
||||
for i = #inlines-1,1,-1 do
|
||||
local first = inlines[i]
|
||||
local second = inlines[i+1]
|
||||
local correct_tags = first.tag == 'Str' and second.tag == 'Code'
|
||||
if correct_tags then
|
||||
-- docutils supports alphanumeric strings separated by [-._:]
|
||||
-- We are slightly more liberal for simplicity.
|
||||
local role = first.text:match('^{([-._+:%w]+)}$')
|
||||
if role ~= nil then
|
||||
inlines:remove(i)
|
||||
second.attributes['role'] = role
|
||||
second.classes:insert('interpreted-text')
|
||||
end
|
||||
end
|
||||
end
|
||||
return inlines
|
||||
end
|
25
doc/build-aux/pandoc-filters/myst-writer/roles.lua
Normal file
25
doc/build-aux/pandoc-filters/myst-writer/roles.lua
Normal file
@ -0,0 +1,25 @@
|
||||
--[[
|
||||
Replaces Code nodes with attrs that would be produced by rST reader
|
||||
from the role syntax by a Str AST node containing {role}, followed by a Code node.
|
||||
|
||||
This is to emulate MyST syntax in Pandoc.
|
||||
(MyST is a CommonMark flavour with rST features mixed in.)
|
||||
|
||||
Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
|
||||
]]
|
||||
|
||||
function Code(elem)
|
||||
local role = elem.attributes['role']
|
||||
|
||||
if elem.classes:includes('interpreted-text') and role ~= nil then
|
||||
elem.classes = elem.classes:filter(function (c)
|
||||
return c ~= 'interpreted-text'
|
||||
end)
|
||||
elem.attributes['role'] = nil
|
||||
|
||||
return {
|
||||
pandoc.Str('{' .. role .. '}'),
|
||||
elem,
|
||||
}
|
||||
end
|
||||
end
|
@ -52,6 +52,13 @@ Additionally, the following syntax extensions are currently used:
|
||||
|
||||
This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing).
|
||||
|
||||
- []{#ssec-contributing-markup-inline-roles}
|
||||
If you want to link to a man page, you can use `` {manpage}`nix.conf(5)` ``, which will turn into {manpage}`nix.conf(5)`.
|
||||
|
||||
The references will turn into links when a mapping exists in {file}`doc/build-aux/pandoc-filters/unix-man-urls.lua`.
|
||||
|
||||
This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point). Though, the feature originates from [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage) with slightly different syntax.
|
||||
|
||||
- []{#ssec-contributing-markup-admonitions}
|
||||
**Admonitions**, set off from the text to bring attention to something.
|
||||
|
||||
|
88
maintainers/scripts/db-to-md.sh
Executable file
88
maintainers/scripts/db-to-md.sh
Executable file
@ -0,0 +1,88 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -I nixpkgs=. -i bash -p pandoc
|
||||
|
||||
# This script is temporarily needed while we transition the manual to
|
||||
# CommonMark. It converts DocBook files into our CommonMark flavour.
|
||||
|
||||
debug=
|
||||
files=()
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
i="$1"; shift 1
|
||||
case "$i" in
|
||||
--debug)
|
||||
debug=1
|
||||
;;
|
||||
*)
|
||||
files+=("$i")
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo "WARNING: This is an experimental script and might not preserve all formatting." > /dev/stderr
|
||||
echo "Please report any issues you discover." > /dev/stderr
|
||||
|
||||
outExtension="md"
|
||||
if [[ $debug ]]; then
|
||||
outExtension="json"
|
||||
fi
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
# NOTE: Keep in sync with Nixpkgs manual (/doc/Makefile).
|
||||
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
|
||||
pandoc_commonmark_enabled_extensions=+attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
|
||||
targetLang="commonmark${pandoc_commonmark_enabled_extensions}+smart"
|
||||
if [[ $debug ]]; then
|
||||
targetLang=json
|
||||
fi
|
||||
pandoc_flags=(
|
||||
# Not needed:
|
||||
# - diagram-generator.lua (we do not support that in NixOS manual to limit dependencies)
|
||||
# - media extraction (was only required for diagram generator)
|
||||
# - myst-reader/roles.lua (only relevant for MyST → DocBook)
|
||||
# - link-unix-man-references.lua (links should only be added to display output)
|
||||
# - docbook-writer/rst-roles.lua (only relevant for → DocBook)
|
||||
# - docbook-writer/labelless-link-is-xref.lua (only relevant for → DocBook)
|
||||
"--lua-filter=$DIR/../../doc/build-aux/pandoc-filters/docbook-reader/citerefentry-to-rst-role.lua"
|
||||
"--lua-filter=$DIR/../../doc/build-aux/pandoc-filters/myst-writer/roles.lua"
|
||||
"--lua-filter=$DIR/doc/unknown-code-language.lua"
|
||||
-f docbook
|
||||
-t "$targetLang"
|
||||
--tab-stop=2
|
||||
--wrap=none
|
||||
)
|
||||
|
||||
for file in "${files[@]}"; do
|
||||
if [[ ! -f "$file" ]]; then
|
||||
echo "db-to-md.sh: $file does not exist" > /dev/stderr
|
||||
exit 1
|
||||
else
|
||||
rootElement=$(xmllint --xpath 'name(//*)' "$file")
|
||||
|
||||
if [[ $rootElement = chapter ]]; then
|
||||
extension=".chapter.$outExtension"
|
||||
elif [[ $rootElement = section ]]; then
|
||||
extension=".section.$outExtension"
|
||||
else
|
||||
echo "db-to-md.sh: $file contains an unsupported root element $rootElement" > /dev/stderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outFile="${file%".section.xml"}"
|
||||
outFile="${outFile%".chapter.xml"}"
|
||||
outFile="${outFile%".xml"}$extension"
|
||||
temp1=$(mktemp)
|
||||
$DIR/doc/escape-code-markup.py "$file" "$temp1"
|
||||
if [[ $debug ]]; then
|
||||
echo "Converted $file to $temp1" > /dev/stderr
|
||||
fi
|
||||
temp2=$(mktemp)
|
||||
$DIR/doc/replace-xrefs-by-empty-links.py "$temp1" "$temp2"
|
||||
if [[ $debug ]]; then
|
||||
echo "Converted $temp1 to $temp2" > /dev/stderr
|
||||
fi
|
||||
pandoc "$temp2" -o "$outFile" "${pandoc_flags[@]}"
|
||||
echo "Converted $file to $outFile" > /dev/stderr
|
||||
fi
|
||||
done
|
97
maintainers/scripts/doc/escape-code-markup.py
Executable file
97
maintainers/scripts/doc/escape-code-markup.py
Executable file
@ -0,0 +1,97 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -I nixpkgs=channel:nixos-unstable -i python3 -p python3 -p python3.pkgs.lxml
|
||||
|
||||
"""
|
||||
Pandoc will strip any markup within code elements so
|
||||
let’s escape them so that they can be handled manually.
|
||||
"""
|
||||
|
||||
import lxml.etree as ET
|
||||
import re
|
||||
import sys
|
||||
|
||||
def replace_element_by_text(el: ET.Element, text: str) -> None:
|
||||
"""
|
||||
Author: bernulf
|
||||
Source: https://stackoverflow.com/a/10520552/160386
|
||||
SPDX-License-Identifier: CC-BY-SA-3.0
|
||||
"""
|
||||
text = text + (el.tail or "")
|
||||
parent = el.getparent()
|
||||
if parent is not None:
|
||||
previous = el.getprevious()
|
||||
if previous is not None:
|
||||
previous.tail = (previous.tail or "") + text
|
||||
else:
|
||||
parent.text = (parent.text or "") + text
|
||||
parent.remove(el)
|
||||
|
||||
DOCBOOK_NS = "http://docbook.org/ns/docbook"
|
||||
|
||||
# List of elements that pandoc’s DocBook reader strips markup from.
|
||||
# https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Readers/DocBook.hs
|
||||
code_elements = [
|
||||
# CodeBlock
|
||||
"literallayout",
|
||||
"screen",
|
||||
"programlisting",
|
||||
# Code (inline)
|
||||
"classname",
|
||||
"code",
|
||||
"filename",
|
||||
"envar",
|
||||
"literal",
|
||||
"computeroutput",
|
||||
"prompt",
|
||||
"parameter",
|
||||
"option",
|
||||
"markup",
|
||||
"wordasword",
|
||||
"command",
|
||||
"varname",
|
||||
"function",
|
||||
"type",
|
||||
"symbol",
|
||||
"constant",
|
||||
"userinput",
|
||||
"systemitem",
|
||||
]
|
||||
|
||||
XMLNS_REGEX = re.compile(r'\s+xmlns(?::[^=]+)?="[^"]*"')
|
||||
ROOT_ELEMENT_REGEX = re.compile(r'^\s*<[^>]+>')
|
||||
|
||||
def remove_xmlns(match: re.Match) -> str:
|
||||
"""
|
||||
Removes xmlns attributes.
|
||||
|
||||
Expects a match containing an opening tag.
|
||||
"""
|
||||
return XMLNS_REGEX.sub('', match.group(0))
|
||||
|
||||
if __name__ == '__main__':
|
||||
assert len(sys.argv) >= 3, "usage: escape-code-markup.py <input> <output>"
|
||||
|
||||
tree = ET.parse(sys.argv[1])
|
||||
name_predicate = " or ".join([f"local-name()='{el}'" for el in code_elements])
|
||||
|
||||
for markup in tree.xpath(f"//*[({name_predicate}) and namespace-uri()='{DOCBOOK_NS}']/*"):
|
||||
text = ET.tostring(markup, encoding=str)
|
||||
|
||||
# tostring adds xmlns attributes to the element we want to stringify
|
||||
# as if it was supposed to be usable standalone.
|
||||
# We are just converting it to CDATA so we do not care.
|
||||
# Let’s strip the namespace declarations to keep the code clean.
|
||||
#
|
||||
# Note that this removes even namespaces that were potentially
|
||||
# in the original file. Though, that should be very rare –
|
||||
# most of the time, we will stringify empty DocBook elements
|
||||
# like <xref> or <co> or, at worst, <link> with xlink:href attribute.
|
||||
#
|
||||
# Also note that the regex expects the root element to be first
|
||||
# thing in the string. But that should be fine, the tostring method
|
||||
# does not produce XML declaration or doctype by default.
|
||||
text = ROOT_ELEMENT_REGEX.sub(remove_xmlns, text)
|
||||
|
||||
replace_element_by_text(markup, text)
|
||||
|
||||
tree.write(sys.argv[2])
|
32
maintainers/scripts/doc/replace-xrefs-by-empty-links.py
Executable file
32
maintainers/scripts/doc/replace-xrefs-by-empty-links.py
Executable file
@ -0,0 +1,32 @@
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -I nixpkgs=channel:nixos-unstable -i python3 -p python3 -p python3.pkgs.lxml
|
||||
|
||||
"""
|
||||
Pandoc will try to resolve xrefs and replace them with regular links.
|
||||
let’s replace them with links with empty labels which MyST
|
||||
and our pandoc filters recognize as cross-references.
|
||||
"""
|
||||
|
||||
import lxml.etree as ET
|
||||
import sys
|
||||
|
||||
XLINK_NS = "http://www.w3.org/1999/xlink"
|
||||
|
||||
ns = {
|
||||
"db": "http://docbook.org/ns/docbook",
|
||||
}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
assert len(sys.argv) >= 3, "usage: replace-xrefs-by-empty-links.py <input> <output>"
|
||||
|
||||
tree = ET.parse(sys.argv[1])
|
||||
for xref in tree.findall(".//db:xref", ns):
|
||||
text = ET.tostring(xref, encoding=str)
|
||||
parent = xref.getparent()
|
||||
link = parent.makeelement('link')
|
||||
target_name = xref.get("linkend")
|
||||
link.set(f"{{{XLINK_NS}}}href", f"#{target_name}")
|
||||
parent.replace(xref, link)
|
||||
|
||||
tree.write(sys.argv[2])
|
12
maintainers/scripts/doc/unknown-code-language.lua
Normal file
12
maintainers/scripts/doc/unknown-code-language.lua
Normal file
@ -0,0 +1,12 @@
|
||||
--[[
|
||||
Adds “unknown” class to CodeBlock AST nodes without any classes.
|
||||
|
||||
This will cause Pandoc to use fenced code block, which we prefer.
|
||||
]]
|
||||
|
||||
function CodeBlock(elem)
|
||||
if #elem.classes == 0 then
|
||||
elem.classes:insert('unknown')
|
||||
return elem
|
||||
end
|
||||
end
|
@ -12,8 +12,14 @@ pushd $DIR
|
||||
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
|
||||
pandoc_commonmark_enabled_extensions=+attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
|
||||
pandoc_flags=(
|
||||
# media extraction and diagram-generator.lua not needed
|
||||
"--lua-filter=$DIR/../../../doc/labelless-link-is-xref.lua"
|
||||
# Not needed:
|
||||
# - diagram-generator.lua (we do not support that in NixOS manual to limit dependencies)
|
||||
# - media extraction (was only required for diagram generator)
|
||||
# - docbook-reader/citerefentry-to-rst-role.lua (only relevant for DocBook → MarkDown/rST/MyST)
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/link-unix-man-references.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua"
|
||||
"--lua-filter=$DIR/../../../doc/build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua"
|
||||
-f "commonmark${pandoc_commonmark_enabled_extensions}+smart"
|
||||
-t docbook
|
||||
)
|
||||
|
@ -9,6 +9,8 @@
|
||||
, enableAvx2 ? stdenv.hostPlatform.avx2Support
|
||||
, enableAvx512 ? stdenv.hostPlatform.avx512Support
|
||||
, enableFma ? stdenv.hostPlatform.fmaSupport
|
||||
, enableMpi ? false
|
||||
, mpi
|
||||
}:
|
||||
|
||||
with lib;
|
||||
@ -38,10 +40,10 @@ stdenv.mkDerivation {
|
||||
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
|
||||
buildInputs = lib.optionals stdenv.cc.isClang [
|
||||
buildInputs = optionals stdenv.cc.isClang [
|
||||
# TODO: This may mismatch the LLVM version sin the stdenv, see #79818.
|
||||
llvmPackages.openmp
|
||||
];
|
||||
] ++ optional enableMpi mpi;
|
||||
|
||||
configureFlags =
|
||||
[ "--enable-shared"
|
||||
@ -56,6 +58,7 @@ stdenv.mkDerivation {
|
||||
++ optional enableAvx512 "--enable-avx512"
|
||||
++ optional enableFma "--enable-fma"
|
||||
++ [ "--enable-openmp" ]
|
||||
++ optional enableMpi "--enable-mpi"
|
||||
# doc generation causes Fortran wrapper generation which hard-codes gcc
|
||||
++ optional (!withDoc) "--disable-doc";
|
||||
|
||||
|
@ -2,13 +2,21 @@ import ./generic.nix {
|
||||
majorVersion = "7.1";
|
||||
minorVersion = "1";
|
||||
sourceSha256 = "0nm7xwwj7rnsxjdv2ssviys8nhci4n9iiiqm2y14s520hl2dsp1d";
|
||||
patchesToFetch = [{
|
||||
url = "https://gitlab.kitware.com/vtk/vtk/-/commit/706f1b397df09a27ab8981ab9464547028d0c322.diff";
|
||||
sha256 = "1q3pi5h40g05pzpbqp75xlgzvbfvyw8raza51svmi7d8dlslqybx";
|
||||
}
|
||||
{
|
||||
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/vtk/files/vtk-8.2.0-gcc-10.patch?id=c4256f68d3589570443075eccbbafacf661f785f";
|
||||
sha256 = "sha256:0bpwrdfmi15grsg4jy7bzj2z6511a0c160cmw5lsi65aabyh7cl5";
|
||||
}
|
||||
patchesToFetch = [
|
||||
{
|
||||
url = "https://gitlab.kitware.com/vtk/vtk/-/commit/706f1b397df09a27ab8981ab9464547028d0c322.diff";
|
||||
sha256 = "1q3pi5h40g05pzpbqp75xlgzvbfvyw8raza51svmi7d8dlslqybx";
|
||||
}
|
||||
|
||||
{
|
||||
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/vtk/files/vtk-8.2.0-gcc-10.patch?id=c4256f68d3589570443075eccbbafacf661f785f";
|
||||
sha256 = "sha256:0bpwrdfmi15grsg4jy7bzj2z6511a0c160cmw5lsi65aabyh7cl5";
|
||||
}
|
||||
|
||||
# Add missing include required with recent Qt.
|
||||
{
|
||||
url = "https://gitlab.kitware.com/vtk/vtk/-/commit/797f28697d5ba50c1fa2bc5596af626a3c277826.diff";
|
||||
sha256 = "BFjoKws1hVD3Ly9RS4lGN62J6RTyI1E8ATHrZdzg7ds=";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -67,14 +67,17 @@ in stdenv.mkDerivation rec {
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_C_FLAGS=-fPIC"
|
||||
"-DCMAKE_CXX_FLAGS=-fPIC"
|
||||
"-DVTK_USE_SYSTEM_PNG=ON"
|
||||
"-DVTK_USE_SYSTEM_TIFF=1"
|
||||
"-D${if lib.versionOlder version "9.0" then "VTK_USE_SYSTEM_PNG" else "VTK_MODULE_USE_EXTERNAL_vtkpng"}=ON"
|
||||
"-D${if lib.versionOlder version "9.0" then "VTK_USE_SYSTEM_TIFF" else "VTK_MODULE_USE_EXTERNAL_vtktiff"}=1"
|
||||
"-DOPENGL_INCLUDE_DIR=${libGL}/include"
|
||||
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
] ++ optionals enableQt [
|
||||
"-D${if lib.versionOlder version "9.0" then "VTK_Group_Qt:BOOL=ON" else "VTK_GROUP_ENABLE_Qt:STRING=YES"}"
|
||||
] ++ optionals (enableQt && lib.versionOlder version "8.0") [
|
||||
"-DVTK_QT_VERSION=5"
|
||||
]
|
||||
++ optionals enableQt [ "-DVTK_Group_Qt:BOOL=ON" ]
|
||||
++ optionals stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ]
|
||||
++ optionals enablePython [
|
||||
"-DVTK_WRAP_PYTHON:BOOL=ON"
|
||||
|
@ -7,14 +7,14 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "ailment";
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "angr";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-dWHioxNpNuvUTC8FkkKTsoRs4x+eHUfDb4rpgeIGaIA=";
|
||||
sha256 = "sha256-c+E3ypmN69IyE0HagefrYN8bdCY7amRxa/PGoIX4/cQ=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ pyvex ];
|
||||
|
@ -43,14 +43,14 @@ in
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "angr";
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-37WCiH0uYRRh8yxNwz9OW0LcyNS9Kr2l1J662JYaPhg=";
|
||||
sha256 = "sha256-zDy3dwhCNBtCAwflF/grdNsRllNUHJHMx1PQThHjcnw=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -9,14 +9,14 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "angrop";
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "angr";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-rl7ZELiLAVuCOkR6NVCUB5c6AtW/rFniDxB3E9ZPnK8=";
|
||||
sha256 = "sha256-rXhXzqjefsKvfsFky4XJd+RaF5z/TRWDg6+IYFIfP2w=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -7,13 +7,13 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "archinfo";
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "angr";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-uRwNvYrea3oexJ3Rcoa9oUMXa+gSnha2K0NM8e/A09k=";
|
||||
sha256 = "sha256-st4h/ck7hxIx2cZ241C4hEFJvFsTqHmawAB4zsfQ/oU=";
|
||||
};
|
||||
|
||||
checkInputs = [
|
||||
|
@ -13,14 +13,14 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "claripy";
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "angr";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-tGRnCsuOLqZmWBcITF0TzgQ7kW6e7wZyhtObyU5Pasw=";
|
||||
sha256 = "sha256-9jwD75leV02N5B7RaLF2DbC6GjhoDQMmkfFIO9MJ4Es=";
|
||||
};
|
||||
|
||||
# Use upstream z3 implementation
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
let
|
||||
# The binaries are following the argr projects release cycle
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
|
||||
# Binary files from https://github.com/angr/binaries (only used for testing and only here)
|
||||
binaries = fetchFromGitHub {
|
||||
@ -35,7 +35,7 @@ buildPythonPackage rec {
|
||||
owner = "angr";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-yza6Q0kxDXHOXxZcDFt43I621dSGI+bzTUrxWAQkGFQ=";
|
||||
sha256 = "sha256-lCRZj0/L/XNcnJNiLxPY2mCFZowV6hLEpHOEiCsyQ/0=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -11,11 +11,11 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyvex";
|
||||
version = "9.0.9684";
|
||||
version = "9.0.9792";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-pf+LUFatC16a8EScoNYZKCXiaCINPRRn+6R1Op4GMRE=";
|
||||
sha256 = "sha256-8AF7dCvQvBDjITRwi40KqMXcgiJpmKcK16ys1ybFIyk=";
|
||||
};
|
||||
|
||||
postPatch = lib.optionalString stdenv.isDarwin ''
|
||||
|
@ -2,20 +2,22 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ccloud-cli";
|
||||
version = "1.25.0";
|
||||
version = "1.39.0";
|
||||
|
||||
# To get the latest version:
|
||||
# curl -L https://cnfl.io/ccloud-cli | sh -s -- -l | grep -v latest | sort -V | tail -n1
|
||||
src = fetchurl (if stdenv.hostPlatform.isDarwin then {
|
||||
url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/archives/${version}/ccloud_v${version}_darwin_amd64.tar.gz";
|
||||
sha256 = "0306jg36dpccwyy239r2xvw3bvsrnrdc88390g26fhcb0048qmgb";
|
||||
sha256 = "0jqpmnx3izl4gv02zpx03z6ayi3cb5if4rnyl1374yaclx44k1gd";
|
||||
} else {
|
||||
url = "https://s3-us-west-2.amazonaws.com/confluent.cloud/ccloud-cli/archives/${version}/ccloud_v${version}_linux_amd64.tar.gz";
|
||||
sha256 = "02sly7cxqlrfd6chamlp05k9ar93mpfrkx5183js0hf595nlki61";
|
||||
sha256 = "0936hipcl37w4mzzsnjlz4q1z4j9094i4irigzqwg14gdbs7p11s";
|
||||
});
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
|
||||
dontStrip = stdenv.isDarwin;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{bin,share/doc/ccloud-cli}
|
||||
cp ccloud $out/bin/
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,6 +9,11 @@
|
||||
# linted:
|
||||
# $ nix run nixpkgs.python3Packages.flake8 -c flake8 --ignore E501,E265,E402 update.py
|
||||
|
||||
# If you see `HTTP Error 429: too many requests` errors while running this script,
|
||||
# refer to:
|
||||
#
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/vim.section.md#updating-plugins-in-nixpkgs-updating-plugins-in-nixpkgs
|
||||
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
|
@ -244,6 +244,7 @@ inkarkat/vim-ReplaceWithSameIndentRegister
|
||||
inkarkat/vim-SyntaxRange
|
||||
int3/vim-extradite
|
||||
Iron-E/nvim-highlite
|
||||
ishan9299/nvim-solarized-lua
|
||||
itchyny/calendar.vim
|
||||
itchyny/lightline.vim
|
||||
itchyny/thumbnail.vim
|
||||
|
@ -1,32 +1,32 @@
|
||||
{
|
||||
"4.14": {
|
||||
"extra": "-hardened1",
|
||||
"name": "linux-hardened-4.14.245-hardened1.patch",
|
||||
"sha256": "035sq0l15afhyfivkavd08pyaywsrcl6f468gykmbq9j3i2swbb6",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/4.14.245-hardened1/linux-hardened-4.14.245-hardened1.patch"
|
||||
"name": "linux-hardened-4.14.246-hardened1.patch",
|
||||
"sha256": "1b15687ac2pkz46qliq1blyja7cjwn19q2bkd0c5912kzly76ghd",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/4.14.246-hardened1/linux-hardened-4.14.246-hardened1.patch"
|
||||
},
|
||||
"4.19": {
|
||||
"extra": "-hardened1",
|
||||
"name": "linux-hardened-4.19.205-hardened1.patch",
|
||||
"sha256": "14v3kwkkhyng0wfz4spca6z7wvsxj4kplj144qv1k3fm9yy2cy3h",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.205-hardened1/linux-hardened-4.19.205-hardened1.patch"
|
||||
"name": "linux-hardened-4.19.206-hardened1.patch",
|
||||
"sha256": "12ylhvjvabal29gi00cpjh3s47qj0vav6f2y145z4c9r2z77816k",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/4.19.206-hardened1/linux-hardened-4.19.206-hardened1.patch"
|
||||
},
|
||||
"5.10": {
|
||||
"extra": "-hardened1",
|
||||
"name": "linux-hardened-5.10.61-hardened1.patch",
|
||||
"sha256": "0hg67w9s6nzfmar8y01cnc46b2m2sa6s1xz85x1z1c46vw9558f0",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.61-hardened1/linux-hardened-5.10.61-hardened1.patch"
|
||||
"name": "linux-hardened-5.10.62-hardened1.patch",
|
||||
"sha256": "0xdj9mp0ccilj06pb8my5jqw47xwc2fk7f2ck36g4bzsp669nisj",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/5.10.62-hardened1/linux-hardened-5.10.62-hardened1.patch"
|
||||
},
|
||||
"5.13": {
|
||||
"extra": "-hardened1",
|
||||
"name": "linux-hardened-5.13.13-hardened1.patch",
|
||||
"sha256": "1rb4jpz8zbpijybpm7dwxr05f9nmf6b9av2b651ffxg5vziw17l3",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/5.13.13-hardened1/linux-hardened-5.13.13-hardened1.patch"
|
||||
"name": "linux-hardened-5.13.14-hardened1.patch",
|
||||
"sha256": "00lmqq10d66s1852q1j2m8cj90bb0gfpsg617bc7f3pm2v6iyl93",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/5.13.14-hardened1/linux-hardened-5.13.14-hardened1.patch"
|
||||
},
|
||||
"5.4": {
|
||||
"extra": "-hardened1",
|
||||
"name": "linux-hardened-5.4.143-hardened1.patch",
|
||||
"sha256": "0xv29cclypywq52908zppxpjrxllcdb67chw7lcia60y1aqsg83z",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.143-hardened1/linux-hardened-5.4.143-hardened1.patch"
|
||||
"name": "linux-hardened-5.4.144-hardened1.patch",
|
||||
"sha256": "1vm19d5cwxw3l2s4h7sbzrhk60m24nhbjdlpqd1bkbm8x8zcp9f3",
|
||||
"url": "https://github.com/anthraxx/linux-hardened/releases/download/5.4.144-hardened1/linux-hardened-5.4.144-hardened1.patch"
|
||||
}
|
||||
}
|
||||
|
@ -112,6 +112,19 @@ let
|
||||
(self: super: {
|
||||
home-assistant-frontend = self.callPackage ./frontend.nix { };
|
||||
})
|
||||
|
||||
# Pinned due to incompability with aioesphomeapi 8.0.0
|
||||
(self: super: {
|
||||
aioesphomeapi = super.aioesphomeapi.overrideAttrs (oldAttrs: rec {
|
||||
version = "7.0.0";
|
||||
src = fetchFromGitHub {
|
||||
owner = "esphome";
|
||||
repo = oldAttrs.pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ho/1fpq4yAgmYNERPqs51oqr08ncaN9+GRTUUuGU7ps=";
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
mkOverride = attrname: version: sha256:
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "vouch-proxy";
|
||||
version = "0.32.0";
|
||||
version = "0.34.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "vouch";
|
||||
repo = "vouch-proxy";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-thA3hsGNDifUc0XFsOB8cjJTrz4NY+NtK05a20AFzJ8=";
|
||||
sha256 = "sha256-xkCnBRGSryFf90dOeoZKQhugX66zkF/gYF1v6N9yjTQ=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-ifH+420FIrib+zQtzzHtMMYd84BED+vgnRw4xToYIl4=";
|
||||
|
50
pkgs/tools/backup/mylvmbackup/default.nix
Normal file
50
pkgs/tools/backup/mylvmbackup/default.nix
Normal file
@ -0,0 +1,50 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, perlPackages
|
||||
, makeWrapper
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "mylvmbackup";
|
||||
version = "0.16";
|
||||
|
||||
src = fetchurl {
|
||||
url = "${meta.homepage}/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-vb7M3EPIrxIz6jUwm241fzaEz2czqdCObrFgSOSgJRU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
buildInputs = [ perlPackages.perl ];
|
||||
|
||||
dontConfigure = true;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs mylvmbackup
|
||||
substituteInPlace Makefile \
|
||||
--replace "prefix = /usr/local" "prefix = ${builtins.placeholder "out"}" \
|
||||
--replace "sysconfdir = /etc" "sysconfdir = ${builtins.placeholder "out"}/etc" \
|
||||
--replace "/usr/bin/install" "install"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/mylvmbackup" \
|
||||
--prefix PERL5LIB : "${perlPackages.makePerlPath (
|
||||
with perlPackages; [
|
||||
ConfigIniFiles
|
||||
DBDmysql
|
||||
DBI
|
||||
TimeDate
|
||||
FileCopyRecursive
|
||||
]
|
||||
)}"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.lenzg.net/mylvmbackup/";
|
||||
description = "a tool for quickly creating full physical backups of a MySQL server's data files";
|
||||
license = lib.licenses.gpl2Only;
|
||||
maintainers = with lib.maintainers; [ ryantm ];
|
||||
platforms = with lib.platforms; linux;
|
||||
};
|
||||
}
|
@ -7338,6 +7338,8 @@ with pkgs;
|
||||
|
||||
mydumper = callPackage ../tools/backup/mydumper { };
|
||||
|
||||
mylvmbackup = callPackage ../tools/backup/mylvmbackup { };
|
||||
|
||||
mysql2pgsql = callPackage ../tools/misc/mysql2pgsql { };
|
||||
|
||||
mysqltuner = callPackage ../tools/misc/mysqltuner { };
|
||||
|
Loading…
Reference in New Issue
Block a user