Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
Add overrides.
Browse files Browse the repository at this point in the history
  • Loading branch information
jedavies-dev committed Sep 4, 2020
1 parent 63aa7d9 commit 58895b2
Show file tree
Hide file tree
Showing 49 changed files with 611 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/community
2 changes: 1 addition & 1 deletion modules/repo
11 changes: 11 additions & 0 deletions overrides/coreutils/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -e

patch -p0 < ls.patch

export CFLAGS="$CFLAGS -static"

./configure \
--prefix=/usr

make
make DESTDIR="$1" install
2 changes: 2 additions & 0 deletions overrides/coreutils/checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa coreutils-8.32.tar.xz
b333ebef4bce552c6666c88e2a7507ce73d2cef24b7583625db7c933a4e3556e ls.patch
84 changes: 84 additions & 0 deletions overrides/coreutils/patches/ls.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
diff --git src/ls.c src/ls.c
index 24b983287..4acf5f44d 100644
--- src/ls.c
+++ src/ls.c
@@ -49,10 +49,6 @@
# include <sys/ptem.h>
#endif

-#ifdef __linux__
-# include <sys/syscall.h>
-#endif
-
#include <stdio.h>
#include <assert.h>
#include <setjmp.h>
@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
struct dirent *next;
uintmax_t total_blocks = 0;
static bool first = true;
- bool found_any_entries = false;

errno = 0;
dirp = opendir (name);
@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
next = readdir (dirp);
if (next)
{
- found_any_entries = true;
if (! file_ignored (next->d_name))
{
enum filetype type = unknown;
@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
if (errno != EOVERFLOW)
break;
}
-#ifdef __linux__
- else if (! found_any_entries)
- {
- /* If readdir finds no directory entries at all, not even "." or
- "..", then double check that the directory exists. */
- if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1
- && errno != EINVAL)
- {
- /* We exclude EINVAL as that pertains to buffer handling,
- and we've passed NULL as the buffer for simplicity.
- ENOENT is returned if appropriate before buffer handling. */
- file_failure (command_line_arg, _("reading directory %s"), name);
- }
- break;
- }
-#endif
else
break;

diff --git tests/ls/removed-directory.sh tests/ls/removed-directory.sh
index e8c835dab..fe8f929a1 100755
--- tests/ls/removed-directory.sh
+++ tests/ls/removed-directory.sh
@@ -26,20 +26,14 @@ case $host_triplet in
*) skip_ 'non linux kernel' ;;
esac

-LS_FAILURE=2
-
-cat <<\EOF >exp-err || framework_failure_
-ls: reading directory '.': No such file or directory
-EOF
-
cwd=$(pwd)
mkdir d || framework_failure_
cd d || framework_failure_
rmdir ../d || framework_failure_

-returns_ $LS_FAILURE ls >../out 2>../err || fail=1
+ls >../out 2>../err || fail=1
cd "$cwd" || framework_failure_
compare /dev/null out || fail=1
-compare exp-err err || fail=1
+compare /dev/null err || fail=1

Exit $fail
--
2.24.0.375.geb5ae68d41

2 changes: 2 additions & 0 deletions overrides/coreutils/sources
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://ftp.gnu.org/gnu/coreutils/coreutils-8.32.tar.xz
patches/ls.patch
1 change: 1 addition & 0 deletions overrides/coreutils/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.32 1
95 changes: 95 additions & 0 deletions overrides/firefox/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
#!/bin/sh -e

# Down to one patch!!!! (Thank you to Michael Forney).
patch -p1 < no-dbus.patch

# Build autoconf 2.13 for Firefox's sole use.
# See: https://bugzilla.mozilla.org/show_bug.cgi?id=104642
(
cd autoconf2.13

./configure \
--prefix="$PWD/../junk" \
--program-suffix=-2.13

make
make install
)

# Build yasm for Firefox's sole use.
# Firefox is the only package which needs it
# and upstream is kinda dead.
(
cd yasm

./configure \
--prefix="$PWD/../junk"

make
make install
)
export PATH="$PWD/junk/bin:$PATH"

mkdir -p build
cd build

