Skip to content

Commit

Permalink
This change allows generating packages for CentOS Stream 9, Rocky Lin…
Browse files Browse the repository at this point in the history
…ux 9 and Alma Linux 9.
  • Loading branch information
armm77 committed Nov 4, 2024
1 parent 38b5298 commit f2e32d6
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Applications/Workspace/GNUmakefile.preamble
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 2 additions & 5 deletions Applications/nextspace-applications.spec
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,16 @@ 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}
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
Expand Down
15 changes: 4 additions & 11 deletions Packaging/RedHat/0.build_libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Packaging/RedHat/build_libcorefoundation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
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
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}
Expand All @@ -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}'`
Expand Down
4 changes: 2 additions & 2 deletions Packaging/RedHat/build_libobjc2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
29 changes: 11 additions & 18 deletions Packaging/RedHat/nextspace_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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."
Expand All @@ -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"
Expand All @@ -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
Expand Down
30 changes: 12 additions & 18 deletions Packaging/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -316,4 +310,4 @@ print_help()
print_H2 "$ cd nextspace"
print_H2 "$ ./scripts/$SCRIPT_NAME ~/nextspace"
printf "\n"
}
}

0 comments on commit f2e32d6

Please sign in to comment.