Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cgct: updating and adding packages #294

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cgct/cbt/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pkgname=cbt
pkgver=2.43
pkgrel=1
pkgver=2.43.1
pkgrel=0
pkgdesc='Cross Binutils for Termux (only for Linux)'
arch=(x86_64)
url='https://www.gnu.org/software/binutils/'
Expand All @@ -9,10 +9,10 @@ source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
config.sub.patch
ldmain.c.patch
ldmain.h.patch)
sha256sums=('b53606f443ac8f01d1d5fc9c39497f2af322d99e14cea5c0b4b124d630379365'
'c77958c9a92c984f0533e6ceac6fd49434328bd7f9b1e915fc63b939c8e5a276'
'c06af15157ac007863e3dc7e05428cad53a4c97b086616930963ac3eb456d463'
'e475440cd4ac1cb1d3056a860746428f770cc9e95e85cccc8e21a4145a5d94cb')
sha256sums=('13f74202a3c4c51118b797a39ea4200d3f6cfbe224da6d1d95bb938480132dfd'
'8105b0e8bab1759db2aa27a7c21376e2f634d3ecea9e078100dbf8c2543626bd'
'475368e73aeabed942b8b526e74df98d1e499087e736db6a38b401cf272c571e'
'388a25ea90edef3e02e4aa9015cb2846557954ef2e5ae3b34ead06e8bc770753')
optdepends=('glibc-cgct')
groups=('cgct')

Expand Down
4 changes: 2 additions & 2 deletions cgct/cbt/config.sub.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- src/binutils-2.43/config.sub 2024-08-04 02:00:00.000000000 +0300
+++ src/binutils-2.43/config.sub.patch 2024-09-02 18:42:53.474422328 +0300
--- src/binutils-2.43.1/config.sub 2024-08-04 02:00:00.000000000 +0300
+++ src/binutils-2.43.1/config.sub.patch 2024-09-02 18:42:53.474422328 +0300
@@ -648,6 +648,10 @@
basic_machine=ymp-cray
basic_os=unicos
Expand Down
4 changes: 2 additions & 2 deletions cgct/cbt/ldmain.c.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- src/binutils-2.43/ld/ldmain.c 2024-01-29 03:00:00.000000000 +0300
+++ src/binutils-2.43/ld/ldmain.c.patch 2024-07-12 14:06:39.982582997 +0300
--- src/binutils-2.43.1/ld/ldmain.c 2024-01-29 03:00:00.000000000 +0300
+++ src/binutils-2.43.1/ld/ldmain.c.patch 2024-07-12 14:06:39.982582997 +0300
@@ -55,6 +55,9 @@
#define TARGET_SYSTEM_ROOT ""
#endif
Expand Down
4 changes: 2 additions & 2 deletions cgct/cbt/ldmain.h.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- src/binutils-2.43/ld/ldmain.h 2024-01-29 03:00:00.000000000 +0300
+++ src/binutils-2.43/ld/ldmain.h.patch 2024-07-12 00:55:23.103689441 +0300
--- src/binutils-2.43.1/ld/ldmain.h 2024-01-29 03:00:00.000000000 +0300
+++ src/binutils-2.43.1/ld/ldmain.h.patch 2024-07-12 00:55:23.103689441 +0300
@@ -62,5 +62,6 @@
extern void add_ignoresym (struct bfd_link_info *, const char *);
extern void add_keepsyms_file (const char *);
Expand Down
84 changes: 84 additions & 0 deletions cgct/cgct-headers/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
pkgname=cgct-headers
pkgver=6.10
pkgrel=0
pkgdesc="Kernel headers for CGCT (only for Linux)"
arch=(x86_64)
url='https://www.gnu.org/software/libc/'
source=(https://www.kernel.org/pub/linux/kernel/v${pkgver:0:1}.x/linux-${pkgver}.tar.xz)
sha256sums=('774698422ee54c5f1e704456f37c65c06b51b4e9a8b0866f34580d86fef8e226')
groups=('cgct')

build() {
for target in arm64 arm x86; do
mkdir headers-${target} || true
cd headers-${target}

make -C "${srcdir}/linux-${pkgver}" ARCH=${target} mrproper

cd ..
done
}

package() {
export DIR_TERMUX="/data/data/com.termux"
export CGCT_PATH="${DIR_TERMUX}/cgct"

for target in arm64 arm x86; do
cd headers-${target}

case "$target" in
"arm64") arch_build="aarch64";;
"x86") arch_build="x86_64";;
*) arch_build="$target";;
esac

make -C "${srcdir}/linux-${pkgver}" INSTALL_HDR_PATH="${pkgdir}/${CGCT_PATH}/${arch_build}" ARCH=${target} headers_install
if [ "$target" = "x86" ]; then
make -C "${srcdir}/linux-${pkgver}" INSTALL_HDR_PATH="${pkgdir}/${CGCT_PATH}/i686" ARCH=${target} headers_install
fi

cd ..
done

echo "Sorting headers..."

declare -A HEADERS
IFS=$'\n'
for i in $(find "${pkgdir}/${CGCT_PATH}" ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD); do
header=$(awk '{printf $2}' <<< "$i")
header="${header/*\/cgct\//}"
HEADERS[$(awk '{printf $1}' <<< "$i")]+="\n${header}"
done
unset IFS

for i in ${!HEADERS[@]}; do
headers=$(echo -e "${HEADERS[$i]}")
! grep -q ^x86_64/ <<< "${headers}" && continue
root_header=$(awk '{printf $1}' <<< $(grep ^x86_64/ <<< "${headers}"))

header="${root_header/*\/include\//}"
h_file="${header##*/}"
h_path="${header//${h_file}/}"

[ -f "${pkgdir}/${CGCT_PATH}/include/${header}" ] && continue

mkdir -p "${pkgdir}/${CGCT_PATH}/include/${h_path}"
cp -P "${pkgdir}/${CGCT_PATH}/${root_header}" "${pkgdir}/${CGCT_PATH}/include/${h_path}"
for j in ${headers}; do
rm "${pkgdir}/${CGCT_PATH}/${j}"
ln -srv "${pkgdir}/${CGCT_PATH}/include/${header}" "${pkgdir}/${CGCT_PATH}/${j}"
done
done

for i in "${pkgdir}/${CGCT_PATH}"/{aarch64,arm,x86_64,i686}/include/*/; do
h_path="${i::-1}"
h_name="${h_path##*/}"
if [ "$(find $i -type f | wc -l)" = 0 ] && \
[ "$(find $i -type l | wc -l)" = "$(find ${pkgdir}/${CGCT_PATH}/include/${h_name} -type f,l | wc -l)" ]; then
rm -fr $i
ln -srv "${pkgdir}/${CGCT_PATH}/include/${h_name}" "${h_path}"
fi
done

echo "Sorting complete"
}