# Bypass 'ccache' as it's totally useless when building
# Firefox and only slows things down.
export CC="${CC:-/usr/bin/gcc}"
export CXX="${CXX:-/usr/bin/g++}"

export LDFLAGS="$LDFLAGS -Wl,-rpath=/usr/lib/firefox"
export RUSTFLAGS="$RUSTFLAGS -Cdebuginfo=0"
export MOZ_DEBUG_FLAGS=-g0
export MOZ_NOSPAM=1
export CPLUS_INCLUDE_PATH=/usr/include/c++/10.1.0:/usr/include/c++/10.1.0/aarch64-linux-musl

../configure \
--prefix=/usr \
--libdir=/usr/lib \
--enable-official-branding \
--enable-optimize="$CFLAGS -w" \
--enable-install-strip \
--enable-strip \
--enable-rust-simd \
--enable-application=browser \
--enable-release \
--enable-alsa \
--without-system-nspr \
--without-system-nss \
--with-system-jpeg \
--with-system-zlib \
--with-system-png \
--with-system-libvpx \
--with-system-pixman \
--with-system-ffi \
--disable-profiling \
--disable-accessibility \
--disable-tests \
--disable-system-extension-dirs \
--disable-parental-controls \
--disable-debug-symbols \
--disable-callgrind \
--disable-vtune \
--disable-gold \
--disable-jemalloc \
--disable-pulseaudio \
--disable-crashreporter \
--disable-updater \
--disable-dbus \
--disable-tests \
--disable-necko-wifi

make
make DESTDIR="$1" install

# Remove a lot of uneeded "stuff".
rm -rf "$1/usr/include"
rm -rf "$1/usr/lib/firefox-devel"
rm -rf "$1/usr/share/idl"
rm -rf "$1/usr/lib/firefox/gtk2" # Drop GTK+2 runtime dependency.
rm -f "$1/usr/lib/firefox/browser/features/fxmonitor@mozilla.org.xpi"
rm -f "$1/usr/lib/firefox/browser/features/screenshots@mozilla.org.xpi"
rm -f "$1/usr/lib/firefox/browser/features/webcompat-reporter@mozilla.org.xpi"
rm -f "$1/usr/lib/firefox/browser/features/webcompat@mozilla.org.xpi"
rm -f "$1/usr/lib/firefox/browser/features/doh-rollout@mozilla.org.xpi"
1 change: 1 addition & 0 deletions overrides/firefox/checksums
1 change: 1 addition & 0 deletions overrides/firefox/depends
1 change: 1 addition & 0 deletions overrides/firefox/post-install
1 change: 1 addition & 0 deletions overrides/firefox/sources
1 change: 1 addition & 0 deletions overrides/firefox/version
53 changes: 53 additions & 0 deletions overrides/go/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh -e

# Disable stripping of binaries.
# This breaks Go.
:> nostrip

export GOARCH=arm64
export GO_LDFLAGS="-w -s"
export GOROOT_FINAL=/usr/lib/go

if [ -f "$KISS_ROOT/var/db/kiss/go/manifest" ]; then
export GOROOT_BOOTSTRAP=/usr/lib/go
else
export GOROOT_BOOTSTRAP=$PWD
fi

export GOROOT=$PWD/go-current

(
cd "$GOROOT/src"
bash make.bash --no-clean -v
)

cd "$GOROOT"

mkdir -p "$1/usr/bin" "$1/usr/lib/go/bin"

install -m755 "bin/go" "$1/usr/lib/go/bin/go"
install -m755 "bin/gofmt" "$1/usr/lib/go/bin/gofmt"

ln -s "/usr/lib/go/bin/go" "$1/usr/bin"
ln -s "/usr/lib/go/bin/gofmt" "$1/usr/bin"

cp -a misc pkg src lib "$1/usr/lib/go"

# Remove unneeded files.
rm -f "$1/usr/share/go/doc/articles/wiki/get.bin"
rm -f "$1/usr/lib/go/pkg/tool/"*/api
rm -rf "$1/usr/lib/go/pkg/bootstrap"
rm -rf "$1/usr/lib/go/pkg/obj"

cd "$1/usr/lib/go/src"

# Remove tests.
find . -type f -a -name \*_test.go -delete
find . -type f -a -name \*.bash -delete
find . -type f -a -name \*.bat -delete
find . -type f -a -name \*.rc -delete

