Nimbin[12]?Mirrors & Forks / jhalfs / commits / 0cd09c6

jhalfs git · trunk

jhalfs LFS build automation (mirror)

lfs mirror bash · first commit 2005-09-11 · last commit 2024-02-13 (2 years ago) · synced 3 days ago · upstream: git.linuxfromscratch.org/jhalfs

Python 78.4% Shell 19.8% Makefile 1.8%
git clone https://git.christianimmanuel.de/mirrors-forks/jhalfs.gitwget https://git.christianimmanuel.de/mirrors-forks/jhalfs/archive/jhalfs.tar.gz

Add automation for kf5 and plasma5

Pierre Labastie · 2023-09-19 20:11 · 0cd09c69545e2bae0bea15333bc97f0a2ec452d6

 BLFS/gen-special.sh       | 50 ++++++++++++++++++++------------
 BLFS/xsl/gen_config.xsl   |  4 ++-
 BLFS/xsl/gen_pkg_list.xsl |  4 ++-
 BLFS/xsl/make_book.xsl    | 73 +++++++++++++++++++++++++++++++----------------
 4 files changed, 85 insertions(+), 46 deletions(-)

diff --git a/BLFS/gen-special.sh b/BLFS/gen-special.sh
index 4dcd904..cc8033e 100755
--- a/BLFS/gen-special.sh
+++ b/BLFS/gen-special.sh
@@ -98,7 +98,9 @@ cat >tmpfile << EOF
     <xsl:param name="build"/>
     <xsl:choose>
 EOF
-for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver); do
+for file in $(ls ${BLFS_DIR}/x/installing/x7* | grep -v x7driver) \
+	    ${BLFS_DIR}/kde/kf5/kf5-frameworks.xml                \
+	    ${BLFS_DIR}/kde/plasma5/plasma-all.xml; do
   id=$(grep xreflabel $file | sed 's@.*id="\([^"]*\).*@\1@')
   cat >>$SPECIAL_FILE << EOF
     <xsl:when test="@id='$id'">
@@ -116,26 +118,35 @@ EOF
 # So we have to read that command too, since it may be assumed
 # that the preceding package is a dependency of the following,
 # except the first.
-  list_cat="$(sed -n '/>cat/,/EOF</p' $file | grep -v 'cat\|EOF\|#' |
+list_cat="$(sed -n '/>cat.*\.\(md5\|dat\)/,/EOF</p' $file | grep -v 'cat\|EOF\|#' |
               awk '{ print $NF }' | sed 's/-&.*//')"
 
