From f2e32d604eb39bca49cc9493d929adc88167f0cc Mon Sep 17 00:00:00 2001 From: atmm77 Date: Mon, 4 Nov 2024 15:24:35 -0500 Subject: [PATCH] This change allows generating packages for CentOS Stream 9, Rocky Linux 9 and Alma Linux 9. --- Applications/Workspace/GNUmakefile.preamble | 2 +- Applications/nextspace-applications.spec | 7 ++--- Packaging/RedHat/0.build_libraries.sh | 15 +++-------- Packaging/RedHat/build_libcorefoundation.sh | 6 ++--- Packaging/RedHat/build_libobjc2.sh | 4 +-- Packaging/RedHat/nextspace_install.sh | 29 ++++++++------------ Packaging/environment.sh | 30 +++++++++------------ 7 files changed, 35 insertions(+), 58 deletions(-) diff --git a/Applications/Workspace/GNUmakefile.preamble b/Applications/Workspace/GNUmakefile.preamble index dbe3b0e39..7c13f3f78 100644 --- a/Applications/Workspace/GNUmakefile.preamble +++ b/Applications/Workspace/GNUmakefile.preamble @@ -14,7 +14,7 @@ ADDITIONAL_OBJCFLAGS += -Wall -Wno-unused-variable -Wno-typedef-redefinition #ADDITIONAL_CFLAGS += # Additional flags to pass to the linker -ADDITIONAL_LDFLAGS += `pkg-config --libs dbus-1 udisks2 upower-glib` -ldispatch -ldl -lbsd +ADDITIONAL_LDFLAGS += `pkg-config --libs dbus-1 udisks2 upower-glib` -ldispatch -ldl -lbsd -fuse-ld=gold # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I./ `pkg-config --cflags dbus-1 udisks2 upower-glib` diff --git a/Applications/nextspace-applications.spec b/Applications/nextspace-applications.spec index 88bacbb21..c905e6c66 100644 --- a/Applications/nextspace-applications.spec +++ b/Applications/nextspace-applications.spec @@ -54,11 +54,9 @@ Requires: libXcomposite Requires: libXrender Requires: libXdamage Requires: libexif +Requires: xkbcomp +Requires: xorg-x11-drivers Requires: xorg-x11-drv-evdev -%ifnarch aarch64 -Requires: xorg-x11-drv-intel -Requires: xorg-x11-drv-vesa -%endif Requires: xorg-x11-drv-synaptics Requires: xorg-x11-server-Xorg %if 0%{?el7} @@ -66,7 +64,6 @@ Requires: xorg-x11-drv-keyboard Requires: xorg-x11-drv-mouse %endif %if 0%{?rhel} || 0%{?fedora} < 34 -Requires: xorg-x11-xkb-utils Requires: xorg-x11-server-utils %else Requires: xrdb diff --git a/Packaging/RedHat/0.build_libraries.sh b/Packaging/RedHat/0.build_libraries.sh index 21ec9018b..c9f72874c 100755 --- a/Packaging/RedHat/0.build_libraries.sh +++ b/Packaging/RedHat/0.build_libraries.sh @@ -13,18 +13,11 @@ if [ $? -eq 1 ];then exit 1 fi -if [ "$OS_NAME" == "Rocky Linux" ] || [ "$OS_NAME" == "AlmaLinux" ] && [ $OS_VERSION = "8.8" ];then - dnf -y install epel-release - dnf config-manager --set-enabled powertools -fi - # Apple Grand Central Dispatch -if [ "$OS_ID" == "centos" ];then - `dirname $0`/build_libdispatch.sh $1 - if [ $? -eq 1 ]; then - echo "Aborting..." - exit 1 - fi +`dirname $0`/build_libdispatch.sh $1 +if [ $? -eq 1 ]; then + echo "Aborting..." + exit 1 fi # Apple Core Foundation diff --git a/Packaging/RedHat/build_libcorefoundation.sh b/Packaging/RedHat/build_libcorefoundation.sh index b8837597a..a9b3080d9 100755 --- a/Packaging/RedHat/build_libcorefoundation.sh +++ b/Packaging/RedHat/build_libcorefoundation.sh @@ -4,7 +4,7 @@ BUILD_RPM=1 . ../environment.sh -if [ "${OS_ID}" = "centos" ];then +if [ "${OS_ID}" = "centos" ] && [ "${OS_VERSION}" = "7" ];then SPEC_FILE=${PROJECT_DIR}/Libraries/libcorefoundation/libcorefoundation-centos.spec else SPEC_FILE=${PROJECT_DIR}/Libraries/libcorefoundation/libcorefoundation.spec @@ -12,7 +12,7 @@ fi CF_VERSION=`rpm_version ${SPEC_FILE}` print_H1 " Building Core Foundation (libcorefoundation) package..." -if [ "${OS_ID}" = "centos" ];then +if [ "${OS_ID}" = "centos" ] && [ "${OS_VERSION}" = "7" ];then cp ${PROJECT_DIR}/Libraries/libcorefoundation/*.patch ${RPM_SOURCES_DIR} cp ${PROJECT_DIR}/Libraries/libcorefoundation/CFNotificationCenter.c ${RPM_SOURCES_DIR} cp ${PROJECT_DIR}/Libraries/libcorefoundation/CFFileDescriptor.[ch] ${RPM_SOURCES_DIR} @@ -24,7 +24,7 @@ sudo yum -y install ${DEPS} print_H2 "===== Downloading Core Foundation sources..." _VER=`rpmspec -q --qf "%{version}:" ${SPEC_FILE} | awk -F: '{print $1}'` -if [ "$OS_ID" = "centos" ];then +if [ "${OS_ID}" = "centos" ] && [ "${OS_VERSION}" = "7" ];then curl -L https://github.com/apple/swift-corelibs-foundation/archive/swift-${_VER}-RELEASE.tar.gz -o ${RPM_SOURCES_DIR}/libcorefoundation-${_VER}.tar.gz else _REL=`rpmspec -q --qf "%{release}:" ${SPEC_FILE} | awk -F: '{print $1}' | awk -F. '{print $1}'` diff --git a/Packaging/RedHat/build_libobjc2.sh b/Packaging/RedHat/build_libobjc2.sh index 87f653ea3..ff4a1edeb 100755 --- a/Packaging/RedHat/build_libobjc2.sh +++ b/Packaging/RedHat/build_libobjc2.sh @@ -4,15 +4,15 @@ BUILD_RPM=1 . `dirname $0`/../environment.sh -if [ "$OS_ID" == "centos" ];then +if [ "$OS_ID" == "centos" ] && [ "$OS_VERSION" == "7" ];then SPEC_FILE=${PROJECT_DIR}/Libraries/libobjc2/libobjc2-centos.spec else SPEC_FILE=${PROJECT_DIR}/Libraries/libobjc2/libobjc2.spec fi + OBJC2_VERSION=`rpm_version ${SPEC_FILE}` print_H1 " Building Objective-C Runtime(libobjc2) package..." - print_H2 "===== Install libobjc2 build dependencies..." DEPS=`rpmspec -q --buildrequires ${SPEC_FILE} | awk -c '{print $1}'` sudo yum -y install ${DEPS} diff --git a/Packaging/RedHat/nextspace_install.sh b/Packaging/RedHat/nextspace_install.sh index d92141709..99f7d67ed 100755 --- a/Packaging/RedHat/nextspace_install.sh +++ b/Packaging/RedHat/nextspace_install.sh @@ -3,19 +3,16 @@ # This script should be placed along with NSUser and NSDeveloper # directories. -. ./install_environment.sh +. ../install_environment.sh ENABLE_EPEL="" if [ -f /etc/os-release ]; then source /etc/os-release export OS_NAME=$ID - export OS_VERSION=$VERSION_ID - if [ $ID == "centos" ]; then - if [ $VERSION_ID == "7" ]; then - EPEL_REPO=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - else - EPEL_REPO=epel-release - fi + export OS_VERSION=`echo ${VERSION_ID} | awk -F\. '{print $1}'` + if [ $OS_NAME == "centos" ] && [ $OS_VERSION == "7" ]; then + EPEL_REPO=https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm + EPEL_REPO=epel-release ENABLE_EPEL="--enablerepo=epel" fi fi @@ -46,8 +43,6 @@ if [ "$EPEL_REPO" != "" ]; then if [ $? -eq 1 ];then echo "Adding EPEL repository..." yum -y install $EPEL_REPO 2>&1 > /dev/null - echo "Updating system..." - yum -y update 2>&1 > /dev/null else echo -e -n "\e[32m" echo "yes" @@ -76,7 +71,7 @@ echo "Installing NEXTSPACE User packages..." echo "===============================================================================" echo -e -n "\e[0m" echo -n "..." -sudo yum -y -q install $ENABLE_EPEL NSUser/*.rpm 2>&1 > /dev/null || exit 1 +sudo yum -y -q install $ENABLE_EPEL $OS_NAME-$OS_VERSION/NSUser/*.rpm 2>&1 > /dev/null || exit 1 sudo ldconfig echo -e -n "\e[32m" echo -e "\b\b\bDone. User packages were installed." @@ -97,13 +92,11 @@ if [ "$YN" = "y" ]; then echo "===============================================================================" echo -e -n "\e[0m" echo -n "..." - if [ $OS_NAME == "centos" ]; then - if [ $VERSION_ID == "7" ]; then - sudo yum -y -q install centos-release-scl 2>&1 > /dev/null || exit 1 - ENABLE_EPEL+=" --enablerepo=centos-sclo-sclo --enable-epo=centos-sclo-rh" - fi + if [ $OS_NAME == "centos" ] && [ $OS_VERSION == "7" ]; then + sudo yum -y -q install centos-release-scl 2>&1 > /dev/null || exit 1 + ENABLE_EPEL+=" --enablerepo=centos-sclo-sclo --enable-epo=centos-sclo-rh" fi - sudo yum -y -q install $ENABLE_EPEL NSDeveloper/*.rpm 2>&1 > /dev/null || exit 1 + sudo yum -y -q install $ENABLE_EPEL $OS_NAME-$OS_VERSION/NSDeveloper/*.rpm 2>&1 > /dev/null || exit 1 echo -e -n "\e[32m" echo -e "\b\b\bDone. Developer packages were installed." echo -e -n "\e[0m" @@ -120,7 +113,7 @@ echo "========================================================================== echo -e -n "\e[0m" echo -n "..." X11_DRIVERS="xorg-x11-drivers xorg-x11-xinit" -if [ $OS_NAME == "centos" ]; then +if [ $OS_NAME == "centos" ] && [ $OS_VERSION == "7" ]; then X11_DRIVERS+=" xorg-x11-utils" fi sudo yum -y -q install $X11_DRIVERS 2>&1 > /dev/null || exit 1 diff --git a/Packaging/environment.sh b/Packaging/environment.sh index 75fe0e32a..211ee096e 100644 --- a/Packaging/environment.sh +++ b/Packaging/environment.sh @@ -8,6 +8,8 @@ _PWD=`pwd` # Operating system #---------------------------------------- . /etc/os-release +# OS type like "rhel" +OS_LIKE=`echo ${ID_LIKE} | awk '{print $1}'` # OS name like "fedora" OS_ID=$ID _ID=`echo ${ID} | awk -F\" '{print $2}'` @@ -142,7 +144,7 @@ else ${ECHO} "Using linker:\tGold" fi # Compiler -if [ "$OS_ID" = "fedora" ] || [ "$OS_ID" = "debian" ] || [ "$OS_ID" = "ubuntu" ]; then +if [ "$OS_LIKE" = "rhel" ] || [ "$OS_ID" = "debian" ] || [ "$OS_ID" = "ubuntu" ]; then which clang 2>&1 > /dev/null || `echo "No clang compiler found. Please install clang package."; exit 1` C_COMPILER=`which clang` which clang++ 2>&1 > /dev/null || `echo "No clang++ compiler found. Please install clang++ package."; exit 1` @@ -208,24 +210,16 @@ prepare_environment() rpm -q centos-release-scl-rh 2>&1 > /dev/null if [ $? -eq 1 ]; then BUILD_TOOLS+=" centos-release-scl-rh"; fi fi - if [ $OS_VERSION == "9" ];then - # Could be "CentOS Linux" or "CentOS Stream" - if [ "$OS_ID" == "CentOS Stream" ]; then - yum config-manager --set-enabled powertools - else - yum config-manager --set-enabled PowerTools - fi - rpm -q epel-release 2>&1 > /dev/null - if [ $? -eq 1 ]; then BUILD_TOOLS+=" epel-release"; fi - rpm -q dnf-plugins-core 2>&1 > /dev/null - if [ $? -eq 1 ]; then BUILD_TOOLS+=" dnf-plugins-core"; fi - rpm -q git 2>&1 > /dev/null - if [ $? -eq 1 ]; then BUILD_TOOLS+=" git"; fi - fi fi else - print_H2 ">>>>> Can't find /etc/os-release - this OS is unsupported." - return 1 + if [ "${OS_LIKE}" = "rhel" ] && [ "${OS_VERSION}" > "9" ];then + dnf -y install epel-release + dnf config-manager --set-enabled crb + dnf -y install clang + else + print_H2 ">>>>> Can't find /etc/os-release - this OS is unsupported." + return 1 + fi fi if [ "${BUILD_TOOLS}" != "" ]; then @@ -316,4 +310,4 @@ print_help() print_H2 "$ cd nextspace" print_H2 "$ ./scripts/$SCRIPT_NAME ~/nextspace" printf "\n" -} \ No newline at end of file +}