texlive[69544] Build/source/.github: [gh action] unify install/build

commits+preining at tug.org commits+preining at tug.org
Tue Jan 23 03:36:56 CET 2024


Revision: 69544
          https://tug.org/svn/texlive?view=revision&revision=69544
Author:   preining
Date:     2024-01-23 03:36:56 +0100 (Tue, 23 Jan 2024)
Log Message:
-----------
[gh action] unify install/build into build-tl.sh, hopefully support bsd

Modified Paths:
--------------
    trunk/Build/source/.github/scripts/build-tl.sh
    trunk/Build/source/.github/workflows/main.yml

Removed Paths:
-------------
    trunk/Build/source/.github/scripts/install-deps.alpine.sh
    trunk/Build/source/.github/scripts/install-deps.bsd.sh
    trunk/Build/source/.github/scripts/install-deps.centos.sh
    trunk/Build/source/.github/scripts/install-deps.solaris.sh
    trunk/Build/source/.github/scripts/install-deps.ubuntu.sh

Modified: trunk/Build/source/.github/scripts/build-tl.sh
===================================================================
--- trunk/Build/source/.github/scripts/build-tl.sh	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/scripts/build-tl.sh	2024-01-23 02:36:56 UTC (rev 69544)
@@ -2,65 +2,119 @@
 
 set -e
 
+if [ "x$2" = "x" ]
+then
+  echo "Usage: `basename $0` arch buildsys [steps]" >&2
+  exit 1
+fi
+
 arch="$1"
 echo "Building TL for arch = $arch"
+shift
 
-destdir="$2"
+buildsys=$1
+echo "Building on $buildsys"
+shift
 
-# for CentOS we need to activate gcc-9
-if [ -f /opt/rh/devtoolset-9/enable ]
-then
-  # we cannot call scl enable devtoolset-9 here since we need
-  # the settings in the running shell
-  . /opt/rh/devtoolset-9/enable
+STEPS=",$1,"
+shift
+if [ "x$STEPS" = "x" ]
+  STEPS=",prepare,build,"
 fi
 
+destdir="$1"
+shift
 
-find . -name \*.info -exec touch '{}' \;
-touch ./texk/detex/detex-src/detex.c
-touch ./texk/detex/detex-src/detex.h
-touch ./texk/gregorio/gregorio-src/src/gabc/gabc-score-determination.c
-touch ./texk/gregorio/gregorio-src/src/gabc/gabc-score-determination.h
-touch ./texk/gregorio/gregorio-src/src/vowel/vowel-rules.h
-touch ./texk/web2c/omegafonts/pl-lexer.c
-touch ./texk/web2c/omegafonts/pl-parser.c
-touch ./texk/web2c/omegafonts/pl-parser.h
-touch ./texk/web2c/otps/otp-lexer.c
-touch ./texk/web2c/otps/otp-parser.c
-touch ./texk/web2c/otps/otp-parser.h
-touch ./texk/web2c/web2c/web2c-lexer.c
-touch ./texk/web2c/web2c/web2c-parser.c
-touch ./texk/web2c/web2c/web2c-parser.h
-touch ./utils/asymptote/camp.tab.cc
-touch ./utils/asymptote/camp.tab.h
-touch ./utils/lacheck/lacheck.c
-touch ./utils/xindy/xindy-src/tex2xindy/tex2xindy.c
+if [[ "$STEPS" == *,prepare,* ]]
+then
+  case $buildsys in 
+     ubuntu|debian)
+       export DEBIAN_FRONTEND=noninteractive
+       export LANG=C.UTF-8
+       export LC_ALL=C.UTF-8
+       apt-get update -q -y
+       apt-get install -y --no-install-recommends bash gcc g++ make perl libfontconfig-dev libx11-dev libxmu-dev libxaw7-dev build-essential
+       ;;
+     centos)
+       yum update -y
+       yum install -y centos-release-scl
+       yum install -y devtoolset-9 fontconfig-devel libX11-devel libXmu-devel libXaw-devel
+       ;;
+     alpine)
+       apk update
+       apk add --no-progress bash gcc g++ make perl fontconfig-dev libx11-dev libxmu-dev libxaw-dev
+       ;;
+     freebsd|netbsd)
+       pkg install gmake gcc pkgconf libX11 libXt libXaw fontconfig
+       ;;
+     solaris)
+       echo "Solaris support is WIP, please help!" >&2
+       exit 1
+     *)
+       echo "Unsupported build system: $buildsys" >&2
+       exit 1
+  esac
 
-# default settings
-TL_MAKE_FLAGS="-j 2"
-BUILDARGS=""
 