-# Rationale for the sed below: the following for breaks words at spaces (unless
-# we tweak IFS). So replace spaces with commas in lines so that only newlines
-# are separators.
-  for pack in \
-      $(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do
-    packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@')
-    packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@')
-    precpack=NONE
-    for i in $list_cat; do
-      if [ "$i" = "$packname" ]; then break; fi
-      precpack=$i
-    done
-# It may happen that packname is not in list_cat, because its entity
-# is commented out in the xml, but we do not check that (too complicated).
-# In that case, the whole list is scanned, and $precpack=$i at the end.
-# when packname is found in the list $precpack!=$i.
-    if [ "$precpack" = "$i" ]; then continue; fi
+  precpack=NONE
+  for pack in $list_cat; do
+    if grep -q x7 $file; then # this is an xorg package
+      packname=$pack
+      packversion=$(grep "ENTITY ${pack}-version" $file | \
+	            sed 's@[^"]*"\([^"]*\).*@\1@')
+    else
+      packname=${pack%%-[[:digit:]]*}
+      packversion=$(echo $pack | sed 's/[^.]*-\([.[:digit:]]*\)\.tar.*/\1/')
+    fi
+## Rationale for the sed below: the following for breaks words at spaces (unless
+## we tweak IFS). So replace spaces with commas in lines so that only newlines
+## are separators.
+#  for pack in \
+#      $(grep 'ENTITY.*version' $file | sed 's/[ ]\+/,/g'); do
+#    packname=$(echo $pack | sed s'@.*ENTITY,\(.*\)-version.*@\1@')
+#    packversion=$(echo $pack | sed 's@[^"]*"\([^"]*\).*@\1@')
+#    for i in $list_cat; do
+#      if [ "$i" = "$packname" ]; then break; fi
+#      precpack=$i
+#    done
+## It may happen that packname is not in list_cat, because its entity
+## is commented out in the xml, but we do not check that (too complicated).
+## In that case, the whole list is scanned, and $precpack=$i at the end.
+## when packname is found in the list $precpack!=$i.
+#    if [ "$precpack" = "$i" ]; then continue; fi
     cat >>$SPECIAL_FILE << EOF
         <module><xsl:text>&#xA;          </xsl:text>
           <xsl:element name="name">$packname</xsl:element>
@@ -182,6 +193,7 @@ EOF
           <xsl:attribute name="type">ref</xsl:attribute>
         </xsl:element>
 EOF
+    precpack=$packname
   done
   cat >>$SPECIAL_FILE << EOF
      </package>
diff --git a/BLFS/xsl/gen_config.xsl b/BLFS/xsl/gen_config.xsl
index 63b3768..71e5c66 100644
--- a/BLFS/xsl/gen_config.xsl
+++ b/BLFS/xsl/gen_config.xsl
@@ -309,7 +309,9 @@ if&#9;MENU_</xsl:text>
       <xsl:text>"
 &#9;&#9;&#9;default&#9;</xsl:text>
       <xsl:choose>
-        <xsl:when test="contains(../name,'xorg')">
+        <xsl:when test="contains(../name,'xorg') or
+                        contains(../name,'plasma') or
+                        contains(../name,'kf5')">
           <xsl:text>y
 
 </xsl:text>
diff --git a/BLFS/xsl/gen_pkg_list.xsl b/BLFS/xsl/gen_pkg_list.xsl
index b069245..e3e0ef6 100644
--- a/BLFS/xsl/gen_pkg_list.xsl
+++ b/BLFS/xsl/gen_pkg_list.xsl
@@ -359,7 +359,9 @@
 <!-- do not depend on something which is not a dependency -->
         <xsl:when test="@role='nodep'"/>
 <!-- Call list expansion when we have an xorg7 series of packages -->
-        <xsl:when test="contains(@linkend,'xorg7-')">
+        <xsl:when test="contains(@linkend,'xorg7-') or
+                        @linkend='kf5-frameworks' or
+                        @linkend='plasma5-build'">
           <xsl:call-template name="expand-deps">
             <xsl:with-param name="section">
               <xsl:value-of select="@linkend"/>
diff --git a/BLFS/xsl/make_book.xsl b/BLFS/xsl/make_book.xsl
index 6e35b91..129e1cc 100644
--- a/BLFS/xsl/make_book.xsl
+++ b/BLFS/xsl/make_book.xsl
@@ -57,15 +57,13 @@
 <!-- apply-templates for each item in the list.
      Normally, those items are id of nodes.
      Those nodes can be sect1 (normal case),
-     sect2 (python modules or DBus bindings)
-     bridgehead (perl modules)
-     para (dependency of perl modules).
+     sect2 (python/perl modules/dependencies )
      The templates after this one treat each of those cases.
      However, some items are xorg package names, and not id.
      We need special instructions in that case.
      The difficulty is that some of those names *are* id's,
      because they are referenced in the index.
-     Hopefully, none of those id's are sect{1,2}, bridgehead or para...-->
+     Hopefully, none of those id's are sect{1,2}...-->
   <xsl:template name="apply-list">
     <xsl:param name="list" select="''"/>
     <xsl:if test="string-length($list) &gt; 0">
@@ -100,7 +98,7 @@
               </xsl:call-template>
             </xsl:when>
             <xsl:when test="contains(concat($list,' '),'-pass1 ')">
-<!-- We need to do it only for sect1 and sect2, because of libva -->
+<!-- We need to do it for both sect1 and sect2, because of libva -->
               <xsl:variable
                    name="real-id"
                    select="substring-before(concat($list,' '),'-pass1 ')"/>
@@ -113,9 +111,11 @@
             </xsl:when>
             <xsl:when test="not(id($list)[self::sect1 or self::sect2 or self::para or self::bridgehead])">
               <xsl:apply-templates
-                   select="//sect1[contains(@id,'xorg7')
-                               and contains(string(.//userinput),
-                                            concat($list,'-'))]"
+                select="//sect1[(contains(@id,'xorg7') or
+                                 contains(@id,'frameworks') or
+                                 contains(@id,'plasma5'))
+                                 and .//userinput/literal[contains(string(),
+                                            concat($list,'-'))]]"
                    mode="xorg">
                 <xsl:with-param name="package" select="$list"/>
               </xsl:apply-templates>
