-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docbook: refactor rng and XML dtd versions
- Loading branch information
Showing
12 changed files
with
233 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
version, | ||
url ? null, | ||
hash, | ||
preInstall ? "", | ||
}: | ||
|
||
{ | ||
lib, | ||
stdenvNoCC, | ||
fetchurl, | ||
unzip, | ||
libxml2, | ||
}: | ||
|
||
stdenvNoCC.mkDerivation (finalAttrs: { | ||
pname = "docbook"; | ||
inherit version; | ||
|
||
src = fetchurl { | ||
url = if isNull url then "https://docbook.org/xml/${version}/docbook-xml-${version}.zip" else url; | ||
inherit hash; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
unzip | ||
libxml2 | ||
]; | ||
|
||
sourceRoot = "."; | ||
|
||
inherit preInstall; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
dst=$out/xml/dtd/docbook | ||
mkdir -p $dst | ||
cp -prv * $dst/ | ||
substituteInPlace $dst/catalog.xml --replace 'uri="' "uri=\"$dst/" | ||
runHook postInstall | ||
''; | ||
|
||
meta = { | ||
description = "General purpose XML and SGML document type"; | ||
longDescription = '' | ||
DocBook is general purpose XML and SGML document type particularly well | ||
suited to books and papers about computer hardware and software (though it | ||
is by no means limited to these applications). | ||
The OASIS DocBook Technical Committee maintains the DocBook schema. | ||
DocBook is officially available as a Document Type Definition (DTD) for | ||
both XML and SGML. It is unofficially available in other forms as well. | ||
''; | ||
homepage = "https://docbook.org/"; | ||
license = "DocBook-Schema"; | ||
maintainers = with lib.maintainers; [ rc-zb ]; | ||
platforms = lib.platforms.all; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
version, | ||
url ? null, | ||
hash, | ||
installPhase, | ||
}: | ||
|
||
{ | ||
lib, | ||
stdenvNoCC, | ||
fetchurl, | ||
unzip, | ||
}: | ||
|
||
stdenvNoCC.mkDerivation (finalAttrs: { | ||
pname = "docbook"; | ||
inherit version; | ||
|
||
src = fetchurl { | ||
url = | ||
if isNull url then | ||
"https://docs.oasis-open.org/docbook/docbook/v${version}/os/docbook-v${version}-os.zip" | ||
else | ||
url; | ||
inherit hash; | ||
}; | ||
|
||
nativeBuildInputs = [ unzip ]; | ||
|
||
sourceRoot = "."; | ||
|
||
inherit installPhase; | ||
|
||
meta = { | ||
description = "General purpose XML schema"; | ||
longDescription = '' | ||
DocBook is general purpose XML schema particularly well suited to books and | ||
papers about computer hardware and software (though it is by no means | ||
limited to these applications). | ||
The OASIS DocBook Technical Committee maintains the DocBook schema. | ||
Starting with V5.0, DocBook is normatively available as a RELAX NG Schema | ||
(with some additional Schematron assertions). | ||
''; | ||
homepage = "https://docbook.org/"; | ||
license = "DocBook-Schema"; | ||
maintainers = with lib.maintainers; [ rc-zb ]; | ||
platforms = lib.platforms.all; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
callPackage, | ||
releaseVersion ? "5.2", | ||
}: | ||
|
||
(callPackage ./versions.nix { }).${releaseVersion} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
callPackage, | ||
fetchurl, | ||
libxml2, | ||
}: | ||
let | ||
makeDocBookVersions = | ||
era: builtins.mapAttrs (name: spec: callPackage (import (./. + "/generic-${era}.nix") spec) { }); | ||
in | ||
(makeDocBookVersions "xml-rng" { | ||
"5.2" = { | ||
version = "5.2"; | ||
hash = "sha256-grMb+6HEo18TiZWr1Ofko9yf4XIX3vlSeXm/QsFpiWI="; | ||
installPhase = '' | ||
runHook preInstall | ||
dst=$out/share/xml/docbook-5.2 | ||
mkdir -p $dst | ||
cp -prv * $dst/ | ||
substituteInPlace $dst/catalog.xml --replace 'uri="' "uri=\"$dst/" | ||
rm -rf $dst/*.{docx,html,pdf} $dst/release-notes | ||
runHook postInstall | ||
''; | ||
}; | ||
"5.1" = { | ||
version = "5.1"; | ||
hash = "sha256-s/NBNlQAPB53M2DX/GDruKvQ6Mmvjn1sS1XxJPNNHn8="; | ||
installPhase = '' | ||
runHook preInstall | ||
dst=$out/share/xml/docbook-5.1 | ||
mkdir -p $dst | ||
cp -prv schemas/* $dst/ | ||
substituteInPlace $dst/catalog.xml --replace 'uri="' "uri=\"$dst/" | ||
runHook postInstall | ||
''; | ||
}; | ||
"5.0" = rec { | ||
version = "5.0.1"; | ||
url = "https://docbook.org/xml/${version}/docbook-${version}.zip"; | ||
hash = "sha256-evnfRSQQ4DWjcHiD5DA5tAYvCdwvSfLphto+TAOG48c="; | ||
installPhase = '' | ||
runHook preInstall | ||
dst=$out/share/xml/docbook-5.0 | ||
mkdir -p $dst | ||
# The dir must be specified manually, because sourceRoot is set to ".". | ||
cp -prv docbook-${version}/* $dst/ | ||
substituteInPlace $dst/catalog.xml --replace 'uri="' "uri=\"$dst/" | ||
rm -rf $dst/docs $dst/ChangeLog | ||
# Backwards compatibility. Will remove eventually. | ||
mkdir -p $out/xml/rng $out/xml/dtd | ||
ln -s $dst/rng $out/xml/rng/docbook | ||
ln -s $dst/dtd $out/xml/dtd/docbook | ||
runHook postInstall | ||
''; | ||
}; | ||
}) | ||
// (makeDocBookVersions "xml-dtd" { | ||
"4.5" = { | ||
version = "4.5"; | ||
hash = "sha256-Tk4DeiuDyYxslIGDkNS90/bhD27GLdeRiFlOJhkNx7Q="; | ||
}; | ||
"4.4" = { | ||
version = "4.4"; | ||
hash = "sha256-AvFZ64jEJU2V6DHFHBRLGGOyFtkJtf9FdDoc5vUnMJA="; | ||
}; | ||
"4.3" = { | ||
version = "4.3"; | ||
hash = "sha256-IwaKlOpv1ISwBMWnPsNqZqpH6o8Na2LMFpWTH1wUNGQ="; | ||
}; | ||
"4.2" = { | ||
version = "4.2"; | ||
hash = "sha256-rMRgHk+XoZYHa35ks2jZJIsHx6vyazSgLMpA7uvmD6I="; | ||
}; | ||
"4.1.2" = { | ||
version = "4.1.2"; | ||
url = "https://docbook.org/xml/4.1.2/docbkx412.zip"; | ||
hash = "sha256-MPBkQGTg6nF1FDglGUCxQx9GrK2oFKBihw9IbHcud3I="; | ||
preInstall = | ||
let | ||
docbook42catalog = fetchurl { | ||
url = "https://docbook.org/xml/4.2/catalog.xml"; | ||
sha256 = "sha256-J0g0JhEzZpuYlm0qU+lKmLc1oUbD5FKQHuUAKrC5kKI="; | ||
}; | ||
in | ||
'' | ||
sed 's|V4.2|V4.1.2|g' < ${docbook42catalog} > catalog.xml | ||
''; | ||
}; | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters