Topic: [Collection] Compilation of packages and ports (not in repositories)
Hello together,
within this thread we want to collect PKGBUILDs for components and more never getting into the repositories for obvious reasoning: They cannot be part of our future HyperbolaBSD, but nevertheless they can be also helpful on other ways like motivation to learn more about packaging.
There are the following rules to respect when sharing packaging-scripts!
Use only free and libre software, no software using non-free parts or services
Respect the FSDG-requirements so please do no use for example vague terms like "open-source" in the description
Respect the previous maintainers and contributors, adding also yourself correct within
Use only source-based projects and software, no binaries allowed
Name the licenses correct, no generics allowed alike GPL, look therefore under /usr/share/liceses/common/ and read the license of the software you want to build and package
For the beginning here is libstdc++5, not finally tested under chroot, so I will look after it later on again.
PKGBUILD
# Maintainer (Arch): JustKidding <jk@vin.ovh>
# Contributor (Arch): Jan de Groot <jgc@archlinux.org>
# Maintainer: Tobias Dausend <throgh@hyperbola.info>
pkgname=libstdc++5
pkgver=3.3.6
pkgrel=1
pkgdesc="GNU Standard C++ library version 3"
arch=('i686' 'x86_64')
url='https://gcc.gnu.org'
license=('GPL-2' 'LGPL-2.1')
depends=('gcc-libs')
makedepends=('gcc' 'binutils' 'bash')
options=('!makeflags')
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-{core,g++}-${pkgver}.tar.bz2
gcc-3.4.3-no_multilib_amd64.patch
gcc-3.4.6-ucontext.patch
siginfo.patch)
sha512sums=('6a68d5b293f4a2cca28b6443de88189b704e5b5fd80b50c3ac3ee5679b6fac2cb915a9744a82cdce0bc4b69609ab1a285cddd9a0021e127f9625f1be18bdffd8'
'41d828f32e8acf38e14bc84930d453a01aaa54d26f8cd1f5959b2a27cef4c3b208acc3a9b0b56404f6f65f0771357dc8b5e42e4b4ab0589b45681ec7a48f620f'
'27681d69284628717f9cfad3615e5653b9c7ddbde3c3ed78bf015083409f1852e1275cd9a33511de4a23f9daced3d79797bd81d6b8c95647760c420d23d43154'
'f9eab82e2297c25d13181857ee5994e4f3ecb59598d0183e09a7be005769a2427c2b1006b1f96391afe7fc461bb598eb5ead71e9eca5d0482ee870855b8cca56'
'9e69a80a9e3f154ef3ba97777a1218fabfa402466d3b1ca4c38cf931739860d8dc5d58089fa3cf1300465f46984bd6efaf56651f0264710fec44d3dbbfd8bb71')
prepare() {
cd gcc-$pkgver
patch -Np1 -i $srcdir/gcc-3.4.3-no_multilib_amd64.patch
# fix build issue with recent gcc
sed -i "s#O_CREAT#O_CREAT, 0666#" gcc/collect2.c
# No fixincludes
sed -e 's@\./fixinc\.sh@-c true@' \
-e '# Clean up some warnings that arent our business' \
-e 's:-Wstrict-prototypes::g' \
-e 's:-Wtraditional::g' \
-e 's:-pedantic::g' \
-e 's:-Wall::g' \
-i 'gcc/Makefile.in'
sed -e 's:-Wall -Wtraditional -pedantic::g' -i 'libiberty/configure'
# Patches are the wrong way to do this
sed -e '# gcc-3.4.6-ucontext.patch' \
-e 's:\bstruct ucontext\b:ucontext_t:g' \
-e '# siginfo.patch' \
-e 's:\bstruct siginfo\b:siginfo_t:g' \
-i $(grep --include 'linux*.h' -lrFe $'struct ucontext\nstruct siginfo' gcc/config/)
mkdir ../gcc-build
}
build(){
export CFLAGS="-march=${CARCH/_/-} -O2"
export CXXFLAGS="-march=${CARCH/_/-} -O2"
export SHELL='/bin/bash' # doesn't work with fish
unset CPPFLAGS
cd gcc-build
CPP=/usr/bin/cpp ../gcc-${pkgver}/configure --prefix=/usr --enable-shared \
--enable-languages=c++ --enable-threads=posix --enable-__cxa_atexit \
--disable-multilib --libdir=/usr/lib
make all-target-libstdc++-v3 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" -j$(nproc)
}
package() {
cd gcc-build
make DESTDIR="${pkgdir}" install-target-libstdc++-v3
# Remove includefiles and libs provided by gcc
rm -rf "${pkgdir}"/usr/{include,share/locale}
rm -f "${pkgdir}"/usr/lib/*.a
rm -f "${pkgdir}"/usr/lib/libstdc++.so
# Add licenses
install -Dm644 "${srcdir}/gcc-$pkgver"/COPYING{,.LIB} -t "${pkgdir}"/usr/share/licenses/$pkgname
}
gcc-3.4.3-no_multilib_amd64.patch
--- gcc-3.4.3/gcc/config/i386/t-linux64
+++ gcc-3.4.3/gcc/config/i386/t-linux64
@@ -6,7 +6,7 @@
MULTILIB_OPTIONS = m64/m32
MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64 ../lib
+MULTILIB_OSDIRNAMES = . ../lib
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
gcc-3.4.6-ucontext.patch
--- gcc-3.4.6/gcc/config/i386/linux64.h
+++ gcc-3.4.6/gcc/config/i386/linux64.h
@@ -90,7 +90,7 @@
if (*(unsigned char *)(pc_+0) == 0x48 \
&& *(unsigned long *)(pc_+1) == 0x050f0000000fc0c7) \
{ \
- struct ucontext *uc_ = (CONTEXT)->cfa; \
+ ucontext_t *uc_ = (CONTEXT)->cfa; \
sc_ = (struct sigcontext *) &uc_->uc_mcontext; \
} \
else \
@@ -160,7 +160,7 @@
struct siginfo *pinfo; \
void *puc; \
struct siginfo info; \
- struct ucontext uc; \
+ ucontext_t uc; \
} *rt_ = (CONTEXT)->cfa; \
sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \
} \
siginfo.patch
--- gcc/config/i386/linux.h.orig 2014-04-28 10:00:16.556121683 +0000
+++ gcc/config/i386/linux.h 2014-04-28 10:00:43.105959247 +0000
@@ -257,9 +257,9 @@
{ \
struct rt_sigframe { \
int sig; \
- struct siginfo *pinfo; \
+ siginfo_t *pinfo; \
void *puc; \
- struct siginfo info; \
+ siginfo_t info; \
struct ucontext uc; \
} *rt_ = (CONTEXT)->cfa; \
sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext; \
To underline again: Those packages will never get any kind of commit as they depend fully on GNU/Linux and will only run within that.
Please do NOT debate on or off for packages as this thread is not meant to debate and discuss, Same for wishing packages: This is not the intention of this thread and therefore all postings should contain a package-script.
Certainly anyone who has the power to make you believe absurdities has the power to make you commit injustices: For a life of every being full with peace and kindness, including diversity and freedom. Capitalism is destroying our minds, the planet itself and the universe in the end!