-# special cases
-case "$arch" in
-  armhf-linux)
-    TL_MAKE_FLAGS="-j 1"
-    ;;
-  aarch64-linux)
-    BUILDARGS="--enable-arm-neon=on"
-    ;;
-  *-solaris)
-    export CC="/path/to/gcc-5.5 -m64"
-    export CXX="/path/to/g++-5.5 -m64"
-    ;;
-esac
-export TL_MAKE_FLAGS
+  # for CentOS we need to activate gcc-9
+  if [ -f /opt/rh/devtoolset-9/enable ]
+  then
+    # we cannot call scl enable devtoolset-9 here since we need
+    # the settings in the running shell
+    . /opt/rh/devtoolset-9/enable
+  fi
+fi
 
-./Build -C $BUILDARGS
-
-mv inst/bin/* $arch
-tar czvf texlive-bin-$arch.tar.gz $arch
-if [ -n "$destdir" ] ; then
-  mv texlive-bin-$arch.tar.gz "$destdir"
-  ls "$destdir"
+if [[ "$STEPS" == *,build,* ]]
+then
+  find . -name \*.info -exec touch '{}' \;
+  touch ./texk/detex/detex-src/detex.c
+  touch ./texk/detex/detex-src/detex.h
+  touch ./texk/gregorio/gregorio-src/src/gabc/gabc-score-determination.c
+  touch ./texk/gregorio/gregorio-src/src/gabc/gabc-score-determination.h
+  touch ./texk/gregorio/gregorio-src/src/vowel/vowel-rules.h
+  touch ./texk/web2c/omegafonts/pl-lexer.c
+  touch ./texk/web2c/omegafonts/pl-parser.c
+  touch ./texk/web2c/omegafonts/pl-parser.h
+  touch ./texk/web2c/otps/otp-lexer.c
+  touch ./texk/web2c/otps/otp-parser.c
+  touch ./texk/web2c/otps/otp-parser.h
+  touch ./texk/web2c/web2c/web2c-lexer.c
+  touch ./texk/web2c/web2c/web2c-parser.c
+  touch ./texk/web2c/web2c/web2c-parser.h
+  touch ./utils/asymptote/camp.tab.cc
+  touch ./utils/asymptote/camp.tab.h
+  touch ./utils/lacheck/lacheck.c
+  touch ./utils/xindy/xindy-src/tex2xindy/tex2xindy.c
+  
+  # default settings
+  TL_MAKE_FLAGS="-j 2"
+  BUILDARGS=""
+  
+  # special cases
+  case "$arch" in
+    armhf-linux)
+      TL_MAKE_FLAGS="-j 1"
+      ;;
+    aarch64-linux)
+      BUILDARGS="--enable-arm-neon=on"
+      ;;
+    *-solaris)
+      export CC="/path/to/gcc-5.5 -m64"
+      export CXX="/path/to/g++-5.5 -m64"
+      ;;
+    *-freebsd)
+      export TL_MAKE=gmake
+      export CC=gcc 
+      export CXX=g++
+      export CFLAGS=-D_NETBSD_SOURCE
+      export CXXFLAGS='-D_NETBSD_SOURCE -std=c++11'
+      ;;
+  esac
+  export TL_MAKE_FLAGS
+  
+  ./Build -C $BUILDARGS
+  
+  mv inst/bin/* $arch
+  tar czvf texlive-bin-$arch.tar.gz $arch
 fi
-

Deleted: trunk/Build/source/.github/scripts/install-deps.alpine.sh
===================================================================
--- trunk/Build/source/.github/scripts/install-deps.alpine.sh	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/scripts/install-deps.alpine.sh	2024-01-23 02:36:56 UTC (rev 69544)
@@ -1,3 +0,0 @@
-#!/bin/sh
-apk update
-apk add --no-progress bash gcc g++ make perl fontconfig-dev libx11-dev libxmu-dev libxaw-dev

Deleted: trunk/Build/source/.github/scripts/install-deps.bsd.sh
===================================================================
--- trunk/Build/source/.github/scripts/install-deps.bsd.sh	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/scripts/install-deps.bsd.sh	2024-01-23 02:36:56 UTC (rev 69544)
@@ -1,3 +0,0 @@
-#!/bin/sh
-#pkg install -y file
-echo "TODO"

Deleted: trunk/Build/source/.github/scripts/install-deps.centos.sh
===================================================================
--- trunk/Build/source/.github/scripts/install-deps.centos.sh	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/scripts/install-deps.centos.sh	2024-01-23 02:36:56 UTC (rev 69544)
@@ -1,4 +0,0 @@
-#!/bin/sh
-yum update -y
-yum install -y centos-release-scl
-yum install -y devtoolset-9 fontconfig-devel libX11-devel libXmu-devel libXaw-devel

Deleted: trunk/Build/source/.github/scripts/install-deps.solaris.sh
===================================================================
--- trunk/Build/source/.github/scripts/install-deps.solaris.sh	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/scripts/install-deps.solaris.sh	2024-01-23 02:36:56 UTC (rev 69544)
@@ -1 +0,0 @@
-echo "TODO"

Deleted: trunk/Build/source/.github/scripts/install-deps.ubuntu.sh
===================================================================
--- trunk/Build/source/.github/scripts/install-deps.ubuntu.sh	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/scripts/install-deps.ubuntu.sh	2024-01-23 02:36:56 UTC (rev 69544)
@@ -1,6 +0,0 @@
-#!/bin/bash
-export DEBIAN_FRONTEND=noninteractive
-export LANG=C.UTF-8
-export LC_ALL=C.UTF-8
-apt-get update -q -y
-apt-get install -y --no-install-recommends bash gcc g++ make perl libfontconfig-dev libx11-dev libxmu-dev libxaw7-dev build-essential

Modified: trunk/Build/source/.github/workflows/main.yml
===================================================================
--- trunk/Build/source/.github/workflows/main.yml	2024-01-23 00:43:27 UTC (rev 69543)
+++ trunk/Build/source/.github/workflows/main.yml	2024-01-23 02:36:56 UTC (rev 69544)
@@ -57,16 +57,19 @@
             platform: 386
             ci_build: true
             use_qemu: false
+            buildsys: ubuntu
           - tl_name: x86_64-linux
             image: centos:7
             platform: amd64
             ci_build: true
             use_qemu: false
+            buildsys: centos
           - tl_name: x86_64-linuxmusl
             image: alpine:3.5
             platform: amd64
             ci_build: true
             use_qemu: false
+            buildsys: alpine
           - tl_name: aarch64-linux
             image: arm64v8/debian:buster
             platform: aarch64
@@ -73,6 +76,7 @@
             ci_build: false
             use_qemu: true
             qemu_arch: aarch64
+            buildsys: debian
           - tl_name: armhf-linux
             image: arm32v7/debian:buster
             platform: arm/v7
@@ -79,6 +83,7 @@
             ci_build: false
             use_qemu: true
             qemu_arch: arm
+            buildsys: debian
 
     steps:
       - name: checkout-main
@@ -98,13 +103,7 @@
           options: -v ${{ github.workspace }}:/work --platform linux/${{ matrix.platform }}
           run: |
             cd /work/repo
-            case "${{ matrix.image }}" in
-              i386/ubuntu:*) .github/scripts/install-deps.ubuntu.sh ;;
-              */debian:*) .github/scripts/install-deps.ubuntu.sh ;;
-              centos:*) .github/scripts/install-deps.centos.sh ;;
-              alpine:*) .github/scripts/install-deps.alpine.sh ;;
-            esac
-            .github/scripts/build-tl.sh ${{ matrix.tl_name }}
+            .github/scripts/build-tl.sh ${{ matrix.tl_name }} ${{ matrix.buildsys }}
       - name: find file step
         if: ${{ matrix.ci_build || matrix.release_build }}
         run: ls -l $GITHUB_WORKSPACE/repo/texlive-bin-${{ matrix.tl_name }}.tar.gz
