1 | From: <Saved by WebKit>
|
---|
2 | Subject:
|
---|
3 | Date: Mon, 23 Oct 2022 19:42:56 +0200
|
---|
4 | MIME-Version: 1.0
|
---|
5 | Content-Type: multipart/related;
|
---|
6 | type="text/html";
|
---|
7 | boundary="----=_NextPart_000_5219_3F9F082D.D6A94958"
|
---|
8 |
|
---|
9 | ------=_NextPart_000_5219_3F9F082D.D6A94958
|
---|
10 | Content-Type: text/html
|
---|
11 | Content-Transfer-Encoding: quoted-printable
|
---|
12 | Content-Location: https://gist.githubusercontent.com/jmairboeck/ceb5e9d51a7716c07b4e22936d56e087/raw/abd0c3e262970bfdbb323a119e8d72949bce8558/createSubpackageInfos_provides.pl
|
---|
13 |
|
---|
14 | <html><head><meta charset=3D"UTF-8"></head><body><pre style=3D"word-wrap: b=
|
---|
15 | reak-word; white-space: pre-wrap;">#!/bin/perl
|
---|
16 | # Copyright 2021, Joachim Mairb=C3=B6ck <j.mairboeck@gmail.com>
|
---|
17 | # Distributed under the terms of the MIT license.
|
---|
18 |
|
---|
19 | # Helper script to generate the package metadata definitions for the texliv=
|
---|
20 | e subpackages
|
---|
21 | # usage:
|
---|
22 | # perl -I $sourceDir/tlpkg createSubpackageInfos.pl <tlpdbroot> >=
|
---|
23 | subpackageInfos.recipe
|
---|
24 | #
|
---|
25 | # <tlpdbroot> is the root of the TeXLive package database, containing=
|
---|
26 | tlpkg/texlive.tlpdb.
|
---|
27 | # It also needs the texmf-dist directory to work.
|
---|
28 | # After these have been symlinked to $sourceDir (by the BUILD function in =
|
---|
29 | the recipe),
|
---|
30 | # $sourceDir can be used inside the haikuporter chroot.
|
---|
31 | # Alternatively, after the installation of the texlive package,
|
---|
32 | # /boot/system/data/texlive can be used.
|
---|
33 | #
|
---|
34 | # This script uses the TeXLive perl modules, therefore it needs $sourceDir/=
|
---|
35 | tlpkg in @INC.
|
---|
36 |
|
---|
37 | use strict;
|
---|
38 | use warnings;
|
---|
39 |
|
---|
40 | use TeXLive::TLPDB;
|
---|
41 |
|
---|
42 | print "# This file has been generated by createSubpackageInfos.pl\n\n";
|
---|
43 |
|
---|
44 | my $tlpdb =3D TeXLive::TLPDB->new(root =3D> $ARGV[0]);
|
---|
45 | my @collections =3D $tlpdb->collections();
|
---|
46 |
|
---|
47 | for my $collectionPkgName (@collections) {
|
---|
48 | my $collection =3D substr $collectionPkgName, 11;
|
---|
49 | my $collectionPkg =3D $tlpdb->get_package($collectionPkgName);
|
---|
50 | my $shortdesc =3D $collectionPkg->shortdesc();
|
---|
51 | my $longdesc =3D $collectionPkg->longdesc();
|
---|
52 | if (length $shortdesc >=3D 44) { # SUMMARY must not exceed 80 character=
|
---|
53 | s in total
|
---|
54 | $shortdesc =3D substr($shortdesc, 0, 42) . "=E2=80=A6";
|
---|
55 | }
|
---|
56 | if ($shortdesc =3D~ /\.$/) { # SUMMARY must not end in a '.'
|
---|
57 | $shortdesc =3D substr($shortdesc, 0, -1);
|
---|
58 | }
|
---|
59 | $shortdesc =3D~ s'`'\`'g; # escape '`' characters
|
---|
60 | $longdesc =3D~ s'`'\`'g if $longdesc;
|
---|
61 | my @depends =3D $collectionPkg->depends();
|
---|
62 | my @runfiles;
|
---|
63 | my @docfiles;
|
---|
64 | my @srcfiles;
|
---|
65 | for my $depName (@depends) {
|
---|
66 | my $depPkg =3D $tlpdb->get_package($depName);
|
---|
67 | push @runfiles, $depPkg->runfiles();
|
---|
68 | push @docfiles, $depPkg->docfiles();
|
---|
69 | push @srcfiles, $depPkg->srcfiles();
|
---|
70 | }
|
---|
71 | if (@runfiles) {
|
---|
72 | print "SUMMARY_$collection=3D\"TeXLive Collection: $shortdesc\"\n";
|
---|
73 | print "DESCRIPTION_$collection=3D\"$longdesc\"\n" if $longdesc;
|
---|
74 | print "PROVIDES_$collection=3D\"\n";
|
---|
75 | print "\ttexlive_texmf_$collection =3D \$portVersion\n";
|
---|
76 | for my $dep (@depends) {
|
---|
77 | if ($dep !~ /^collection-/) {
|
---|
78 | my $version =3D $tlpdb->get_package($dep)->cataloguedata()->{'=
|
---|
79 | version'};
|
---|
80 | $dep =3D~ s/-/_/g;
|
---|
81 | print "\ttex:", $dep;
|
---|
82 | # ignore version for now, they would need some transformation to be usa=
|
---|
83 | ble
|
---|
84 | # print " =3D $version" if $version;
|
---|
85 | print "\n";
|
---|
86 | }
|
---|
87 | }
|
---|
88 | print "\t\"\n";
|
---|
89 | print "REQUIRES_$collection=3D\"\n";
|
---|
90 | print "\thaiku\n";
|
---|
91 | print "\ttexlive_texmf =3D=3D \$portVersion base\n";
|
---|
92 | for my $dep (@depends) {
|
---|
93 | print "\ttexlive_texmf_", substr($dep, 11), "\n" if $dep =3D~ /^collecti=
|
---|
94 | on-/;
|
---|
95 | }
|
---|
96 | print "\t\"\n";
|
---|
97 | print "REQUIRES_full+=3D\"\n";
|
---|
98 | print "\ttexlive_texmf_$collection\n";
|
---|
99 | print "\t\"\n";
|
---|
100 | print "POST_INSTALL_SCRIPTS_$collection=3D\"\$relativePostInstallDir/texl=
|
---|
101 | ive_postinstall.sh\"\n";
|
---|
102 | print "subpackages+=3D($collection)\n";
|
---|
103 | }
|
---|
104 | if (@docfiles) {
|
---|
105 | print "SUMMARY_${collection}_doc=3D\"TeXLive Collection: $shortdesc (docu=
|
---|
106 | mentation)\"\n";
|
---|
107 | print "DESCRIPTION_${collection}_doc=3D\"$longdesc\"\n" if $longdesc;
|
---|
108 | print "PROVIDES_${collection}_doc=3D\"\n";
|
---|
109 | print "\ttexlive_texmf_${collection}_doc =3D \$portVersion\n";
|
---|
110 | print "\t\"\n";
|
---|
111 | print "REQUIRES_${collection}_doc=3D\"\n";
|
---|
112 | print "\thaiku\n";
|
---|
113 | print "\ttexlive_texmf =3D=3D \$portVersion base\n";
|
---|
114 | print "\t\"\n";
|
---|
115 | print "REQUIRES_full_doc+=3D\"\n";
|
---|
116 | print "\ttexlive_texmf_${collection}_doc\n";
|
---|
117 | print "\t\"\n";
|
---|
118 | print "subpackages+=3D(${collection}_doc)\n";
|
---|
119 | }
|
---|
120 | if (@srcfiles) {
|
---|
121 | print "SUMMARY_${collection}_source=3D\"TeXLive Collection: $shortdesc (s=
|
---|
122 | ource files)\"\n";
|
---|
123 | print "DESCRIPTION_${collection}_source=3D\"$longdesc\"\n" if $longdesc;
|
---|
124 | print "PROVIDES_${collection}_source=3D\"\n";
|
---|
125 | print "\ttexlive_texmf_${collection}_source =3D \$portVersion\n";
|
---|
126 | print "\t\"\n";
|
---|
127 | print "REQUIRES_${collection}_source=3D\"\n";
|
---|
128 | print "\thaiku\n";
|
---|
129 | print "\ttexlive_texmf =3D=3D \$portVersion base\n";
|
---|
130 | print "\t\"\n";
|
---|
131 | print "REQUIRES_full_source+=3D\"\n";
|
---|
132 | print "\ttexlive_texmf_${collection}_source\n";
|
---|
133 | print "\t\"\n";
|
---|
134 | print "subpackages+=3D(${collection}_source)\n";
|
---|
135 | }
|
---|
136 | }
|
---|
137 |
|
---|
138 | </pre></body></html>
|
---|
139 | ------=_NextPart_000_5219_3F9F082D.D6A94958--
|
---|