@@ -497,6 +497,17 @@
      one -->
   <xsl:template match="sect1" mode="xorg">
     <xsl:param name="package"/>
+    <!--DEBUG
+    <xsl:message>
+      <xsl:text>Entering sect1 template in xorg mode:
+- page id:</xsl:text>
+      <xsl:value-of select="@id"/>
+      <xsl:text>
+- package:</xsl:text>
+      <xsl:value-of select="$package"/>
+      <xsl:text>
+</xsl:text>
+    </xsl:message> END DEBUG -->
     <xsl:variable name="tarball">
       <xsl:call-template name="tarball">
         <xsl:with-param name="package" select="concat(' ',$package,'-')"/>
@@ -521,7 +532,13 @@
     <xsl:variable name="install-instructions">
       <xsl:call-template name="inst-instr">
         <xsl:with-param name="inst-instr"
-                        select=".//userinput[starts-with(string(),'for ')]"/>
+          select=
+            "substring-after(
+               substring-after(.//userinput[starts-with(string(),'for ') or
+                                            starts-with(string(),'while ')],
+                               'pushd'),
+               '&#xA;')"/>
+        <xsl:with-param name="package" select="$package"/>
       </xsl:call-template>
     </xsl:variable>
     <xsl:element name="sect1">
@@ -540,20 +557,17 @@
                 <xsl:value-of
                    select=".//para[contains(string(),'(HTTP)')]/ulink/@url"/>
                 <xsl:value-of select="$download-dir"/>
+                <xsl:if test="contains(@id,'frameworks') or
+                              contains(@id,'plasma5')">
+                  <xsl:text>/</xsl:text>
+                </xsl:if>
                 <xsl:value-of select="$tarball"/>
               </xsl:attribute>
              </xsl:element>
             </para>
           </listitem>
           <listitem>
-            <para>Download (FTP): <xsl:element name="ulink">
-              <xsl:attribute name="url">
-                <xsl:value-of
-                   select=".//para[contains(string(),'(FTP)')]/ulink/@url"/>
-                <xsl:value-of select="$download-dir"/>
-                <xsl:value-of select="$tarball"/>
-              </xsl:attribute>
-             </xsl:element>
+            <para>Download (FTP): <ulink url=" "/>
             </para>
           </listitem>
           <listitem>
@@ -581,7 +595,9 @@
 
         <screen><userinput>packagedir=<xsl:value-of
                     select="substring-before($tarball,'.tar.')"/>
-          <xsl:text>&#xA;</xsl:text>
+          <xsl:text>
+     name=$(echo $pkg | sed 's/-[[:digit:]].*//')
+          </xsl:text>
           <xsl:value-of select="substring-before($install-instructions,
                                                  'as_root')"/>
         </userinput></screen>
@@ -680,14 +696,21 @@ END DEBUG -->
 
   <xsl:template name="inst-instr">
     <xsl:param name="inst-instr"/>
+    <xsl:param name="package"/>
     <xsl:choose>
-      <xsl:when test="contains($inst-instr,'pushd')">
-        <xsl:call-template name="inst-instr">
-          <xsl:with-param name="inst-instr"
-                          select="substring-after(
-                                   substring-after($inst-instr,'pushd'),
-                                   '&#xA;')"/>
-        </xsl:call-template>
+      <xsl:when test="contains(substring-after($inst-instr,'popd'),'popd')">
+        <xsl:choose>
+          <xsl:when test="$package='kapidox'">
+            <xsl:copy-of select="substring-after(substring-before($inst-instr,'popd'),'kapidox)')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="substring-before($inst-instr,'kapidox)')"/>
+            <xsl:call-template name="inst-instr">
+              <xsl:with-param name="inst-instr"
+                              select="substring-after($inst-instr,';;')"/>
+            </xsl:call-template>
+          </xsl:otherwise>
+        </xsl:choose>
       </xsl:when>
       <xsl:otherwise>
         <xsl:copy-of select="substring-before($inst-instr,'popd')"/>