From af4f67069a8aa97793febc1d64dc6a5a795a5dd1 Mon Sep 17 00:00:00 2001 From: BigfootACA Date: Fri, 20 Sep 2024 23:06:31 +0800 Subject: [PATCH] initial commit --- .SRCINFO | 28 ++++++++++++++++++++ .gitignore | 53 +++++++++++++++++++++++++++++++++++++ PKGBUILD | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 PKGBUILD diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..aefae41 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = mingw-w64-gcc + pkgdesc = Cross GCC for the MinGW-w64 cross-compiler + pkgver = 14.2.0 + pkgrel = 1 + url = https://gcc.gnu.org + arch = x86_64 + arch = aarch64 + groups = mingw-w64-toolchain + groups = mingw-w64 + license = GPL + license = LGPL + license = FDL + license = custom + depends = zlib + depends = libisl + depends = libmpc + depends = mingw-w64-crt + depends = mingw-w64-binutils + depends = mingw-w64-winpthreads + depends = mingw-w64-headers + options = !strip + options = staticlibs + options = !emptydirs + options = !buildflags + source = git+https://gitea.classfun.cn:4443/mirrors/gcc.git + sha512sums = SKIP + +pkgname = mingw-w64-gcc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d541115 --- /dev/null +++ b/.gitignore @@ -0,0 +1,53 @@ +*.rej +*.orig +*.swp +*.save* +*.o +*.a +*.out +*.lib +*.obj +*.dll +*.so +*.exe +*.gch +*.plist +*.mo +*.gmo +*.fd +*.iso +*.img +*.img.* +*.qcow2 +*.vhd +*.vdi +*.vmdk +*.cpio +*.cpio.* +*.ttf +*.ttc +*.pcf +*.pcf.* +*.efi +*.pkg.tar.* +vgcore.* +/build* +initramfs*.* +initrd*.* +System.map* +/cmake-build-* +/.idea +/.vscode +/.cache +CMakeCache.txt +CMakeFiles +Makefile +cmake_install.cmake +node_modules +package.json +package-lock.json +fonts.scale +fonts.dir +/src +/pkg +/gcc diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..0f2cc65 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,76 @@ +# Maintainer: BigfootACA +# Maintainer: Felix Yan + +pkgname=mingw-w64-gcc +pkgver=14.2.0 +pkgrel=1 +pkgdesc="Cross GCC for the MinGW-w64 cross-compiler" +arch=('x86_64' 'aarch64') +url="https://gcc.gnu.org" +license=('GPL' 'LGPL' 'FDL' 'custom') +groups=('mingw-w64-toolchain' 'mingw-w64') +depends=('zlib' 'libisl' 'libmpc' 'mingw-w64-crt' 'mingw-w64-binutils' 'mingw-w64-winpthreads' 'mingw-w64-headers') +options=('!strip' 'staticlibs' '!emptydirs' '!buildflags') +source=(git+https://gitea.classfun.cn:4443/mirrors/gcc.git) +sha512sums=('SKIP') + +_architectures="i686-w64-mingw32 x86_64-w64-mingw32 aarch64-w64-mingw32" +get_latest() { + cd "$srcdir/gcc" + git tag | grep -E '^releases/gcc-[0-9]+\.[0-9]+\.[0-9]+$' | sort --version-sort | tail -n1 +} + +pkgver() { + get_latest | sed 's,^releases/gcc-,,' +} + +prepare() { + cd "$srcdir/gcc" + git checkout "$(get_latest)" + + # mmapio.c:69:14: error: implicit declaration of function ‘getpagesize’ + sed -i 's|\-Werror||g' libbacktrace/configure +} + +build() { + for _arch in ${_architectures}; do + mkdir -p "$srcdir"/build-${_arch} && cd "$srcdir"/build-${_arch} + "$srcdir"/gcc/configure --prefix=/usr --libexecdir=/usr/lib \ + --target=${_arch} \ + --with-bugurl=https://gitea.classfun.cn:4443/ \ + --enable-languages=c,c++,fortran,lto,objc,obj-c++ \ + --enable-shared \ + --enable-static \ + --enable-threads=posix \ + --enable-fully-dynamic-string \ + --enable-libstdcxx-time=yes \ + --enable-libstdcxx-filesystem-ts=yes \ + --with-system-zlib \ + --enable-cloog-backend=isl \ + --enable-lto \ + --enable-libgomp \ + --disable-multilib \ + --enable-checking=release \ + --disable-sjlj-exceptions \ + --with-dwarf2 + make + done +} + +package() { + for _arch in ${_architectures}; do + cd "$srcdir"/build-${_arch} + make DESTDIR="$pkgdir" install + ${_arch}-strip "$pkgdir"/usr/${_arch}/lib/*.dll + strip "$pkgdir"/usr/bin/${_arch}-* + strip "$pkgdir"/usr/lib/gcc/${_arch}/${pkgver}/{cc1*,collect2,gnat1,f951,lto*} + ln -s ${_arch}-gcc "$pkgdir"/usr/bin/${_arch}-cc + # mv dlls + mkdir -p "$pkgdir"/usr/${_arch}/bin/ + mv "$pkgdir"/usr/${_arch}/lib/*.dll "$pkgdir"/usr/${_arch}/bin/ + done + strip "$pkgdir"/usr/bin/* + # remove unnecessary files + rm -r "$pkgdir"/usr/share + rm "$pkgdir"/usr/lib/libcc1.* +}