@@ -149,8 +148,7 @@
           usesh: true
           run: |
             cd repo
-            sh .github/scripts/install-deps.bsd.sh
-            sh .github/scripts/build-tl.sh ${{ matrix.arch }}-${{ matrix.os }}
+            sh .github/scripts/build-tl.sh ${{ matrix.arch }}-${{ matrix.os }} ${{ matrix.os }}
       - name: build netbsd
         uses: vmactions/netbsd-vm at v1
         if: ${{ matrix.os == 'netbsd' && (matrix.ci_build || matrix.release_build) }}
@@ -158,8 +156,7 @@
           usesh: true
           run: |
             cd repo
-            sh .github/scripts/install-deps.bsd.sh
-            sh .github/scripts/build-tl.sh ${{ matrix.arch }}-${{ matrix.os }}
+            sh .github/scripts/build-tl.sh ${{ matrix.arch }}-${{ matrix.os }} ${{ matrix.os }}
       - name: build solaris
         uses: vmactions/solaris-vm at v1
         if: ${{ matrix.os == 'solaris' && (matrix.ci_build || matrix.release_build) }}
@@ -167,8 +164,7 @@
           usesh: true
           run: |
             cd repo
-            sh .github/scripts/install-deps.solaris.sh
-            sh .github/scripts/build-tl.sh ${{ matrix.arch }}-${{ matrix.os }}
+            sh .github/scripts/build-tl.sh ${{ matrix.arch }}-${{ matrix.os }} ${{ matrix.os }}
       - name: find file step
         if: ${{ matrix.ci_build || matrix.release_build }}
         run: ls -l $GITHUB_WORKSPACE/repo/texlive-bin-${{ matrix.arch }}-${{ matrix.os }}.tar.gz



More information about the tex-live-commits mailing list.