find . -type d -a -name testdata |
while read -r dir; do
rm -rf "$dir"
done
2 changes: 2 additions & 0 deletions overrides/go/checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
69438f7ed4f532154ffaf878f3dfd83747e7a00b70b3556eddabf7aaee28ac3a
b012d08c7ecfd1900e012150861771bd626349d7bf223e1e5d4f2b7adbf1b5cd
1 change: 1 addition & 0 deletions overrides/go/depends
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bash make
2 changes: 2 additions & 0 deletions overrides/go/sources
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://golang.org/dl/go1.15.src.tar.gz go-current
https://github.com/jedavies-dev/kiss-aarch64/releases/download/0.1.2/go-aarch64-linux-musl-bootstrap-1.14.tar.xz
1 change: 1 addition & 0 deletions overrides/go/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.14.1 1
11 changes: 11 additions & 0 deletions overrides/libexif/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -e

cp /usr/share/automake-1.16/config.guess .

./configure \
--prefix=/usr \
--disable-nls \
ac_cv_path_DOXYGEN=false

make
make DESTDIR="$1" install
1 change: 1 addition & 0 deletions overrides/libexif/checksums
1 change: 1 addition & 0 deletions overrides/libexif/sources
1 change: 1 addition & 0 deletions overrides/libexif/version
24 changes: 24 additions & 0 deletions overrides/libvpx/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh -e

patch -p1 < fix-busybox-diff.patch

./configure \
--prefix=/usr \
--enable-vp8 \
--enable-vp9 \
--enable-experimental \
--enable-runtime-cpu-detect \
--enable-shared \
--enable-postproc \
--enable-pic \
--disable-tools \
--disable-examples \
--disable-docs \
--disable-unit-tests \
--disable-install-docs \
--disable-install-srcs \
--disable-install-bins \
--as=nasm

make
make DESTDIR="$1" install
2 changes: 2 additions & 0 deletions overrides/libvpx/checksums
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
d279c10e4b9316bf11a570ba16c3d55791e1ad6faa4404c67422eb631782c80a
ce802d64bcbeb4230527aea2b4284d9844fb12fa5aca868a94e03982f85ec45b
1 change: 1 addition & 0 deletions overrides/libvpx/depends
1 change: 1 addition & 0 deletions overrides/libvpx/patches
2 changes: 2 additions & 0 deletions overrides/libvpx/sources
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz
patches/fix-busybox-diff.patch
1 change: 1 addition & 0 deletions overrides/libvpx/version
47 changes: 47 additions & 0 deletions overrides/mesa/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/sh -e

# Install python-mako which is solely needed for mesa
# and thus contained in this build.
{
cd mako

python3 setup.py build
python3 setup.py install \
--prefix=/usr \
--root="$PWD/dist"

# Use a glob to avoid having to figure out the Python
# version for the path below.
cd dist/usr/lib/python*/site-packages

# Set the PYTHONPATH so python knows where to find mako.
# The one liner simply appends the existing path and
# handles the case where an unset PYTHONPATH breaks
# python as it will only contain our new addition.
PYTHONPATH=$PWD:$(python -c "import sys; print(':'.join(sys.path))")

cd -; cd ..
}

export PYTHONPATH
export DESTDIR="$1"
export CFLAGS="-DGLX_X86_READONLY_TEXT $CFLAGS -fcommon"

# Fix issues with musl and firefox.
# https://bugs.freedesktop.org/show_bug.cgi?id=35268
# https://github.com/mesa3d/mesa/commit/9f37c9903b87f86a533bfaffa72f0ecb285b02b2
sed -i "/pre_args += '-DUSE_ELF_TLS'/d" meson.build

meson \
--prefix=/usr \
--sysconfdir=/etc \
--includedir=/usr/include \
--mandir=/usr/share/man \
--localstatedir=/var \
--buildtype=release \
-Dplatforms=x11,drm \
-Dgallium-drivers=panfrost,kmsro \
. output

ninja -C output
ninja -C output install
1 change: 1 addition & 0 deletions overrides/mesa/checksums
Loading

0 comments on commit 58895b2

Please sign in to comment.