summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-04-07 07:46:06 +0200
committerAndreas Grapentin <andreas@grapentin.org>2018-04-07 07:46:06 +0200
commit689345dd55e0ff2336910c084ebf230cf111825c (patch)
tree68feb7f0ba3a773fef5293d6d14e497a74a8359b
parenta89111ad91782cad8792417e0e70e03448af0d06 (diff)
progress into stage4
-rwxr-xr-xcreate.sh1
-rw-r--r--deptreecycle.py27
-rw-r--r--src/blacklist.txt26
-rw-r--r--src/shared/checks.sh20
-rw-r--r--src/shared/deptree.sh12
-rw-r--r--src/shared/feedback.sh6
-rw-r--r--src/shared/package.sh53
-rw-r--r--src/shared/upstream.sh2
-rwxr-xr-xsrc/stage1/stage1.sh2
-rwxr-xr-xsrc/stage2/stage2.sh17
-rw-r--r--src/stage3/patches/binutils.patch20
-rw-r--r--src/stage3/patches/cairo.patch11
-rw-r--r--src/stage3/patches/flex.patch10
-rw-r--r--src/stage3/patches/gc.patch9
-rw-r--r--src/stage3/patches/gobject-introspection.patch (renamed from src/stage3/patches/gobject-introspection-runtime.patch)0
-rw-r--r--src/stage3/patches/kbd.patch6
-rw-r--r--src/stage3/patches/lapack.patch2
-rw-r--r--src/stage3/patches/libatomic_ops.patch10
-rw-r--r--src/stage3/patches/libtool.patch11
-rw-r--r--src/stage3/patches/lvm2.patch (renamed from src/stage3/patches/device-mapper.patch)0
-rw-r--r--src/stage3/patches/shadow.patch11
-rw-r--r--src/stage3/patches/systemd.patch2
-rwxr-xr-xsrc/stage3/stage3.sh37
-rw-r--r--src/stage4/chroot.sh6
-rw-r--r--src/stage4/makepkg.sh5
-rw-r--r--src/stage4/patches/aspell.patch23
-rw-r--r--src/stage4/patches/btrfs-progs.patch46
-rw-r--r--src/stage4/patches/cairo.patch11
-rw-r--r--src/stage4/patches/clisp.patch23
-rw-r--r--src/stage4/patches/cups.patch12
-rw-r--r--src/stage4/patches/dhcp.patch43
-rw-r--r--src/stage4/patches/doxygen-breakdeps.patch36
-rw-r--r--src/stage4/patches/fftw.patch29
-rw-r--r--src/stage4/patches/fontconfig-breakdeps.patch14
-rw-r--r--src/stage4/patches/freetype2-breakdeps.patch12
-rw-r--r--src/stage4/patches/gc.patch14
-rw-r--r--src/stage4/patches/gcc.patch24
-rw-r--r--src/stage4/patches/gstreamer.patch11
-rw-r--r--src/stage4/patches/gypsy.patch12
-rw-r--r--src/stage4/patches/jemalloc.patch26
-rw-r--r--src/stage4/patches/js.patch54
-rw-r--r--src/stage4/patches/libaio.patch2
-rw-r--r--src/stage4/patches/libatomic_ops.patch15
-rw-r--r--src/stage4/patches/libbluray.patch21
-rw-r--r--src/stage4/patches/libevdev.patch12
-rw-r--r--src/stage4/patches/libfbclient.patch131
-rw-r--r--src/stage4/patches/libfontenc.patch11
-rw-r--r--src/stage4/patches/libid3tag.patch42
-rw-r--r--src/stage4/patches/libjpeg-turbo-breakdeps.patch19
-rw-r--r--src/stage4/patches/libjpeg-turbo.patch20
-rw-r--r--src/stage4/patches/libtiff-breakdeps.patch13
-rw-r--r--src/stage4/patches/linux-libre.patch15
-rw-r--r--src/stage4/patches/lynx.patch10
-rw-r--r--src/stage4/patches/mariadb.patch12
-rw-r--r--src/stage4/patches/neon.patch14
-rw-r--r--src/stage4/patches/nspr.patch157
-rw-r--r--src/stage4/patches/nss.patch56
-rw-r--r--src/stage4/patches/openexr.patch27
-rw-r--r--src/stage4/patches/openssl-1.0.patch19
-rw-r--r--src/stage4/patches/orc.patch11
-rw-r--r--src/stage4/patches/pyqt5.patch27
-rw-r--r--src/stage4/patches/python-lxml.patch12
-rw-r--r--src/stage4/patches/python-numpy.patch24
-rw-r--r--src/stage4/patches/r.patch12
-rw-r--r--src/stage4/patches/sqlite.patch11
-rw-r--r--src/stage4/patches/subversion.patch43
-rw-r--r--src/stage4/patches/systemd.patch353
-rw-r--r--src/stage4/patches/vala-breakdeps.patch52
-rw-r--r--src/stage4/patches/vid.stab.patch12
-rw-r--r--src/stage4/patches/vulkan-loader-layers.patch18
-rw-r--r--src/stage4/patches/webrtc-audio-processing.patch40
-rw-r--r--src/stage4/patches/zstd.patch10
-rw-r--r--src/stage4/stage4.sh102
73 files changed, 1529 insertions, 490 deletions
diff --git a/create.sh b/create.sh
index 6da1887..ba47da5 100755
--- a/create.sh
+++ b/create.sh
@@ -39,7 +39,6 @@ mkdir -p "$TOPBUILDDIR" "$SRCDEST"
chown "$SUDO_USER" "$TOPBUILDDIR"
# options
-export KEEP_GOING=${KEEP_GOING:-no}
export REGEN_CONFIG_FRAGMENTS=${REGEN_CONFIG_FRAGMENTS:-yes}
# shellcheck source=src/shared/common.sh
diff --git a/deptreecycle.py b/deptreecycle.py
new file mode 100644
index 0000000..baf3a74
--- /dev/null
+++ b/deptreecycle.py
@@ -0,0 +1,27 @@
+
+import sys
+import networkx as nx
+import itertools
+
+graph = nx.DiGraph()
+
+with open(sys.argv[1]) as deptree:
+ for line in deptree:
+ line = line.split('#')[0]
+ lhs, rhs = line.split(':')
+ lhs = lhs.strip()
+ rhs = rhs.lstrip(' [').rstrip('] ')
+ graph.add_node(lhs)
+ for dep in rhs.split():
+ if not dep in graph:
+ graph.add_node(dep)
+ graph.add_edge(lhs, dep)
+
+print("deptree with %d nodes & %d edges" % (graph.number_of_nodes(), graph.number_of_edges()))
+print("")
+
+print("cycles:")
+cycles=nx.simple_cycles(graph)
+for cycle in itertools.islice(cycles, 10):
+ print(cycle)
+print("")
diff --git a/src/blacklist.txt b/src/blacklist.txt
new file mode 100644
index 0000000..6845724
--- /dev/null
+++ b/src/blacklist.txt
@@ -0,0 +1,26 @@
+apache-ant:depends on java-environment
+clisp:no port exists
+ffcall:no port exists
+gdb:no port exists
+gcc-ada:bootstrap needed
+gcc-go:libffi patch needed
+gcc-objc:libffi patch needed
+gcc-objc++:libffi patch needed
+go:bootstrap needed
+jdk7-openjdk:build broken
+jre7-openjdk:build broken
+jre7-openjdk-headless:build broken
+jdk8-openjdk:build broken
+jre8-openjdk:build broken
+jre8-openjdk-headless:build broken
+jdk9-openjdk:build broken
+jre9-openjdk:build broken
+jre9-openjdk-headless:build broken
+lib32-gcc-libs:no multilib
+lib32-glibc:no multilib
+libreoffice-fresh:depends on java-environment
+libreoffice-still:depends on java-environment
+maven:depends on java-environment (and is a pita)
+rust:bootstrap needed
+unoconv:depends on libreoffice-fresh
+valgrind:no port exists
diff --git a/src/shared/checks.sh b/src/shared/checks.sh
index 57bb646..5d369c3 100644
--- a/src/shared/checks.sh
+++ b/src/shared/checks.sh
@@ -100,26 +100,28 @@ check_gpgkey() {
}
check_pkgfile() {
- local OPTIND o r=
- while getopts "r" o; do
+ local OPTIND o r=no p=''
+ while getopts "p:r" o; do
case "$o" in
r) r=yes ;;
- *) die -e "$ERROR_INVOCATION" "Usage: ${FUNCNAME[0]} [-r] key" ;;
+ p) p="-$OPTARG" ;;
+ *) die -e "$ERROR_INVOCATION" "Usage: ${FUNCNAME[0]} [-r] [-p string] key" ;;
esac
done
shift $((OPTIND-1))
echo -n "checking for built package $2 ... "
- local pkgfile have_pkgfile=yes
- pkgfile=$(find "$1" -regex "^.*/$2-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$")
+ local esc pkgfile have_pkgfile=yes
+ esc=$(printf '%s\n' "$2" | sed 's:[][\/.^$*]:\\&:g')
+ pkgfile=$(find "$1" -regex "^.*/$esc$p-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$")
[ -n "$pkgfile" ] || have_pkgfile=no
echo $have_pkgfile
- if [ "x$have_pkgfile" != "xyes" ]; then
- [ "x$r" == "xyes" ] && die -e "$ERROR_MISSING" "missing package $2 in $1"
- return "$ERROR_MISSING"
- fi
+ [ "x$have_pkgfile" == "xyes" ] && return
+
+ [ "x$r" == "xyes" ] && die -e "$ERROR_MISSING" "missing package $2 in $1"
+ return "$ERROR_MISSING"
}
check_repo() {
diff --git a/src/shared/deptree.sh b/src/shared/deptree.sh
index 77603fb..ad59bb5 100644
--- a/src/shared/deptree.sh
+++ b/src/shared/deptree.sh
@@ -83,12 +83,22 @@ deptree_check_depend() {
local r
r=$(make_realpkg "$1") || return
+
+ local blacklist
+ blacklist=$(grep "^$r:" "$TOPSRCDIR"/blacklist.txt)
+
+ if [ -n "$blacklist" ]; then
+ error -n "$pkg: bad dependency $r: $(cut -d':' -f2 <<< "$blacklist")"
+ return "$ERROR_MISSING"
+ fi
+
deptree_add_entry "$r" "$pkg"
local have_pkg=no
local path
for path in "${DEPPATH[@]}"; do
- check_pkgfile "$path" "$r" && have_pkg=yes
+ check_pkgfile "$path" "$r" && { have_pkg=yes; break; }
+ check_pkgfile -p "breakdeps" "$path" "$r" && { have_pkg=yes; break; }
done
if [ "x$needed" == "xyes" ] && [ "x$have_pkg" == "xno" ]; then
diff --git a/src/shared/feedback.sh b/src/shared/feedback.sh
index 340cd49..708bfdf 100644
--- a/src/shared/feedback.sh
+++ b/src/shared/feedback.sh
@@ -46,7 +46,7 @@ msg() {
done
shift $((OPTIND-1))
- [ "x$n" == "xyes" ] && notify "${d[@]}" "$*"
+ [ "x$n" == "xyes" ] && notify "${d[@]}" "${@//_/\\_}"
echo "$(tput bold)$(tput setf 2)==>$(tput setf 7) $*$(tput sgr0)";
}
@@ -61,7 +61,7 @@ error() {
done
shift $((OPTIND-1))
- [ "x$n" == "xyes" ] && notify -c error "${d[@]}" "$*"
+ [ "x$n" == "xyes" ] && notify -c error "${d[@]}" "${@//_/\\_}"
echo "$(tput bold)$(tput setf 4)==> ERROR:$(tput setf 7) $*$(tput sgr0)" 1>&2
}
@@ -76,7 +76,7 @@ die() {
done
shift $((OPTIND-1))
- error -n "${d[@]}" "$*"
+ error -n "${d[@]}" "$@"
trap - ERR
exit "$e"
}
diff --git a/src/shared/package.sh b/src/shared/package.sh
index 604793c..febfce5 100644
--- a/src/shared/package.sh
+++ b/src/shared/package.sh
@@ -35,8 +35,8 @@ package_build() {
popd >/dev/null || return
if [ "$res" -ne 0 ]; then
- notify -c error "$pkgname" -h string:document:"$MAKEPKGDIR/$pkgname/.MAKEPKGLOG"
- if [ "x$KEEP_GOING" == "xyes" ]; then
+ notify -c error "${pkgname//_/\\_}" -h string:document:"$MAKEPKGDIR/$pkgname/.MAKEPKGLOG"
+ if [ -f "$TOPBUILDDIR/.KEEP_GOING" ]; then
sed -i "s/^$pkgname : \\[/& FIXME/" "$DEPTREE"
else
return "$res"
@@ -52,7 +52,7 @@ package_build() {
local full curr
full=$(wc -l < "$DEPTREE".FULL)
curr=$((full - $(wc -l < "$DEPTREE")))
- notify -c success -u low "*$curr/$full* $pkgname"
+ notify -c success -u low "*$curr/$full* ${pkgname//_/\\_}"
}
packages_build_all() {
@@ -88,9 +88,15 @@ package_reuse_upstream() {
pkgfiles=( "$1"-*.pkg.tar.xz ); pkgfile="${pkgfiles[0]}"
mkdir -p "$pkgdir"
bsdtar -C "$pkgdir" -xf "$pkgfile" || return
+ rm "$pkgdir"/.{MTREE,BUILDINFO}
sed -i "s/arch = .*/arch = $CARCH/" "$pkgdir"/.PKGINFO
pushd "$pkgdir" >/dev/null || return
- env LANG=C bsdtar -cf - .MTREE .PKGINFO .BUILDINFO ./* | xz -c -z - > \
+ # shellcheck disable=SC2035
+ env LANG=C bsdtar -vczf .MTREE --format=mtree \
+ --options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
+ .PKGINFO *
+ # shellcheck disable=SC2035
+ env LANG=C bsdtar -vcf - .MTREE .PKGINFO * | xz -c -z - > \
"$PKGDEST/${pkgfile%-*}-$CARCH.pkg.tar.xz" || return
popd >/dev/null || return
;;
@@ -104,6 +110,23 @@ package_enable_arch() {
rm -f .SRCINFO
}
+package_has_patch() {
+ local OPTIND o p=''
+ while getopts "p:" o; do
+ case "$o" in
+ p) p="-$OPTARG" ;;
+ *) die -e "$ERROR_INVOCATION" "Usage: ${FUNCNAME[0]} [-p prefix] pkgname" ;;
+ esac
+ done
+ shift $((OPTIND-1))
+
+ local pkgbase
+ pkgbase=$(srcinfo_pkgbase) || return
+
+ local patch="$SRCDIR/patches/$pkgbase$p".patch
+ [ -f "$patch" ] || return "$ERROR_MISSING"
+}
+
package_patch() {
local OPTIND o p='' r=no
while getopts "p:r" o; do
@@ -119,18 +142,22 @@ package_patch() {
pkgbase=$(srcinfo_pkgbase) || return
local patch="$SRCDIR/patches/$pkgbase$p".patch
+ local badpatch="$SRCDIR/patches/$pkgname$p".patch
- # FIXME: this is temporary to fix bad patch names
- local badpatch="$SRCDIR/patches/$pkgname".patch
- if [ "x$pkgname" != "x$pkgbase" ] && [ -f "$badpatch" ]; then
- error -n "$pkgname: $pkgname.patch should be $pkgbase.patch. renaming..."
- mv "$badpatch" "$patch"
- fi
+ ln -s "$patch" .PATCH
- if [ "x$r" == "xyes" ] && [ ! -e "$patch" ]; then
- error -n "$pkgname: missing $pkgbase$p.patch"
- return "$ERROR_MISSING"
+ echo -n "checking for $(basename "$patch") ... "
+ local have_patch=yes
+ if [ ! -f "$patch" ]; then
+ have_patch=no
+ if [ -f "$badpatch" ]; then
+ have_patch="$(basename "$badpatch") (renaming...)"
+ mv "$badpatch" "$patch" || return
+ fi
fi
+ echo "$have_patch (needed: $r)"
+
+ [ "x$r" == "xyes" ] && [ ! -e "$patch" ] && return "$ERROR_MISSING"
cp PKGBUILD{,.orig}
[ ! -e "$patch" ] || patch -Np1 -i "$patch" || return
diff --git a/src/shared/upstream.sh b/src/shared/upstream.sh
index ff4552d..69d05b1 100644
--- a/src/shared/upstream.sh
+++ b/src/shared/upstream.sh
@@ -20,7 +20,7 @@
package_get_upstream_repo() {
local repo repoinfo
- repoinfo=$(asp list-repos "$1") || repoinfo=""
+ repoinfo=$(asp list-repos "$1" 2>/dev/null) || repoinfo=""
repo=$(grep -P '^(core|extra|community)' <<< "$repoinfo" | head -n1)
[ -z "$repo" ] && repo=libre
echo "$repo"
diff --git a/src/stage1/stage1.sh b/src/stage1/stage1.sh
index 81ea904..dbc98ea 100755
--- a/src/stage1/stage1.sh
+++ b/src/stage1/stage1.sh
@@ -105,7 +105,7 @@ EOF
popd >/dev/null || return
if [ "$res" -ne 0 ]; then
- notify -c error "$CHOST-$pkg" -h string:document:"$(readlink -f .MAKEPKGLOG)"
+ notify -c error "$CHOST-${pkg//_/\\_}" -h string:document:"$(readlink -f .MAKEPKGLOG)"
return "$res"
fi
diff --git a/src/stage2/stage2.sh b/src/stage2/stage2.sh
index 4231b85..18e1423 100755
--- a/src/stage2/stage2.sh
+++ b/src/stage2/stage2.sh
@@ -124,19 +124,18 @@ stage2() {
binfmt_disable
- prepare_stage2_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
- prepare_stage2_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
prepare_deptree "${groups[@]}" || die -e "$ERROR_BUILDFAIL" "failed to prepare DEPTREE"
-
echo "remaining pkges: $(wc -l < "$DEPTREE") / $(wc -l < "$DEPTREE".FULL)"
+ [ -s "$DEPTREE" ] || return 0
- if [ -s "$DEPTREE" ]; then
- # pull in various tools required to run the scripts or build the packages
- check_exe -r arch-meson asp awk bsdtar git gperf help2man pacman sed svn tar tclsh
+ prepare_stage2_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
+ prepare_stage2_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
- # build packages from deptree
- packages_build_all stage2_package_build stage2_package_install || return
- fi
+ # pull in various tools required to run the scripts or build the packages
+ check_exe -r arch-meson asp awk bsdtar git gperf help2man pacman sed svn tar tclsh
+
+ # build packages from deptree
+ packages_build_all stage2_package_build stage2_package_install || return
# cleanup
umount_stage2_chrootdir
diff --git a/src/stage3/patches/binutils.patch b/src/stage3/patches/binutils.patch
index 2453ef9..3a1e774 100644
--- a/src/stage3/patches/binutils.patch
+++ b/src/stage3/patches/binutils.patch
@@ -5,35 +5,45 @@
pkgname=binutils
-pkgver=2.29.1
--pkgrel=2
+-pkgrel=3
+pkgver=2.30
+pkgrel=1
pkgdesc='A set of programs to assemble and manipulate binary and object files'
arch=(x86_64)
url='http://www.gnu.org/software/binutils/'
-@@ -19,12 +19,10 @@ replaces=(binutils-multilib)
+@@ -19,16 +19,10 @@ replaces=(binutils-multilib)
options=(staticlibs !distcc !ccache)
#_commit=d1a6e7195b9bb0255fa77588985b969ad8aaacf5
#source=(git+https://sourceware.org/git/binutils-gdb.git#commit=${_commit}
-source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz{,.sig}
-- 0001-x86-64_Dont_pass_output_bfd_to_info-callbacks-minfo.patch)
+- 0001-x86-64_Dont_pass_output_bfd_to_info-callbacks-minfo.patch
+- 0001-PR22741-objcopy-segfault-on-fuzzed-COFF-object.patch
+- 0001-PR22829-objcopy-strip-removes-PT_GNU_RELRO-from-lld-.patch)
+source=(https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz{,.sig})
validpgpkeys=(3A24BC1E8FB409FA9F14371813FCEF89DD9E3C4F)
-md5sums=('acc9cd826edb9954ac7cecb81c727793'
- 'SKIP'
-- 'e4be936139ef46122cb3841881c432b2')
+- 'e4be936139ef46122cb3841881c432b2'
+- '469164f3c93a0e92a697537b60c9806c'
+- '0c679b37e90fb23de60a4d28329b956a')
+md5sums=('ffc476dd46c96f932875d1b2e27e929f'
+ 'SKIP')
prepare() {
mkdir -p binutils-build
-@@ -34,9 +32,6 @@ prepare() {
+@@ -38,15 +32,6 @@ prepare() {
# hack! - libiberty configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" libiberty/configure
-
- # https://bugs.archlinux.org/task/55741
- git apply ../0001-x86-64_Dont_pass_output_bfd_to_info-callbacks-minfo.patch
+-
+- # https://sourceware.org/bugzilla/show_bug.cgi?id=22741
+- git apply ../0001-PR22741-objcopy-segfault-on-fuzzed-COFF-object.patch
+-
+- # https://sourceware.org/bugzilla/show_bug.cgi?id=22829
+- git apply ../0001-PR22829-objcopy-strip-removes-PT_GNU_RELRO-from-lld-.patch
}
build() {
diff --git a/src/stage3/patches/cairo.patch b/src/stage3/patches/cairo.patch
new file mode 100644
index 0000000..5d5654c
--- /dev/null
+++ b/src/stage3/patches/cairo.patch
@@ -0,0 +1,11 @@
+--- PKGBUILD.orig 2018-04-02 18:35:03.092703531 +0200
++++ PKGBUILD.in 2018-04-02 18:36:57.962692644 +0200
+@@ -10,7 +10,7 @@ url="https://cairographics.org/"
+ arch=(x86_64)
+ license=(LGPL MPL)
+ depends=(libpng libxrender libxext fontconfig pixman glib2 lzo)
+-makedepends=(librsvg gtk2 poppler-glib libspectre gtk-doc valgrind git)
++makedepends=(librsvg gtk2 poppler-glib libspectre gtk-doc git)
+ _commit=1ed124ace201946177eab962d3b07bb2fedf9026 # master
+ source=("git+https://anongit.freedesktop.org/git/cairo#commit=$_commit"
+ utf-8.diff)
diff --git a/src/stage3/patches/flex.patch b/src/stage3/patches/flex.patch
deleted file mode 100644
index a24938a..0000000
--- a/src/stage3/patches/flex.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/PKGBUILD 2018-03-06 15:25:03.243977236 +0100
-+++ b/PKGBUILD 2018-03-06 15:31:41.098560457 +0100
-@@ -11,6 +11,6 @@ url="https://github.com/westes/flex"
- license=('custom')
- groups=('base-devel')
- depends=('glibc' 'm4' 'sh')
--makedepends=('help2man')
- source=("https://github.com/westes/flex/releases/download/v$pkgver/flex-$pkgver.tar.gz")
- md5sums=('2882e3179748cc9f9c23ec593d6adc8d')
-
diff --git a/src/stage3/patches/gc.patch b/src/stage3/patches/gc.patch
index 453cef8..3a8460e 100644
--- a/src/stage3/patches/gc.patch
+++ b/src/stage3/patches/gc.patch
@@ -1,6 +1,6 @@
--- a/PKGBUILD 2018-03-12 18:02:55.550559093 +0100
+++ b/PKGBUILD 2018-03-12 18:19:24.997339010 +0100
-@@ -10,17 +10,19 @@ arch=('x86_64')
+@@ -10,27 +10,29 @@ arch=('x86_64')
url="http://www.hboehm.info/gc/"
license=('GPL')
depends=('gcc-libs' 'libatomic_ops')
@@ -22,7 +22,12 @@
./configure --prefix=/usr --enable-cplusplus --disable-static
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
-@@ -10,7 +10,7 @@ arch=('x86_64')
+ }
+
+ check() {
+- cd ${pkgname}-${pkgver}
++ cd bdwgc
+ make check
}
package() {
diff --git a/src/stage3/patches/gobject-introspection-runtime.patch b/src/stage3/patches/gobject-introspection.patch
index 9bec5a1..9bec5a1 100644
--- a/src/stage3/patches/gobject-introspection-runtime.patch
+++ b/src/stage3/patches/gobject-introspection.patch
diff --git a/src/stage3/patches/kbd.patch b/src/stage3/patches/kbd.patch
index 953a2bc..a96b153 100644
--- a/src/stage3/patches/kbd.patch
+++ b/src/stage3/patches/kbd.patch
@@ -1,10 +1,10 @@
--- a/PKGBUILD 2018-03-16 20:11:07.357989223 +0100
+++ b/PKGBUILD 2018-03-16 20:12:43.847030062 +0100
-@@ -9,7 +9,6 @@ arch=('x86_64')
+@@ -9,7 +9,6 @@ arch=('i686' 'x86_64')
url="http://www.kbd-project.org"
license=('GPL')
depends=('glibc' 'pam')
-makedepends=('check')
- source=(https://www.kernel.org/pub/linux/utils/${pkgname}/${pkgname}-${pkgver}.tar.gz
- https://www.kernel.org/pub/linux/utils/kbd/${pkgname}-${pkgver}.tar.sign
+ source=(ftp://ftp.kernel.org/pub/linux/utils/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ ftp://ftp.kernel.org/pub/linux/utils/kbd/${pkgname}-${pkgver}.tar.sign
'fix-euro2.patch')
diff --git a/src/stage3/patches/lapack.patch b/src/stage3/patches/lapack.patch
index c3e1280..777be87 100644
--- a/src/stage3/patches/lapack.patch
+++ b/src/stage3/patches/lapack.patch
@@ -12,7 +12,7 @@
pkgdesc="Linear Algebra PACKage"
-makedepends=('gcc-fortran' 'cmake' 'python' 'doxygen')
+makedepends=('gcc-fortran' 'cmake' 'python')
- arch=('x86_64')
+ arch=('i686' 'x86_64')
license=("custom")
source=(http://www.netlib.org/${pkgbase}/${pkgbase}-${pkgver}.tar.gz LICENSE.blas)
@@ -32,10 +32,6 @@ build() {
diff --git a/src/stage3/patches/libatomic_ops.patch b/src/stage3/patches/libatomic_ops.patch
index 13868fd..7ec3286 100644
--- a/src/stage3/patches/libatomic_ops.patch
+++ b/src/stage3/patches/libatomic_ops.patch
@@ -1,11 +1,11 @@
--- a/PKGBUILD 2018-03-12 17:32:57.049007339 +0100
+++ b/PKGBUILD 2018-03-12 17:45:14.783595573 +0100
-@@ -14,15 +14,17 @@ url='https://github.com/ivmai/libatomic_
+@@ -14,26 +14,28 @@ url='https://github.com/ivmai/libatomic_
depends=(glibc)
license=(GPL2 MIT)
options=(!docs)
-source=($url/releases/download/v$pkgver/${pkgname}-${pkgver}.tar.gz)
--sha256sums=('219724edad3d580d4d37b22e1d7cb52f0006d282d26a9b8681b560a625142ee6')
+-sha256sums=('5b823d5a685dd70caeef8fc50da7d763ba7f6167fe746abca7762e2835b3dd4e')
+makedepends=(git)
+source=(git+https://github.com/ivmai/libatomic_ops.git)
+sha256sums=('SKIP')
@@ -22,7 +22,11 @@
./configure --prefix=/usr --disable-static --enable-shared
make
}
-@@ -14,7 +14,7 @@ url='https://github.com/ivmai/libatomic_
+
+ check() {
+- cd $pkgname-$pkgver
++ cd $pkgname
+ make check
}
package() {
diff --git a/src/stage3/patches/libtool.patch b/src/stage3/patches/libtool.patch
new file mode 100644
index 0000000..09aebee
--- /dev/null
+++ b/src/stage3/patches/libtool.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-04-03 08:06:30.779089041 +0200
++++ b/PKGBUILD 2018-04-03 08:15:48.687036164 +0200
+@@ -36,7 +36,7 @@ prepare() {
+
+ build() {
+ cd libtool
+- ./configure --prefix=/usr lt_cv_sys_lib_dlsearch_path_spec="/usr/lib /usr/lib32"
++ ./configure --prefix=/usr lt_cv_sys_lib_dlsearch_path_spec="/usr/lib"
+ make
+ }
+
diff --git a/src/stage3/patches/device-mapper.patch b/src/stage3/patches/lvm2.patch
index 85c8b0e..85c8b0e 100644
--- a/src/stage3/patches/device-mapper.patch
+++ b/src/stage3/patches/lvm2.patch
diff --git a/src/stage3/patches/shadow.patch b/src/stage3/patches/shadow.patch
deleted file mode 100644
index 4b67e94..0000000
--- a/src/stage3/patches/shadow.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/PKGBUILD 2018-03-16 21:28:58.113879932 +0100
-+++ b/PKGBUILD 2018-03-16 21:35:47.180524060 +0100
-@@ -11,7 +11,7 @@ url='https://github.com/shadow-maint/sha
- license=('BSD')
- groups=('base')
- depends=('bash' 'pam' 'acl')
--makedepends=('git' 'libxslt' 'docbook-xsl' 'gnome-doc-utils')
-+makedepends=('git' 'libxslt' 'docbook-xsl' 'gnome-doc-utils' 'python2')
- backup=(etc/login.defs
- etc/pam.d/{chage,passwd,shadow,useradd,usermod,userdel}
- etc/pam.d/{chpasswd,newusers,groupadd,groupdel,groupmod}
diff --git a/src/stage3/patches/systemd.patch b/src/stage3/patches/systemd.patch
index b387e66..62177a6 100644
--- a/src/stage3/patches/systemd.patch
+++ b/src/stage3/patches/systemd.patch
@@ -7,7 +7,7 @@
+ # basic/macros: rename noreturn into _noreturn_ (#8456)
+ '848e863acc51ecfb0f3955c498874588201d9130'
+ # core: don't include libmount.h in a header file (#8580)
-+ '4af61b251099b1fed4c816a464f8068972a7145c'
++ '227b8a762fea1458547be2cdf0e6e4aac0079730'
)
_reverts=(
diff --git a/src/stage3/stage3.sh b/src/stage3/stage3.sh
index 0112253..3fa90bb 100755
--- a/src/stage3/stage3.sh
+++ b/src/stage3/stage3.sh
@@ -36,14 +36,16 @@ stage3_makepkg() {
sed "s#@MULTILIB@#${MULTILIB:-disable}#g" \
PKGBUILD.in > PKGBUILD
+ # prepare the pkgbuild
package_enable_arch "$CARCH"
+ echo "checkdepends=()" >> PKGBUILD
# check built dependencies
local dep
for dep in $(srcinfo_builddeps -n); do
deptree_check_depend "$1" "$dep" || return
done
- for dep in $(srcinfo_rundeps "$1"); do
+ for dep in $(srcinfo_rundeps "$pkgname"); do
deptree_check_depend "$1" "$dep" || return
done
@@ -53,9 +55,6 @@ stage3_makepkg() {
# don't rebuild if already exists
check_pkgfile "$PKGDEST" "$1" && return
- # disable checkdepends
- echo "checkdepends=()" >> PKGBUILD
-
if [ "x$1" != "x$pkgname" ]; then
# a bit of magic for -decross builds
PKGDEST=. "$BUILDDIR/libremakepkg-$CARCH.sh" -n "$CHOST"-stage3 || return
@@ -88,15 +87,16 @@ stage3_package_build() {
}
stage3_package_install() {
- local pkgfile
- pkgfile=$(find "$PKGDEST" -regex "^.*/$1-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$" | head -n1)
+ local esc pkgfile
+ esc=$(printf '%s\n' "$1" | sed 's:[][\/.^$*]:\\&:g')
+ pkgfile=$(find "$PKGPOOL" -regex "^.*/$esc-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$" | head -n1)
[ -n "$pkgfile" ] || { error "$1: pkgfile not found"; return "$ERROR_MISSING"; }
yes | librechroot \
-n "$CHOST-stage3" \
-C "$BUILDDIR"/config/pacman.conf \
-M "$BUILDDIR"/config/makepkg.conf \
- run pacman -Udd /repos/native/"$CARCH"/"$(basename "$pkgfile")" || return
+ run pacman -U /repos/native/"$CARCH"/"$(basename "$pkgfile")" || return
yes | librechroot \
-n "$CHOST-stage3" \
-C "$BUILDDIR"/config/pacman.conf \
@@ -124,26 +124,25 @@ stage3() {
binfmt_enable
- prepare_stage3_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
- prepare_stage3_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
prepare_deptree "${groups[@]}" || die -e "$ERROR_BUILDFAIL" "failed to prepare DEPTREE"
-
local pkg
for pkg in "${decross[@]}"; do
deptree_add_entry "$pkg-decross"
done
-
echo "remaining pkges: $(wc -l < "$DEPTREE") / $(wc -l < "$DEPTREE".FULL)"
- if [ -s "$DEPTREE" ]; then
- check_exe -r librechroot libremakepkg
+ [ -s "$DEPTREE" ] || return 0
- for pkg in "${decross[@]}"; do
- package_build stage3_package_build stage3_package_install "$pkg-decross" || return
- done
+ prepare_stage3_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
+ prepare_stage3_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
- # build packages from deptree
- packages_build_all stage3_package_build stage3_package_install || return
- fi
+ check_exe -r librechroot libremakepkg
+
+ for pkg in "${decross[@]}"; do
+ package_build stage3_package_build stage3_package_install "$pkg-decross" || return
+ done
+
+ # build packages from deptree
+ packages_build_all stage3_package_build stage3_package_install || return
# cleanup
umount_stage3_chrootdir
diff --git a/src/stage4/chroot.sh b/src/stage4/chroot.sh
index 5bd90e5..987afbc 100644
--- a/src/stage4/chroot.sh
+++ b/src/stage4/chroot.sh
@@ -40,8 +40,8 @@ umount_stage4_chrootdir() {
local chrootdir
chrootdir="$(librechroot -n "$CHOST-stage4" 2>&1 | grep "copydir.*:" | awk '{print $3}')"
- umount "$chrootdir"/repos/repos/
- umount "$chrootdir"/repos/native/
+ umount "$chrootdir"/repos/
+ umount "$chrootdir"/native/
trap - INT TERM EXIT
}
@@ -62,7 +62,7 @@ prepare_stage4_chroot() {
check_stage4_chroot "$chrootdir" || build_stage4_chroot "$chrootdir" || return
- mount_stage3_chrootdir "$chrootdir"
+ mount_stage4_chrootdir "$chrootdir"
librechroot -n "$CHOST-stage4" \
-C "$BUILDDIR"/config/pacman.conf \
diff --git a/src/stage4/makepkg.sh b/src/stage4/makepkg.sh
index 11c7024..1df4f23 100644
--- a/src/stage4/makepkg.sh
+++ b/src/stage4/makepkg.sh
@@ -51,6 +51,7 @@ Server = file:///repos/\$repo/os/\$arch
Server = file:///native/\$arch
EOF
+ cat "$SRCDIR"/makepkg.conf.in > "$BUILDDIR"/config/makepkg.conf
cat >> "$BUILDDIR"/config/makepkg.conf << EOF
CARCH="$CARCH"
CHOST="$CHOST"
@@ -73,8 +74,8 @@ EOF
local url="https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain"
sed -i "/Boring\\/mundane/i \\
update_config_fragments() {\\
- find \$1/build -iname config.sub -exec curl \"$url;f=config.sub;hb=HEAD\" -o {} \\\\;\\
- find \$1/build -iname config.guess -exec curl \"$url;f=config.guess;hb=HEAD\" -o {} \\\\;\\
+ find \$1/build -iname 'config*.sub' -print -exec curl \"$url;f=config.sub;hb=HEAD\" -o {} \\\\;\\
+ find \$1/build -iname 'config*.guess' -print -exec curl \"$url;f=config.guess;hb=HEAD\" -o {} \\\\;\\
}\\
hook_pre_build+=(update_config_fragments)" "$BUILDDIR/libremakepkg-$CARCH.sh"
fi
diff --git a/src/stage4/patches/aspell.patch b/src/stage4/patches/aspell.patch
new file mode 100644
index 0000000..7c574da
--- /dev/null
+++ b/src/stage4/patches/aspell.patch
@@ -0,0 +1,23 @@
+--- a/PKGBUILD 2018-04-04 12:52:35.771273425 +0200
++++ b/PKGBUILD 2018-04-04 17:35:11.302666425 +0200
+@@ -15,9 +15,17 @@ url="http://aspell.net/"
+ license=('LGPL')
+ depends=('gcc-libs' 'ncurses')
+ optdepends=('perl: to import old dictionaries')
+-source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz)
+-md5sums=('e66a9c9af6a60dc46134fdacf6ce97d7')
+-sha1sums=('ff1190db8de279f950c242c6f4c5d5cdc2cbdc49')
++source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz
++ https://github.com/GNUAspell/aspell/commit/8089fa02122fed0a6394eba14bbedcb1d18e238.patch)
++md5sums=('e66a9c9af6a60dc46134fdacf6ce97d7'
++ '5f81982bf5ba10d8f23e8086dfcca867')
++sha1sums=('ff1190db8de279f950c242c6f4c5d5cdc2cbdc49'
++ 'df5364a8472154452f4e1fe9db0891df457949e0')
++
++prepare() {
++ cd "${srcdir}/${pkgname}-${pkgver}"
++ patch -Np1 -i ../8089fa02122fed0a6394eba14bbedcb1d18e238.patch
++}
+
+ build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
diff --git a/src/stage4/patches/btrfs-progs.patch b/src/stage4/patches/btrfs-progs.patch
new file mode 100644
index 0000000..1c42396
--- /dev/null
+++ b/src/stage4/patches/btrfs-progs.patch
@@ -0,0 +1,46 @@
+diff -rupN a/0001-fix-build-with-e2fsprogs-1.44.0.patch b/0001-fix-build-with-e2fsprogs-1.44.0.patch
+--- a/0001-fix-build-with-e2fsprogs-1.44.0.patch 1970-01-01 01:00:00.000000000 +0100
++++ b/0001-fix-build-with-e2fsprogs-1.44.0.patch 2018-04-05 10:05:27.065035156 +0200
+@@ -0,0 +1,14 @@
++diff --git a/convert/source-ext2.c b/convert/source-ext2.c
++index b1492c78693d..070126ec38ec 100644
++--- a/convert/source-ext2.c
+++++ b/convert/source-ext2.c
++@@ -422,8 +422,7 @@ static int ext2_xattr_check_entry(struct ext2_ext_attr_entry *entry,
++ {
++ size_t value_size = entry->e_value_size;
++
++- if (entry->e_value_block != 0 || value_size > size ||
++- entry->e_value_offs + value_size > size)
+++ if (value_size > size || entry->e_value_offs + value_size > size)
++ return -EIO;
++ return 0;
++ }
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 10:05:27.064035156 +0200
++++ b/PKGBUILD 2018-04-05 10:05:27.065035156 +0200
+@@ -20,7 +20,8 @@ source=("https://www.kernel.org/pub/linu
+ 'initcpio-install-btrfs'
+ 'initcpio-hook-btrfs'
+ 'btrfs-scrub@.service'
+- 'btrfs-scrub@.timer')
++ 'btrfs-scrub@.timer'
++ '0001-fix-build-with-e2fsprogs-1.44.0.patch')
+ install=btrfs-progs.install
+ options=(!staticlibs)
+ md5sums=('SKIP'
+@@ -28,7 +29,13 @@ md5sums=('SKIP'
+ '7241ba3a4286d08da0d50b7176941112'
+ 'b09688a915a0ec8f40e2f5aacbabc9ad'
+ '917b31f4eb90448d6791e17ea0f386c7'
+- '502221c1b47a3bb2c06703d4fb90a0c2')
++ '502221c1b47a3bb2c06703d4fb90a0c2'
++ '66a2b1ec9f0d5e8a34fb9344d6307ee0')
++
++prepare() {
++ cd $pkgname-v$pkgver
++ patch -Np1 -i ../0001-fix-build-with-e2fsprogs-1.44.0.patch
++}
+
+ build() {
+ cd $pkgname-v$pkgver
diff --git a/src/stage4/patches/cairo.patch b/src/stage4/patches/cairo.patch
new file mode 100644
index 0000000..51f3685
--- /dev/null
+++ b/src/stage4/patches/cairo.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-04-03 23:44:52.137752947 +0200
++++ b/PKGBUILD 2018-04-04 08:09:09.899885197 +0200
+@@ -10,7 +10,7 @@ url="https://cairographics.org/"
+ arch=(x86_64)
+ license=(LGPL MPL)
+ depends=(libpng libxrender libxext fontconfig pixman glib2 lzo)
+-makedepends=(librsvg gtk2 poppler-glib libspectre gtk-doc valgrind git)
++makedepends=(librsvg gtk2 poppler-glib libspectre gtk-doc git)
+ _commit=1ed124ace201946177eab962d3b07bb2fedf9026 # master
+ source=("git+https://anongit.freedesktop.org/git/cairo#commit=$_commit"
+ utf-8.diff)
diff --git a/src/stage4/patches/clisp.patch b/src/stage4/patches/clisp.patch
new file mode 100644
index 0000000..6f22827
--- /dev/null
+++ b/src/stage4/patches/clisp.patch
@@ -0,0 +1,23 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-06 04:59:13.746587767 +0200
++++ b/PKGBUILD 2018-04-06 04:59:13.746587767 +0200
+@@ -9,7 +9,6 @@ license=('GPL')
+ url="http://clisp.cons.org/"
+ depends=('readline' 'libsigsegv')
+ provides=('common-lisp')
+-makedepends=('ffcall')
+ options=('!makeflags' '!emptydirs')
+ source=("http://downloads.sourceforge.net/sourceforge/clisp/clisp-${pkgver}.tar.bz2"
+ "clisp-gcc5.patch"
+@@ -30,9 +29,9 @@ prepare() {
+
+ build() {
+ cd $srcdir/${pkgname}-${pkgver}
+- ./configure --prefix=/usr --with-readline --with-ffcall src
++ ./configure --prefix=/usr --with-readline src
+ cd src
+- ./makemake --prefix=/usr --with-readline --with-ffcall --with-dynamic-ffi > Makefile
++ ./makemake --prefix=/usr --with-readline --with-dynamic-ffi > Makefile
+ make
+ sed -i 's,http://www.lisp.org/HyperSpec/,http://www.lispworks.com/reference/HyperSpec/,g' config.lisp
+ make
diff --git a/src/stage4/patches/cups.patch b/src/stage4/patches/cups.patch
new file mode 100644
index 0000000..3af99d5
--- /dev/null
+++ b/src/stage4/patches/cups.patch
@@ -0,0 +1,12 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 07:51:36.851796238 +0200
++++ b/PKGBUILD 2018-04-05 07:51:36.852796238 +0200
+@@ -10,7 +10,7 @@ license=('GPL')
+ url="https://www.cups.org/"
+ makedepends=('libtiff' 'libpng' 'acl' 'pam' 'xdg-utils' 'krb5' 'gnutls'
+ 'cups-filters' 'bc' 'colord' 'xinetd' 'gzip' 'autoconf' 'libusb' 'dbus'
+- 'avahi' 'hicolor-icon-theme' 'systemd' 'inetutils' 'libpaper' 'valgrind')
++ 'avahi' 'hicolor-icon-theme' 'systemd' 'inetutils' 'libpaper')
+ source=(https://github.com/apple/cups/releases/download/v${pkgver}/cups-${pkgver}-source.tar.gz{,.sig}
+ cups.logrotate cups.pam
+ cups.sysusers guid.patch
diff --git a/src/stage4/patches/dhcp.patch b/src/stage4/patches/dhcp.patch
new file mode 100644
index 0000000..02fa427
--- /dev/null
+++ b/src/stage4/patches/dhcp.patch
@@ -0,0 +1,43 @@
+diff -rupN a/0001-bind-use-main-config-fragments.patch b/0001-bind-use-main-config-fragments.patch
+--- a/0001-bind-use-main-config-fragments.patch 1970-01-01 01:00:00.000000000 +0100
++++ b/0001-bind-use-main-config-fragments.patch 2018-04-05 09:00:27.700404727 +0200
+@@ -0,0 +1,10 @@
++--- a/bind/Makefile.in 2018-02-21 16:52:47.000000000 +0100
+++++ b/bind/Makefile.in.new 2018-04-05 08:04:27.335723214 +0200
++@@ -55,6 +55,7 @@ bind1:
++ else \
++ echo Configuring BIND libraries for DHCP. ; \
++ rm -rf ${cleandirs} ${cleanfiles} ; \
+++ cp ../config.{sub,guess} ${bindsrcdir} ; \
++ (cd ${bindsrcdir} && \
++ ./configure ${bindconfig} > ${binddir}/configure.log); \
++ fi
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 09:00:27.698404728 +0200
++++ b/PKGBUILD 2018-04-05 09:00:27.699404727 +0200
+@@ -19,7 +19,8 @@ source=("ftp://ftp.isc.org/isc/${pkgbase
+ 'dhcpd4.service'
+ 'dhcpd6.service'
+ 'dhclient@.service'
+- '0002-iproute2.patch')
++ '0002-iproute2.patch'
++ '0001-bind-use-main-config-fragments.patch')
+ sha256sums=('2a22508922ab367b4af4664a0472dc220cc9603482cf3c16d9aff14f3a76b608'
+ 'SKIP'
+ 'b16083e6bb572ffacaa7cd97e7fde5fcfa1b6dbeb166f162e2ec6e8ec4b928d6'
+@@ -27,11 +28,14 @@ sha256sums=('2a22508922ab367b4af4664a047
+ '03fce30efab819b2d928085b0bab962a33ce56fc376acae98ad9b30aa278c9c8'
+ 'f98a4438f4f69cab7cc5cce6927df4790ee993ebc8f88a169e63043c53d25625'
+ '86cd0b1e0ea1d47ab096f6ee925eee60545116fb887a155761eda589b30e4f0e'
+- '837a64189b949afae951655546967cc8f17f2f2cf370faabff00575364f0fcf7')
++ '837a64189b949afae951655546967cc8f17f2f2cf370faabff00575364f0fcf7'
++ '8df89ff933ba9f6da61ca0cdc40af3fe4711feac3c755c97de3eebf78a8e8834')
+
+ prepare() {
+ cd "${srcdir}/${pkgbase}-${pkgver}"
+
++ patch -Np1 -i ../0001-bind-use-main-config-fragments.patch
++
+ # no ifconfig, use ip from iproute2
+ patch -Np1 -i ../0002-iproute2.patch
+ }
diff --git a/src/stage4/patches/doxygen-breakdeps.patch b/src/stage4/patches/doxygen-breakdeps.patch
new file mode 100644
index 0000000..0326760
--- /dev/null
+++ b/src/stage4/patches/doxygen-breakdeps.patch
@@ -0,0 +1,36 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 20:56:55.018330503 +0200
++++ b/PKGBUILD 2018-04-05 20:56:55.019330503 +0200
+@@ -2,15 +2,15 @@
+ # Maintainer: Dan McGee <dan@archlinux.org>
+
+ pkgbase=doxygen
+-pkgname=('doxygen' 'doxygen-docs')
++pkgname=('doxygen')
+ pkgver=1.8.14
+ pkgrel=1
+ pkgdesc='Documentation system for C++, C, Java, IDL and PHP'
+ url='http://www.doxygen.org/'
+ arch=('x86_64')
+ license=('GPL')
+-makedepends=('cmake' 'gcc-libs' 'flex' 'qt5-base' 'texlive-core' 'ghostscript'
+- 'texlive-latexextra' 'graphviz' 'python2')
++makedepends=('cmake' 'gcc-libs' 'flex'
++ 'python2')
+ source=(${pkgbase}-${pkgver}.tar.gz::https://github.com/doxygen/doxygen/archive/Release_${pkgver//./_}.tar.gz)
+ sha256sums=('18bc3790b4d5f4d57cb8ee0a77dd63a52518f3f70d7fdff868a7ce7961a6edc3')
+ sha512sums=('e19d706be64f8c1d35d3cd12b8c35f09503213bb3f5a4aa311ef0a6a953843ebed5ac4eca52ca908222543fb9794d545bb6d88c9fc8f39e66ef22c1919c120b0')
+@@ -32,11 +32,10 @@ build() {
+ -DCMAKE_INSTALL_PREFIX:PATH=/usr \
+ -DDOC_INSTALL_DIR:PATH=share/doc/doxygen \
+ -DPYTHON_EXECUTABLE:FILE=/usr/bin/python2 \
+- -Dbuild_doc:BOOL=ON \
+- -Dbuild_wizard:BOOL=ON
++ -Dbuild_doc:BOOL=OFF \
++ -Dbuild_wizard:BOOL=OFF
+
+ make
+- make docs
+ }
+
+ check(){
diff --git a/src/stage4/patches/fftw.patch b/src/stage4/patches/fftw.patch
new file mode 100644
index 0000000..c6a01ee
--- /dev/null
+++ b/src/stage4/patches/fftw.patch
@@ -0,0 +1,29 @@
+--- a/PKGBUILD 2018-04-04 10:16:24.430161616 +0200
++++ b/PKGBUILD 2018-04-04 10:20:03.465140856 +0200
+@@ -29,7 +29,7 @@ build() {
+
+
+ # use upstream default CFLAGS while keeping our -march/-mtune
+- CFLAGS+=" -O3 -fomit-frame-pointer -malign-double -fstrict-aliasing -ffast-math"
++ CFLAGS+=" -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math"
+
+ CONFIGURE="./configure F77=gfortran --prefix=/usr \
+ --enable-shared --enable-threads \
+@@ -37,7 +37,7 @@ build() {
+
+ # build double precision
+ cd ${srcdir}/${pkgname}-${pkgver}-double
+- $CONFIGURE --enable-sse2 --enable-avx
++ $CONFIGURE
+ make
+
+ # build & install long double precission
+@@ -47,7 +47,7 @@ build() {
+
+ # build & install single precision
+ cd ${srcdir}/${pkgname}-${pkgver}-single
+- $CONFIGURE --enable-float --enable-sse --enable-avx
++ $CONFIGURE --enable-float
+ make
+ }
+
diff --git a/src/stage4/patches/fontconfig-breakdeps.patch b/src/stage4/patches/fontconfig-breakdeps.patch
new file mode 100644
index 0000000..661787c
--- /dev/null
+++ b/src/stage4/patches/fontconfig-breakdeps.patch
@@ -0,0 +1,14 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-06 20:56:07.008146290 +0200
++++ b/PKGBUILD 2018-04-06 20:56:07.009146290 +0200
+@@ -9,8 +9,8 @@ arch=(x86_64)
+ url="https://www.freedesktop.org/wiki/Software/fontconfig/"
+ license=(custom)
+ depends=(expat freetype2)
+-makedepends=(git autoconf-archive gperf python-lxml python-six docbook-utils docbook-sgml
+- perl-sgmls 'texlive-formatsextra>=2017' lynx)
++makedepends=(git autoconf-archive gperf python-lxml python-six
++ lynx)
+ install=fontconfig.install
+ _commit=58f52853d5689e897525a5926c1a222340d3f404 # master
+ source=("git+https://anongit.freedesktop.org/git/fontconfig#commit=$_commit"
diff --git a/src/stage4/patches/freetype2-breakdeps.patch b/src/stage4/patches/freetype2-breakdeps.patch
new file mode 100644
index 0000000..82ce5c1
--- /dev/null
+++ b/src/stage4/patches/freetype2-breakdeps.patch
@@ -0,0 +1,12 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 10:50:53.694776733 +0200
++++ b/PKGBUILD 2018-04-05 10:50:53.695776733 +0200
+@@ -11,7 +11,7 @@ license=('GPL')
+ url="https://www.freetype.org/"
+ # adding harfbuzz for improved OpenType features auto-hinting
+ # introduces a cycle dep to harfbuzz depending on freetype wanted by upstream
+-depends=('zlib' 'bzip2' 'sh' 'libpng' 'harfbuzz')
++depends=('zlib' 'bzip2' 'sh' 'libpng')
+ makedepends=('libx11')
+ source=(https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${pkgver}.tar.bz2{,.sig}
+ https://download-mirror.savannah.gnu.org/releases/freetype/freetype-doc-${pkgver}.tar.bz2{,.sig}
diff --git a/src/stage4/patches/gc.patch b/src/stage4/patches/gc.patch
index 453cef8..0db562a 100644
--- a/src/stage4/patches/gc.patch
+++ b/src/stage4/patches/gc.patch
@@ -1,6 +1,7 @@
---- a/PKGBUILD 2018-03-12 18:02:55.550559093 +0100
-+++ b/PKGBUILD 2018-03-12 18:19:24.997339010 +0100
-@@ -10,17 +10,19 @@ arch=('x86_64')
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:17:46.882647435 +0200
++++ b/PKGBUILD 2018-04-05 08:17:46.883647435 +0200
+@@ -10,27 +10,29 @@ arch=('x86_64')
url="http://www.hboehm.info/gc/"
license=('GPL')
depends=('gcc-libs' 'libatomic_ops')
@@ -22,7 +23,12 @@
./configure --prefix=/usr --enable-cplusplus --disable-static
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
make
-@@ -10,7 +10,7 @@ arch=('x86_64')
+ }
+
+ check() {
+- cd ${pkgname}-${pkgver}
++ cd bdwgc
+ make check
}
package() {
diff --git a/src/stage4/patches/gcc.patch b/src/stage4/patches/gcc.patch
index 87f1165..d437e21 100644
--- a/src/stage4/patches/gcc.patch
+++ b/src/stage4/patches/gcc.patch
@@ -1,11 +1,12 @@
---- a/PKGBUILD 2018-03-22 09:21:46.483009873 +0100
-+++ b/PKGBUILD 2018-03-22 16:31:23.449831902 +0100
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-06 04:45:27.275666098 +0200
++++ b/PKGBUILD 2018-04-06 04:45:27.275666098 +0200
@@ -5,7 +5,8 @@
# toolchain build order: linux-api-headers->glibc->binutils->gcc->binutils->glibc
# NOTE: libtool requires rebuilt with each new gcc version
-pkgname=(gcc gcc-libs gcc-fortran gcc-objc gcc-ada gcc-go lib32-gcc-libs)
-+pkgname=(gcc gcc-libs gcc-fortran gcc-objc)
++pkgname=(gcc gcc-libs gcc-fortran)
+[ "x@MULTILIB@" == "xdisable" ] || pkgname+=(lib32-gcc-libs)
pkgver=7.3.1+20180312
_majorver=${pkgver:0:1}
@@ -50,7 +51,7 @@
--infodir=/usr/share/info \
--with-bugurl=https://bugs.archlinux.org/ \
- --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ \
-+ --enable-languages=c,c++,fortran,go,lto \
++ --enable-languages=c,c++,fortran,lto \
--enable-shared \
--enable-threads=posix \
- --enable-libmpx \
@@ -67,7 +68,16 @@
--disable-werror \
--enable-checking=release \
--enable-default-pie \
-@@ -139,25 +146,18 @@ package_gcc-libs() {
+@@ -131,7 +138,7 @@ package_gcc-libs() {
+ groups=(base)
+ depends=('glibc>=2.26')
+ options+=(!strip)
+- provides=($pkgname-multilib libgo.so libgfortran.so)
++ provides=($pkgname-multilib libgfortran.so)
+ replaces=($pkgname-multilib)
+
+ cd gcc-build
+@@ -139,25 +146,17 @@ package_gcc-libs() {
rm -f "$pkgdir/$_libdir/libgcc_eh.a"
for lib in libatomic \
@@ -84,7 +94,7 @@
make -C $CHOST/$lib DESTDIR="$pkgdir" install-toolexeclibLTLIBRARIES
done
- make -C $CHOST/libobjc DESTDIR="$pkgdir" install-libs
+- make -C $CHOST/libobjc DESTDIR="$pkgdir" install-libs
make -C $CHOST/libstdc++-v3/po DESTDIR="$pkgdir" install
- make -C $CHOST/libmpx DESTDIR="$pkgdir" install
rm -f "$pkgdir/usr/lib/libmpx.spec"
@@ -152,7 +162,7 @@
make -C libcpp DESTDIR="$pkgdir" install
make -C gcc DESTDIR="$pkgdir" install-po
-@@ -262,7 +251,7 @@ package_gcc() {
+@@ -269,7 +258,7 @@ package_gcc-fortran() {
cd gcc-build
make -C $CHOST/libgfortran DESTDIR="$pkgdir" install-cafexeclibLTLIBRARIES \
install-{toolexeclibDATA,nodist_fincludeHEADERS}
diff --git a/src/stage4/patches/gstreamer.patch b/src/stage4/patches/gstreamer.patch
new file mode 100644
index 0000000..727581f
--- /dev/null
+++ b/src/stage4/patches/gstreamer.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-04-04 01:43:36.102077757 +0200
++++ b/PKGBUILD 2018-04-04 08:23:33.783803320 +0200
+@@ -10,7 +10,7 @@ url="https://gstreamer.freedesktop.org/"
+ arch=(x86_64)
+ license=(LGPL)
+ depends=(libxml2 glib2 libunwind libcap libelf)
+-makedepends=(gtk-doc gobject-introspection autoconf-archive git valgrind bash-completion)
++makedepends=(gtk-doc gobject-introspection autoconf-archive git bash-completion)
+ checkdepends=(gmp gsl gtk3)
+ _commit=80e0e90d00bb358ca9dc071cf6de010ec5ae2644 # tags/1.14.0^0
+ install=gstreamer.install
diff --git a/src/stage4/patches/gypsy.patch b/src/stage4/patches/gypsy.patch
new file mode 100644
index 0000000..17812ce
--- /dev/null
+++ b/src/stage4/patches/gypsy.patch
@@ -0,0 +1,12 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:19:33.480637332 +0200
++++ b/PKGBUILD 2018-04-05 08:19:33.481637332 +0200
+@@ -11,7 +11,7 @@ arch=(i686 x86_64)
+ url="http://gypsy.freedesktop.org/"
+ license=(GPL)
+ depends=(dbus-glib bluez bluez-libs libgudev)
+-makedepends=(libxslt)
++makedepends=(libxslt python)
+ source=("http://gypsy.freedesktop.org/releases/$pkgname-$pkgver.tar.gz"
+ g_type_init_deprecation.patch)
+ md5sums=('e2d186df9c2cc3b70a027043e22acf1a'
diff --git a/src/stage4/patches/jemalloc.patch b/src/stage4/patches/jemalloc.patch
new file mode 100644
index 0000000..ed27524
--- /dev/null
+++ b/src/stage4/patches/jemalloc.patch
@@ -0,0 +1,26 @@
+--- a/PKGBUILD 2018-04-03 19:09:08.118320946 +0200
++++ b/PKGBUILD 2018-04-03 19:25:08.575229916 +0200
+@@ -15,19 +15,20 @@ depends=('glibc')
+ provides=('libjemalloc.so')
+ optdepends=('perl: for jeprof')
+ source=("https://github.com/jemalloc/jemalloc/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2"
+- '0001-Add-the-mtls-dialect-gnu2-to-compile-flags.patch')
++ 'https://github.com/jemalloc/jemalloc/commit/749caf14ae73a9ab1c48e538a8af09addbb35ee7.patch')
+ sha256sums=('4814781d395b0ef093b21a08e8e6e0bd3dab8762f9935bbfb71679b0dea7c3e9'
+- 'ac1570ab81c6545b8e994eab02239af67acdce682656c77802d090b0809176bf')
++ '176ca3dcbff7eaa43f2c368852bb01c2f4cd09d50296f8b64ca1888a55e13915')
+
+ prepare() {
+ cd $pkgname-$pkgver
+- patch -p1 -i "$srcdir/0001-Add-the-mtls-dialect-gnu2-to-compile-flags.patch"
++ patch -Np1 -i "$srcdir/749caf14ae73a9ab1c48e538a8af09addbb35ee7.patch"
+ autoconf
+ }
+
+ build() {
+ cd $pkgname-$pkgver
+
++ export LDFLAGS="$LDFLAGS -latomic"
+ ./configure --enable-autogen --prefix=/usr
+ make
+ }
diff --git a/src/stage4/patches/js.patch b/src/stage4/patches/js.patch
new file mode 100644
index 0000000..3501657
--- /dev/null
+++ b/src/stage4/patches/js.patch
@@ -0,0 +1,54 @@
+--- a/PKGBUILD 2018-04-04 20:24:00.120706442 +0200
++++ b/PKGBUILD 2018-04-04 20:45:17.585585367 +0200
+@@ -11,11 +11,20 @@ license=(MPL)
+ depends=(nspr gcc-libs readline zlib)
+ makedepends=(python2 zip libffi)
+ options=(!staticlibs)
+-source=(http://ftp.mozilla.org/pub/mozilla.org/js/mozjs-$pkgver.tar.bz2)
+-md5sums=('5db79c10e049a2dc117a6e6a3bc78a8e')
++source=(http://ftp.mozilla.org/pub/mozilla.org/js/mozjs-$pkgver.tar.bz2
++ 0001-mozjs-riscv-support.patch
++ 0002-jsoptparse-pointer-comparison.patch)
++md5sums=('5db79c10e049a2dc117a6e6a3bc78a8e'
++ 'b2a2ddfd0b02e4534d312f4073b46dd8'
++ '512c30df5c120423e3090d6693a791df')
+
+ prepare() {
+- cd mozjs-$pkgver/js/src
++ cd mozjs-$pkgver
++
++ patch -Np1 -i ../0001-mozjs-riscv-support.patch
++ patch -Np1 -i ../0002-jsoptparse-pointer-comparison.patch
++
++ cd js/src
+
+ rm -r editline
+ rm -r ctypes/libffi
+--- /dev/null 2018-03-20 11:36:27.102196685 +0100
++++ b/0001-mozjs-riscv-support.patch 2018-04-04 19:17:27.400084862 +0200
+@@ -0,0 +1,11 @@
++--- mozjs-24.2.0/mfbt/double-conversion/utils.h 2013-10-29 21:40:19.000000000 +0100
+++++ mozjs-24.2.0/mfbt/double-conversion/utils.h.new 2018-04-04 19:16:44.622088916 +0200
++@@ -57,7 +57,7 @@
++ defined(__hppa__) || defined(__ia64__) || \
++ defined(__mips__) || defined(__powerpc__) || \
++ defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
++- defined(__SH4__) || defined(__alpha__) || \
+++ defined(__SH4__) || defined(__alpha__) || defined(__riscv) || \
++ defined(_MIPS_ARCH_MIPS32R2)
++ #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
++ #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
+--- /dev/null 2018-03-20 11:36:27.102196685 +0100
++++ b/0002-jsoptparse-pointer-comparison.patch 2018-04-04 20:45:03.322586719 +0200
+@@ -0,0 +1,11 @@
++--- a/js/src/shell/jsoptparse.cpp 2013-10-29 21:40:20.000000000 +0100
+++++ b/js/src/shell/jsoptparse.cpp 2018-04-04 20:43:06.534597788 +0200
++@@ -253,7 +253,7 @@ OptionParser::extractValue(size_t argc,
++ char *eq = strchr(argv[*i], '=');
++ if (eq) {
++ *value = eq + 1;
++- if (value[0] == '\0')
+++ if (*(value[0]) == '\0')
++ return error("A value is required for option %.*s", eq - argv[*i], argv[*i]);
++ return Okay;
++ }
diff --git a/src/stage4/patches/libaio.patch b/src/stage4/patches/libaio.patch
index 306cff9..2c07294 100644
--- a/src/stage4/patches/libaio.patch
+++ b/src/stage4/patches/libaio.patch
@@ -8,7 +8,7 @@
+pkgver=0.3.111
pkgrel=1
pkgdesc="The Linux-native asynchronous I/O facility (aio) library"
- arch=('x86_64')
+ arch=('i686' 'x86_64')
url="http://lse.sourceforge.net/io/aio.html"
license=('LGPL')
-source=(http://ftp.de.debian.org/debian/pool/main/liba/$pkgname/${pkgname}_${pkgver}.orig.tar.gz)
diff --git a/src/stage4/patches/libatomic_ops.patch b/src/stage4/patches/libatomic_ops.patch
index 13868fd..dc8157f 100644
--- a/src/stage4/patches/libatomic_ops.patch
+++ b/src/stage4/patches/libatomic_ops.patch
@@ -1,11 +1,12 @@
---- a/PKGBUILD 2018-03-12 17:32:57.049007339 +0100
-+++ b/PKGBUILD 2018-03-12 17:45:14.783595573 +0100
-@@ -14,15 +14,17 @@ url='https://github.com/ivmai/libatomic_
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 13:18:24.267937899 +0200
++++ b/PKGBUILD 2018-04-05 13:18:24.268937899 +0200
+@@ -14,26 +14,28 @@ url='https://github.com/ivmai/libatomic_
depends=(glibc)
license=(GPL2 MIT)
options=(!docs)
-source=($url/releases/download/v$pkgver/${pkgname}-${pkgver}.tar.gz)
--sha256sums=('219724edad3d580d4d37b22e1d7cb52f0006d282d26a9b8681b560a625142ee6')
+-sha256sums=('5b823d5a685dd70caeef8fc50da7d763ba7f6167fe746abca7762e2835b3dd4e')
+makedepends=(git)
+source=(git+https://github.com/ivmai/libatomic_ops.git)
+sha256sums=('SKIP')
@@ -22,7 +23,11 @@
./configure --prefix=/usr --disable-static --enable-shared
make
}
-@@ -14,7 +14,7 @@ url='https://github.com/ivmai/libatomic_
+
+ check() {
+- cd $pkgname-$pkgver
++ cd $pkgname
+ make check
}
package() {
diff --git a/src/stage4/patches/libbluray.patch b/src/stage4/patches/libbluray.patch
new file mode 100644
index 0000000..dcf8260
--- /dev/null
+++ b/src/stage4/patches/libbluray.patch
@@ -0,0 +1,21 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-07 07:13:46.970633845 +0200
++++ b/PKGBUILD 2018-04-07 07:13:46.971633845 +0200
+@@ -12,8 +12,6 @@ arch=('x86_64')
+ url='http://www.videolan.org/developers/libbluray.html'
+ license=('LGPL2.1')
+ depends=('fontconfig' 'glibc' 'libfreetype.so' 'libxml2')
+-makedepends=('apache-ant' 'java-environment=8')
+-optdepends=('java-runtime=8: BD-J library')
+ provides=('libbluray.so')
+ source=("ftp://ftp.videolan.org/pub/videolan/libbluray/${pkgver}/libbluray-${pkgver}.tar.bz2")
+ sha256sums=('6d9e7c4e416f664c330d9fa5a05ad79a3fb39b95adfc3fd6910cbed503b7aeff')
+@@ -22,7 +20,7 @@ build() {
+ cd libbluray-${pkgver}
+
+ ./configure \
+- --prefix='/usr'
++ --prefix='/usr' --disable-bdjava-jar
+ make
+ }
+
diff --git a/src/stage4/patches/libevdev.patch b/src/stage4/patches/libevdev.patch
new file mode 100644
index 0000000..ea4df75
--- /dev/null
+++ b/src/stage4/patches/libevdev.patch
@@ -0,0 +1,12 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 20:52:13.278357206 +0200
++++ b/PKGBUILD 2018-04-05 20:52:13.278357206 +0200
+@@ -9,7 +9,7 @@ arch=(x86_64)
+ url="http://www.freedesktop.org/wiki/Software/libevdev/"
+ license=(custom:X11)
+ depends=('glibc')
+-makedepends=('python2' 'check' 'valgrind' 'doxygen')
++makedepends=('python2' 'check' 'doxygen')
+ #checkdepends=('kmod')
+ source=(https://freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz{,.sig})
+ sha512sums=('4496ab4d9dc165f416a574c21a7fcee54ae104c21ef4785a4dd0311fff428020cdbb5da7bf3f835e78dae05effdb1a557d189347f6e62dd6be2d8bcdc845850c'
diff --git a/src/stage4/patches/libfbclient.patch b/src/stage4/patches/libfbclient.patch
new file mode 100644
index 0000000..d4c6c38
--- /dev/null
+++ b/src/stage4/patches/libfbclient.patch
@@ -0,0 +1,131 @@
+diff -rupN a/0001-Port-to-RISC-V-64-bit-riscv64.patch b/0001-Port-to-RISC-V-64-bit-riscv64.patch
+--- a/0001-Port-to-RISC-V-64-bit-riscv64.patch 1970-01-01 01:00:00.000000000 +0100
++++ b/0001-Port-to-RISC-V-64-bit-riscv64.patch 2018-04-06 20:40:00.933237852 +0200
+@@ -0,0 +1,98 @@
++diff -rupN Firebird-2.5.7.27050-0.orig/builds/posix/prefix.linux_riscv64 Firebird-2.5.7.27050-0/builds/posix/prefix.linux_riscv64
++--- Firebird-2.5.7.27050-0.orig/builds/posix/prefix.linux_riscv64 1970-01-01 01:00:00.000000000 +0100
+++++ Firebird-2.5.7.27050-0/builds/posix/prefix.linux_riscv64 2018-04-05 08:41:10.459514408 +0200
++@@ -0,0 +1,26 @@
+++# The contents of this file are subject to the Interbase Public
+++# License Version 1.0 (the "License"); you may not use this file
+++# except in compliance with the License. You may obtain a copy
+++# of the License at http://www.Inprise.com/IPL.html
+++#
+++# Software distributed under the License is distributed on an
+++# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+++# or implied. See the License for the specific language governing
+++# rights and limitations under the License.
+++#
+++# The Original Code was created by Inprise Corporation
+++# and its predecessors. Portions created by Inprise Corporation are
+++# Copyright (C) Inprise Corporation.
+++#
+++# All Rights Reserved.
+++# Contributor(s): ______________________________________.
+++# Start of file prefix.linux: $(VERSION) $(PLATFORM)
+++#
+++# Richard W.M. Jones, Red Hat Inc.
+++
+++WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable -Wno-invalid-offsetof -Wno-narrowing -Wno-unused-local-typedefs
+++
+++PROD_FLAGS=-O3 -DLINUX -DRISCV64 -pipe -p -MMD -fPIC -fsigned-char -fmessage-length=0
+++DEV_FLAGS=-ggdb -DLINUX -DRISCV64 -pipe -p -MMD -fPIC -Wall -fsigned-char -fmessage-length=0 $(WARN_FLAGS)
+++
+++CXXFLAGS := $(CXXFLAGS) -std=c++11
++diff -rupN Firebird-2.5.7.27050-0.orig/configure.in Firebird-2.5.7.27050-0/configure.in
++--- Firebird-2.5.7.27050-0.orig/configure.in 2018-04-05 08:39:49.919522041 +0200
+++++ Firebird-2.5.7.27050-0/configure.in 2018-04-05 08:42:22.818507550 +0200
++@@ -251,6 +251,18 @@ dnl CPU_TYPE=ppc64
++ SHRLIB_EXT=so
++ ;;
++
+++ riscv64*-*-linux*)
+++ MAKEFILE_PREFIX=linux_riscv64
+++ INSTALL_PREFIX=linux
+++ PLATFORM=LINUX
+++ AC_DEFINE(LINUX, 1, [Define this if OS is Linux])
+++ EDITLINE_FLG=Y
+++ SHRLIB_EXT=so
+++ STD_EDITLINE=true
+++ STD_ICU=true
+++ libdir=/usr/lib64
+++ ;;
+++
++ powerpc64le-*-linux*)
++ MAKEFILE_PREFIX=linux_powerpc64el
++ INSTALL_PREFIX=linux
++diff -rupN Firebird-2.5.7.27050-0.orig/src/jrd/common.h Firebird-2.5.7.27050-0/src/jrd/common.h
++--- Firebird-2.5.7.27050-0.orig/src/jrd/common.h 2018-04-05 08:39:49.923522041 +0200
+++++ Firebird-2.5.7.27050-0/src/jrd/common.h 2018-04-05 08:48:51.674470695 +0200
++@@ -200,7 +200,9 @@
++ #define IMPLEMENTATION isc_info_db_impl_linux_ppc64el /* 85 */
++ #endif /* PPC64EL */
++
++-
+++#ifdef __riscv
+++#define IMPLEMENTATION isc_info_db_impl_linux_riscv64 /* 86 */
+++#endif /* __riscv */
++
++ #endif /* LINUX */
++
++diff -rupN Firebird-2.5.7.27050-0.orig/src/jrd/inf_pub.h Firebird-2.5.7.27050-0/src/jrd/inf_pub.h
++--- Firebird-2.5.7.27050-0.orig/src/jrd/inf_pub.h 2018-04-05 08:39:49.931522040 +0200
+++++ Firebird-2.5.7.27050-0/src/jrd/inf_pub.h 2018-04-05 08:43:48.035499473 +0200
++@@ -218,6 +218,8 @@ enum info_db_implementations
++ isc_info_db_impl_linux_arm64 = 84,
++ isc_info_db_impl_linux_ppc64el = 85,
++
+++ isc_info_db_impl_linux_riscv64 = 86,
+++
++ isc_info_db_impl_last_value // Leave this LAST!
++ };
++
++diff -rupN Firebird-2.5.7.27050-0.orig/src/jrd/pag.cpp Firebird-2.5.7.27050-0/src/jrd/pag.cpp
++--- Firebird-2.5.7.27050-0.orig/src/jrd/pag.cpp 2018-04-05 08:39:49.927522040 +0200
+++++ Firebird-2.5.7.27050-0/src/jrd/pag.cpp 2018-04-06 20:37:56.333249661 +0200
++@@ -165,6 +165,7 @@ static const int CLASS_LINUX_HPPA = 40;
++ static const int CLASS_LINUX_ALPHA = 41; // LINUX/ALPHA
++ static const int CLASS_LINUX_ARM64 = 42; // LINUX/ARM64
++ static const int CLASS_LINUX_PPC64EL = 43; // LINUX/PowerPc64EL
+++static const int CLASS_LINUX_RISCV64 = 44; // LINUX/PowerPc64EL
++
++
++ static const int CLASS_MAX10 = CLASS_LINUX_AMD64; // This should not be changed, no new ports with ODS10
++@@ -338,6 +339,8 @@ const SSHORT CLASS = CLASS_LINUX_ALPHA;
++ const SSHORT CLASS = CLASS_LINUX_ARM64;
++ #elif defined(PPC64EL)
++ const SSHORT CLASS = CLASS_LINUX_PPC64EL;
+++#elif defined(__riscv)
+++const SSHORT CLASS = CLASS_LINUX_RISCV64;
++ #else
++ #error no support on other hardware for Linux
++ #endif
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-06 20:40:00.930237852 +0200
++++ b/PKGBUILD 2018-04-06 20:40:00.931237852 +0200
+@@ -9,19 +9,22 @@ pkgdesc="Client library for Firebird."
+ arch=('x86_64')
+ url="http://www.firebirdsql.org/"
+ license=('custom')
+-depends=('gcc-libs' 'icu')
++depends=('gcc-libs' 'icu' 'libatomic_ops')
+ options=('!makeflags')
+ source=(http://downloads.sourceforge.net/firebird/Firebird-$pkgver-0.tar.bz2
+ firebird-c++11.patch
+ firebird-c++14.patch
+- LICENSE)
++ LICENSE
++ 0001-Port-to-RISC-V-64-bit-riscv64.patch)
+ md5sums=('fb34241e96f9707604bf6cd78357d5a2'
+ '5094347a8298143ca147edd49b552fe9'
+ 'a02710203cee81b4f48b7bdca3b1b33f'
+- '0d61798861e159c85dbdf0f30fe2f2ce')
++ '0d61798861e159c85dbdf0f30fe2f2ce'
++ '8f364177ea80030ca6cb1bad2189c9ec')
+
+ prepare() {
+ cd $srcdir/Firebird-$pkgver-0
++ patch -Np1 -i ../0001-Port-to-RISC-V-64-bit-riscv64.patch
+ patch -Np1 -i ../firebird-c++11.patch
+ patch -Np0 -i ../firebird-c++14.patch
+ }
diff --git a/src/stage4/patches/libfontenc.patch b/src/stage4/patches/libfontenc.patch
new file mode 100644
index 0000000..cbca51f
--- /dev/null
+++ b/src/stage4/patches/libfontenc.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-04-04 00:37:07.332455802 +0200
++++ b/PKGBUILD 2018-04-04 08:22:28.712809487 +0200
+@@ -9,7 +9,7 @@ arch=('i686' 'x86_64')
+ url="https://xorg.freedesktop.org/"
+ license=('custom')
+ depends=('zlib')
+-makedepends=('pkgconfig' 'xproto>=7.0.18')
++makedepends=('pkgconfig' 'xorgproto')
+ source=(${url}/releases/individual/lib/${pkgname}-${pkgver}.tar.bz2{,.sig})
+ sha256sums=('70588930e6fc9542ff38e0884778fbc6e6febf21adbab92fd8f524fe60aefd21'
+ 'SKIP')
diff --git a/src/stage4/patches/libid3tag.patch b/src/stage4/patches/libid3tag.patch
new file mode 100644
index 0000000..8e629a7
--- /dev/null
+++ b/src/stage4/patches/libid3tag.patch
@@ -0,0 +1,42 @@
+diff -rupN a/0001-fix-compat-gperf-declarations.patch b/0001-fix-compat-gperf-declarations.patch
+--- a/0001-fix-compat-gperf-declarations.patch 1970-01-01 01:00:00.000000000 +0100
++++ b/0001-fix-compat-gperf-declarations.patch 2018-04-05 07:46:59.310822543 +0200
+@@ -0,0 +1,11 @@
++--- a/compat.h 2004-01-23 10:41:32.000000000 +0100
+++++ b/compat.h 2018-04-05 07:44:23.720837289 +0200
++@@ -34,7 +34,7 @@ struct id3_compat {
++ };
++
++ struct id3_compat const *id3_compat_lookup(register char const *,
++- register unsigned int);
+++ register size_t);
++
++ int id3_compat_fixup(struct id3_tag *);
++
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 07:46:59.308822543 +0200
++++ b/PKGBUILD 2018-04-05 07:46:59.309822543 +0200
+@@ -13,18 +13,21 @@ depends=('zlib')
+ makedepends=('gperf')
+ source=("ftp://ftp.mars.org/pub/mpeg/${pkgname}-${pkgver}.tar.gz"
+ 'id3tag.pc'
+- '10_utf16.diff' '11_unknown_encoding.diff' 'CVE-2008-2109.patch')
++ '10_utf16.diff' '11_unknown_encoding.diff' 'CVE-2008-2109.patch'
++ '0001-fix-compat-gperf-declarations.patch')
+ md5sums=('e5808ad997ba32c498803822078748c3'
+ '8bb41fd814fafcc37ec8bc88f5545a4a'
+ '4f9df4011e6a8c23240fff5de2d05f6e'
+ '3ca856b97924d48a0fdfeff0bd83ce7d'
+- 'c51822ea6301b1ca469975f0c9ee8e34')
++ 'c51822ea6301b1ca469975f0c9ee8e34'
++ 'cb6b886755e8a8e2020c7dea1d0b1cc0')
+
+ build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ patch -p1 -i ${srcdir}/10_utf16.diff
+ patch -p1 -i ${srcdir}/11_unknown_encoding.diff
+ patch -Np0 -i ${srcdir}/CVE-2008-2109.patch
++ patch -Np1 -i ${srcdir}/0001-fix-compat-gperf-declarations.patch
+
+ ./configure --prefix=/usr
+ make
diff --git a/src/stage4/patches/libjpeg-turbo-breakdeps.patch b/src/stage4/patches/libjpeg-turbo-breakdeps.patch
new file mode 100644
index 0000000..14e733c
--- /dev/null
+++ b/src/stage4/patches/libjpeg-turbo-breakdeps.patch
@@ -0,0 +1,19 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 13:54:15.289734031 +0200
++++ b/PKGBUILD 2018-04-05 13:54:15.290734031 +0200
+@@ -10,7 +10,6 @@ pkgdesc='JPEG image codec with accelerat
+ url='https://libjpeg-turbo.org/'
+ arch=('x86_64')
+ license=('custom')
+-makedepends=('nasm' 'jdk8-openjdk')
+ validpgpkeys=('7D6293CC6378786E1B5C496885C7044E033FDE16')
+ source=("https://downloads.sourceforge.net/project/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.sig})
+ sha256sums=('b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523'
+@@ -36,7 +35,6 @@ build() {
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --with-jpeg8 \
+- --with-java \
+ --with-build-date=$_build \
+
+ make
diff --git a/src/stage4/patches/libjpeg-turbo.patch b/src/stage4/patches/libjpeg-turbo.patch
new file mode 100644
index 0000000..dbdcfbc
--- /dev/null
+++ b/src/stage4/patches/libjpeg-turbo.patch
@@ -0,0 +1,20 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:07:49.768704028 +0200
++++ b/PKGBUILD 2018-04-05 08:07:49.769704028 +0200
+@@ -10,7 +10,7 @@ pkgdesc='JPEG image codec with accelerat
+ url='https://libjpeg-turbo.org/'
+ arch=('x86_64')
+ license=('custom')
+-makedepends=('nasm' 'jdk8-openjdk')
++makedepends=('nasm')
+ validpgpkeys=('7D6293CC6378786E1B5C496885C7044E033FDE16')
+ source=("https://downloads.sourceforge.net/project/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.sig})
+ sha256sums=('b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523'
+@@ -36,7 +36,6 @@ build() {
+ --prefix=/usr \
+ --mandir=/usr/share/man \
+ --with-jpeg8 \
+- --with-java \
+ --with-build-date=$_build \
+
+ make
diff --git a/src/stage4/patches/libtiff-breakdeps.patch b/src/stage4/patches/libtiff-breakdeps.patch
new file mode 100644
index 0000000..34322eb
--- /dev/null
+++ b/src/stage4/patches/libtiff-breakdeps.patch
@@ -0,0 +1,13 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-06 21:06:26.440087582 +0200
++++ b/PKGBUILD 2018-04-06 21:06:26.441087582 +0200
+@@ -9,8 +9,7 @@ arch=('x86_64')
+ url="http://www.simplesystems.org/libtiff/"
+ license=('custom')
+ depends=('libjpeg' 'zlib' 'xz')
+-makedepends=('freeglut' 'glu' 'mesa' 'jbigkit')
+-optdepends=('freeglut: for using tiffgt')
++makedepends=('jbigkit')
+ source=(http://download.osgeo.org/libtiff/tiff-${pkgver}.tar.gz)
+ sha256sums=('6e7bdeec2c310734e734d19aae3a71ebe37a4d842e0e23dbb1b8921c0026cfcd')
+
diff --git a/src/stage4/patches/linux-libre.patch b/src/stage4/patches/linux-libre.patch
index dae90de..5362a43 100644
--- a/src/stage4/patches/linux-libre.patch
+++ b/src/stage4/patches/linux-libre.patch
@@ -19,7 +19,7 @@
pkgbase=linux-libre # Build stock kernel
#pkgbase=linux-libre-custom # Build kernel with a different name
-_pkgbasever=4.15-gnu
--_pkgver=4.15.9-gnu
+-_pkgver=4.15.15-gnu
-
-_replacesarchkernel=('linux%') # '%' gets replaced with _kernelname
-_replacesoldkernels=() # '%' gets replaced with _kernelname
@@ -28,13 +28,12 @@
-_srcname=linux-${_pkgbasever%-*}
-_archpkgver=${_pkgver%-*}
-pkgver=${_pkgver//-/_}
--pkgrel=3
--rcnrel=armv7-x1
--arch=('i686' 'x86_64' 'armv7h')
+_srcname=linux-4.15
+pkgver=4.15.11
+pkgver+=_gnu
-+pkgrel=1
+ pkgrel=1
+-rcnrel=armv7-x1
+-arch=('i686' 'x86_64' 'armv7h')
+arch=('x86_64')
url="https://linux-libre.fsfla.org/"
license=('GPL2')
@@ -94,7 +93,7 @@
-sha512sums=('a55cc663c6fb1e1cfa7905282b368b5d5888bc2398f0acf37e5bb9a232ded04fd566b1980e654da26aaec005332e458581495184d6bd4cec669181085d4d78a5'
+sha256sums=('e6556514286f9cd6b46f5d5769b2cc3c61ac7d6fa9c9c400e3c2fb5949490186'
'SKIP'
-- '5b2ad5af70d432cf79eb11729ae39ed53e0b5b2a76688c35655c78538c1d0aa3852ad2c3244c2e0a4207d678919d806fa1903efdad6690e9679c9208d973bb73'
+- 'fe327c836db34fc9ea2e616d3cb57cd7a56b9de56e85ccb513936c926d178ba81669c1ebe3ba0599eb942a87a9883576c7e404aa33aa3968613f88c621563453'
+ '52005a49f68f683e12b407216476ea5dcc1c6511fc0a927b029793c253036427'
'SKIP'
- '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3'
@@ -114,11 +113,11 @@
'SKIP'
- '93cc2b304a116edb351d05a7b5c0a6b900fa4222474c26ac5dd15c754ddf0a0e2b7ec8bb40671fcb38c3be08c9279343456a3caf9d0b7ee4088b6afb4c465512'
- '0c90ff5cfe3ed0484603255437fb7b7d3450482ede164e139324c2761f3640797932b95e5d696b074c173ef472a5cdeca04c0a56198e54b47c9394f9efd94570'
-- 'bd88e3f19be54f764e4066a00ef4a8df0a3d02f43d09cc4dc0beb27dd1df7d6efbc38c4a9528216c08c4451050ceeb18553b86685eb4f059078964697fa75243'
+- '36e657c0a1c389b9f68afd0506116af8bb18ee58d2b846ab2176831b897c533bac703337644bf963879549a9fc45786b5b4b5e964305a934630d5c1fb3e8a39f'
- '7ad5be75ee422dda3b80edd2eb614d8a9181e2c8228cd68b3881e2fb95953bf2dea6cbe7900ce1013c9de89b2802574b7b24869fc5d7a95d3cc3112c4d27063a'
- '4a8b324aee4cccf3a512ad04ce1a272d14e5b05c8de90feb82075f55ea3845948d817e1b0c6f298f5816834ddd3e5ce0a0e2619866289f3c1ab8fd2f35f04f44'
- '2dc6b0ba8f7dbf19d2446c5c5f1823587de89f4e28e9595937dd51a87755099656f2acec50e3e2546ea633ad1bfd1c722e0c2b91eef1d609103d8abdc0a7cbaf'
-- 'b2d123b84b33dbdaea28c3ea4517f962f3b1ec9b5318ebf33a3a10138a421641d25762a859d588b2ccb05f17804b3dad3e2e16ad5cfcd6dc77bbfe81d1ef642a'
+- '7da8f3fbeb1b697f758ff6c09dd17384b931cebaa5f2f735998f8d30d088af3d6a1895dc741df3c94f3edaad80c01b588667558a82ed029ecec69dfa39706c16'
- 'SKIP'
- 'ba44aa1252aa1b172e0bc8bbbff864ff60cad6739b2aed2f6a2402848aa65cdb8a8ca6bb9341569b089d60dfd83c3bdd744b5810061ac76b19f0d337afe4cc8d'
- '738bc2874351d9e1b94319e6caf615b49753155c99dc9318a1ce9eced50f87627a7331762951f55e2bea8abdb97b80a617a08f3f0bc735e56ff831a8bbb19816'
diff --git a/src/stage4/patches/lynx.patch b/src/stage4/patches/lynx.patch
new file mode 100644
index 0000000..26ef5f7
--- /dev/null
+++ b/src/stage4/patches/lynx.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-04-04 18:02:02.433513726 +0200
++++ b/PKGBUILD 2018-04-04 18:13:56.226446075 +0200
+@@ -27,6 +27,7 @@ prepare() {
+
+ build() {
+ cd ${srcdir}/${pkgname}${pkgver//./-}
++ export CPPFLAGS="$CPPFLAGS -DNCURSES_INTERNALS"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --with-ssl=/usr \
diff --git a/src/stage4/patches/mariadb.patch b/src/stage4/patches/mariadb.patch
new file mode 100644
index 0000000..93a2e8a
--- /dev/null
+++ b/src/stage4/patches/mariadb.patch
@@ -0,0 +1,12 @@
+--- a/PKGBUILD 2018-04-04 07:50:18.882992391 +0200
++++ b/PKGBUILD 2018-04-04 07:52:20.382980876 +0200
+@@ -37,6 +37,9 @@ prepare() {
+ # mroonga after-merge CMakeLists.txt fixes
+ patch -Np1 -R < "${srcdir}"/0002-mroonga-after-merge-CMakeLists.txt-fixes.patch
+
++ # remove _init and _fini references from libmysql
++ sed -i '/ _\(init\|fini\)/d' libmysql/CMakeLists.txt
++
+ # let's create the datadir from tmpfiles
+ echo 'd @MYSQL_DATADIR@ 0700 @MYSQLD_USER@ @MYSQLD_USER@ -' >> support-files/tmpfiles.conf.in
+ }
diff --git a/src/stage4/patches/neon.patch b/src/stage4/patches/neon.patch
new file mode 100644
index 0000000..ff1d749
--- /dev/null
+++ b/src/stage4/patches/neon.patch
@@ -0,0 +1,14 @@
+--- a/PKGBUILD 2018-04-04 20:37:47.115628062 +0200
++++ b/PKGBUILD 2018-04-04 20:50:44.504554383 +0200
+@@ -12,9 +12,8 @@ url="http://www.webdav.org/neon/"
+ license=('GPL' 'LGPL')
+ depends=('krb5' 'expat' 'ca-certificates' 'zlib')
+ options=('libtool') # FS#16067
+-source=(http://www.webdav.org/${pkgname}/${pkgname}-${pkgver}.tar.gz{,.asc})
+-sha1sums=('d1c020f96731135263476ebaa72b2da07c4727cd'
+- 'SKIP')
++source=(http://www.webdav.org/${pkgname}/${pkgname}-${pkgver}.tar.gz)
++sha1sums=('d1c020f96731135263476ebaa72b2da07c4727cd')
+ validpgpkeys=('190555472DCC589BEF01609C608A86DF9833CC49') # Joe Orton
+
+ build() {
diff --git a/src/stage4/patches/nspr.patch b/src/stage4/patches/nspr.patch
new file mode 100644
index 0000000..b8332a0
--- /dev/null
+++ b/src/stage4/patches/nspr.patch
@@ -0,0 +1,157 @@
+--- a/PKGBUILD 2018-04-03 23:48:05.851734588 +0200
++++ b/PKGBUILD 2018-04-04 08:19:54.478824105 +0200
+@@ -11,12 +11,16 @@ arch=(x86_64)
+ license=(MPL GPL)
+ depends=(glibc sh)
+ makedepends=(zip)
+-source=(https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${pkgver}/src/nspr-${pkgver}.tar.gz)
+-sha1sums=('907221d51a1f8cca0c3a9e1af93c53e02f5e203b')
+-sha256sums=('2ed95917fa2277910d1d1cf36030607dccc0ba522bba08e2af13c113dcd8f729')
++source=(https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${pkgver}/src/nspr-${pkgver}.tar.gz
++ nspr-riscv-packaging.patch)
++sha1sums=('907221d51a1f8cca0c3a9e1af93c53e02f5e203b'
++ 'd6643bbae87696f67cb4b3caf5ac9bf159c68f95')
++sha256sums=('2ed95917fa2277910d1d1cf36030607dccc0ba522bba08e2af13c113dcd8f729'
++ '67e546550c872f2c5612eb3dfc5ad55831a37f3d7da5c1704b8efaeaab3a46e9')
+
+ prepare() {
+ cd nspr-$pkgver/nspr
++ patch -Np2 -i "$srcdir"/nspr-riscv-packaging.patch
+ }
+
+ build() {
+--- /dev/null 2018-03-20 11:36:27.102196685 +0100
++++ b/nspr-riscv-packaging.patch 2018-04-04 08:17:18.810838859 +0200
+@@ -0,0 +1,132 @@
++From d4b3321b5eeb7976a8ca2169128a3754e3b2a8bd Mon Sep 17 00:00:00 2001
++Add-type-definitions-for-the-RISC-V-architecture.patch
++From: Karsten Merker <merker@debian.org>
++Date: Fri, 9 Mar 2018 19:38:12 +0100
++Subject: [PATCH] Add type definitions for the RISC-V architecture.
++
++---
++ nspr/pr/include/md/_linux.cfg | 92 +++++++++++++++++++++++++++++++++++++++++++
++ nspr/pr/include/md/_linux.h | 4 ++
++ 2 files changed, 96 insertions(+)
++
++diff --git a/nspr/pr/include/md/_linux.cfg b/nspr/pr/include/md/_linux.cfg
++index b4c0ed4..afc407c 100644
++--- a/nspr/pr/include/md/_linux.cfg
+++++ b/nspr/pr/include/md/_linux.cfg
++@@ -1020,6 +1020,98 @@
++ #define PR_BYTES_PER_WORD_LOG2 2
++ #define PR_BYTES_PER_DWORD_LOG2 3
++
+++#elif defined(__riscv) && (__riscv_xlen == 32)
+++
+++#undef IS_BIG_ENDIAN
+++#define IS_LITTLE_ENDIAN 1
+++#undef IS_64
+++
+++#define PR_BYTES_PER_BYTE 1
+++#define PR_BYTES_PER_SHORT 2
+++#define PR_BYTES_PER_INT 4
+++#define PR_BYTES_PER_INT64 8
+++#define PR_BYTES_PER_LONG 4
+++#define PR_BYTES_PER_FLOAT 4
+++#define PR_BYTES_PER_DOUBLE 8
+++#define PR_BYTES_PER_WORD 4
+++#define PR_BYTES_PER_DWORD 8
+++
+++#define PR_BITS_PER_BYTE 8
+++#define PR_BITS_PER_SHORT 16
+++#define PR_BITS_PER_INT 32
+++#define PR_BITS_PER_INT64 64
+++#define PR_BITS_PER_LONG 32
+++#define PR_BITS_PER_FLOAT 32
+++#define PR_BITS_PER_DOUBLE 64
+++#define PR_BITS_PER_WORD 32
+++
+++#define PR_BITS_PER_BYTE_LOG2 3
+++#define PR_BITS_PER_SHORT_LOG2 4
+++#define PR_BITS_PER_INT_LOG2 5
+++#define PR_BITS_PER_INT64_LOG2 6
+++#define PR_BITS_PER_LONG_LOG2 5
+++#define PR_BITS_PER_FLOAT_LOG2 5
+++#define PR_BITS_PER_DOUBLE_LOG2 6
+++#define PR_BITS_PER_WORD_LOG2 5
+++
+++#define PR_ALIGN_OF_SHORT 2
+++#define PR_ALIGN_OF_INT 4
+++#define PR_ALIGN_OF_LONG 4
+++#define PR_ALIGN_OF_INT64 8
+++#define PR_ALIGN_OF_FLOAT 4
+++#define PR_ALIGN_OF_DOUBLE 8
+++#define PR_ALIGN_OF_POINTER 4
+++#define PR_ALIGN_OF_WORD 4
+++
+++#define PR_BYTES_PER_WORD_LOG2 2
+++#define PR_BYTES_PER_DWORD_LOG2 3
+++
+++#elif defined(__riscv) && (__riscv_xlen == 64)
+++
+++#undef IS_BIG_ENDIAN
+++#define IS_LITTLE_ENDIAN 1
+++#define IS_64
+++
+++#define PR_BYTES_PER_BYTE 1
+++#define PR_BYTES_PER_SHORT 2
+++#define PR_BYTES_PER_INT 4
+++#define PR_BYTES_PER_INT64 8
+++#define PR_BYTES_PER_LONG 8
+++#define PR_BYTES_PER_FLOAT 4
+++#define PR_BYTES_PER_DOUBLE 8
+++#define PR_BYTES_PER_WORD 8
+++#define PR_BYTES_PER_DWORD 8
+++
+++#define PR_BITS_PER_BYTE 8
+++#define PR_BITS_PER_SHORT 16
+++#define PR_BITS_PER_INT 32
+++#define PR_BITS_PER_INT64 64
+++#define PR_BITS_PER_LONG 64
+++#define PR_BITS_PER_FLOAT 32
+++#define PR_BITS_PER_DOUBLE 64
+++#define PR_BITS_PER_WORD 64
+++
+++#define PR_BITS_PER_BYTE_LOG2 3
+++#define PR_BITS_PER_SHORT_LOG2 4
+++#define PR_BITS_PER_INT_LOG2 5
+++#define PR_BITS_PER_INT64_LOG2 6
+++#define PR_BITS_PER_LONG_LOG2 6
+++#define PR_BITS_PER_FLOAT_LOG2 5
+++#define PR_BITS_PER_DOUBLE_LOG2 6
+++#define PR_BITS_PER_WORD_LOG2 6
+++
+++#define PR_ALIGN_OF_SHORT 2
+++#define PR_ALIGN_OF_INT 4
+++#define PR_ALIGN_OF_LONG 8
+++#define PR_ALIGN_OF_INT64 8
+++#define PR_ALIGN_OF_FLOAT 4
+++#define PR_ALIGN_OF_DOUBLE 8
+++#define PR_ALIGN_OF_POINTER 8
+++#define PR_ALIGN_OF_WORD 8
+++
+++#define PR_BYTES_PER_WORD_LOG2 3
+++#define PR_BYTES_PER_DWORD_LOG2 3
+++
++ #else
++
++ #error "Unknown CPU architecture"
++diff --git a/nspr/pr/include/md/_linux.h b/nspr/pr/include/md/_linux.h
++index b4b298b..2370ab8 100644
++--- a/nspr/pr/include/md/_linux.h
+++++ b/nspr/pr/include/md/_linux.h
++@@ -57,6 +57,10 @@
++ #define _PR_SI_ARCHITECTURE "m32r"
++ #elif defined(__or1k__)
++ #define _PR_SI_ARCHITECTURE "or1k"
+++#elif defined(__riscv) && (__riscv_xlen == 32)
+++#define _PR_SI_ARCHITECTURE "riscv32"
+++#elif defined(__riscv) && (__riscv_xlen == 64)
+++#define _PR_SI_ARCHITECTURE "riscv64"
++ #else
++ #error "Unknown CPU architecture"
++ #endif
++--
++2.11.0
++
diff --git a/src/stage4/patches/nss.patch b/src/stage4/patches/nss.patch
new file mode 100644
index 0000000..a60e0e2
--- /dev/null
+++ b/src/stage4/patches/nss.patch
@@ -0,0 +1,56 @@
+diff -rupN a/0001-nss-riscv-support.patch b/0001-nss-riscv-support.patch
+--- a/0001-nss-riscv-support.patch 1970-01-01 01:00:00.000000000 +0100
++++ b/0001-nss-riscv-support.patch 2018-04-05 08:28:21.522587285 +0200
+@@ -0,0 +1,22 @@
++--- a/nss/build.sh 2018-03-05 16:58:32.000000000 +0100
+++++ b/nss/build.sh 2018-04-05 07:27:59.516930570 +0200
++@@ -58,7 +58,7 @@ ninja_params=()
++
++ # try to guess sensible defaults
++ arch=$(python "$cwd"/coreconf/detect_host_arch.py)
++-if [ "$arch" = "x64" -o "$arch" = "aarch64" ]; then
+++if [ "$arch" = "x64" -o "$arch" = "aarch64" -o "$arch" = "riscv64" ]; then
++ build_64=1
++ elif [ "$arch" = "arm" ]; then
++ armhf=1
++--- a/nss/coreconf/config.gypi 2018-03-05 16:58:32.000000000 +0100
+++++ b/nss/coreconf/config.gypi 2018-04-05 08:25:11.442605301 +0200
++@@ -174,7 +174,7 @@
++ },
++ },
++ }],
++- [ 'target_arch=="arm64" or target_arch=="aarch64" or target_arch=="sparc64" or target_arch=="ppc64" or target_arch=="ppc64le" or target_arch=="s390x" or target_arch=="mips64"', {
+++ [ 'target_arch=="arm64" or target_arch=="aarch64" or target_arch=="sparc64" or target_arch=="ppc64" or target_arch=="ppc64le" or target_arch=="s390x" or target_arch=="mips64" or target_arch=="riscv64"', {
++ 'defines': [
++ 'NSS_USE_64',
++ ],
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:28:21.520587286 +0200
++++ b/PKGBUILD 2018-04-05 08:28:21.521587285 +0200
+@@ -14,14 +14,16 @@ depends=("nspr>=${_nsprver}" sqlite zlib
+ makedepends=(perl python2 xmlto docbook-xsl gyp)
+ options=(!strip !makeflags staticlibs)
+ source=("https://ftp.mozilla.org/pub/security/nss/releases/NSS_${pkgver//./_}_RTM/src/nss-${pkgver}.tar.gz"
+- certdata2pem.py bundle.sh nss.pc.in nss-config.in nss-config.xml enable-libpkix.patch)
++ certdata2pem.py bundle.sh nss.pc.in nss-config.in nss-config.xml enable-libpkix.patch
++ 0001-nss-riscv-support.patch)
+ sha256sums=('a33cc7b8299b5ce3acf03f617c7896932ae26927ff9fb7c71c1b69a200c30095'
+ '512b12a2f13129be62c008b4df0153f527dd7d71c2c5183de99dfa2a1c49dd8a'
+ '3bfadf722da6773bdabdd25bdf78158648043d1b7e57615574f189a88ca865dd'
+ 'f2208c4f70373ff9b60f53d733f8071d4e390c384b776dfc04bf26c306882faf'
+ 'e44ac5095b4d88f24ec7b2e6a9f1581560bd3ad41a3d198596d67ef22f67adb9'
+ '98ace873c63e8e870286bce3ed53249aa2655cc1f53e7049061476e650ab06f1'
+- '0b68c5ffbfeec090e950e5703e6b0519eafcb7eaf4fe2f64c355d0ddf17eed30')
++ '0b68c5ffbfeec090e950e5703e6b0519eafcb7eaf4fe2f64c355d0ddf17eed30'
++ '3f61d77d9fc596c600fbe5c4cd90cb52a90a74c81ff046200eb8e1a1fc5243fe')
+
+ prepare() {
+ mkdir certs path
+@@ -34,6 +36,7 @@ prepare() {
+
+ cd nss-$pkgver
+
++ patch -Np1 -i ../0001-nss-riscv-support.patch
+ patch -Np1 -i ../enable-libpkix.patch
+
+ ln -sr nss/lib/ckfw/builtins/certdata.txt ../certs/
diff --git a/src/stage4/patches/openexr.patch b/src/stage4/patches/openexr.patch
new file mode 100644
index 0000000..ba43fe0
--- /dev/null
+++ b/src/stage4/patches/openexr.patch
@@ -0,0 +1,27 @@
+--- a/PKGBUILD 2018-04-04 19:01:38.057174838 +0200
++++ b/PKGBUILD 2018-04-04 19:04:58.052155883 +0200
+@@ -12,7 +12,7 @@ url="http://www.$pkgname.com/"
+ arch=('i686' 'x86_64' 'armv7h')
+ license=('BSD3')
+ depends=('zlib' 'ilmbase')
+-makedepends=('unoconv' 'libepoxy')
++makedepends=('libepoxy')
+ replaces=("$_pkgname")
+ conflicts=("$_pkgname")
+ source=("https://repo.parabola.nu/other/${_pkgname}/${_pkgname}-${pkgver}.tar.gz")
+@@ -36,15 +36,6 @@ mksource() {
+
+ # remove documentation with embedded nonfree fonts
+ rm -rv "doc/"{InterpretingDeepPixels,MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction,TheoryDeepPixels}.pdf
+-
+- # add source documentation
+- install -m644 -v "${srcdir}/"{InterpretingDeepPixels.docx,{MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction}.odt} doc
+-
+- # convert source documentation to pdf format and clean source code
+- cd doc
+- unoconv -v -f pdf {InterpretingDeepPixels.docx,{MultiViewOpenEXR,OpenEXRFileLayout,ReadingAndWritingImageFiles,TechnicalIntroduction}.odt}
+- echo "acaboo"
+- rm -rv "${srcdir}/"{_rels,Configurations2,customXml,docProps,META-INF,ObjBFFFDCA{1,3,4,5,7},Object\ 1,ObjectReplacements,Pictures,Thumbnails,word}
+ }
+
+ prepare() {
diff --git a/src/stage4/patches/openssl-1.0.patch b/src/stage4/patches/openssl-1.0.patch
new file mode 100644
index 0000000..7f2b7e6
--- /dev/null
+++ b/src/stage4/patches/openssl-1.0.patch
@@ -0,0 +1,19 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 07:57:08.773764780 +0200
++++ b/PKGBUILD 2018-04-05 07:57:08.774764779 +0200
+@@ -48,11 +48,14 @@ build() {
+ elif [ "${CARCH}" == 'i686' ]; then
+ openssltarget='linux-elf'
+ optflags=''
++ elif [ "${CARCH}" == 'riscv64' ]; then
++ openssltarget='linux-elf'
++ optflags=''
+ fi
+
+ # mark stack as non-executable: http://bugs.archlinux.org/task/12434
+ ./Configure --prefix=/usr --openssldir=/etc/ssl --libdir=lib/openssl-1.0 \
+- shared no-ssl3-method ${optflags} \
++ shared no-ssl3-method no-asm ${optflags} \
+ "${openssltarget}" \
+ "-Wa,--noexecstack ${CPPFLAGS} ${CFLAGS} ${LDFLAGS}"
+
diff --git a/src/stage4/patches/orc.patch b/src/stage4/patches/orc.patch
new file mode 100644
index 0000000..05d19e8
--- /dev/null
+++ b/src/stage4/patches/orc.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-04-04 01:51:42.340031672 +0200
++++ b/PKGBUILD 2018-04-04 08:33:35.667746275 +0200
+@@ -11,7 +11,7 @@ url="https://cgit.freedesktop.org/gstrea
+ arch=(x86_64)
+ license=(custom)
+ depends=(glibc)
+-makedepends=(valgrind git gtk-doc meson)
++makedepends=(git gtk-doc meson)
+ _commit=31cb4bfc51de81b5c2569abdcff830b83c74499c # tags/orc-0.4.28^0
+ source=("git+https://anongit.freedesktop.org/git/gstreamer/orc#commit=$_commit")
+ sha256sums=('SKIP')
diff --git a/src/stage4/patches/pyqt5.patch b/src/stage4/patches/pyqt5.patch
new file mode 100644
index 0000000..3052d38
--- /dev/null
+++ b/src/stage4/patches/pyqt5.patch
@@ -0,0 +1,27 @@
+--- a/PKGBUILD 2018-04-04 11:14:02.585833861 +0200
++++ b/PKGBUILD 2018-04-04 16:55:29.948892123 +0200
+@@ -15,7 +15,7 @@ license=('GPL')
+ makedepends=('python-sip' 'python2-sip' 'python-opengl' 'python2-opengl'
+ 'python2-dbus' 'python-dbus' 'qt5-connectivity'
+ 'qt5-multimedia' 'qt5-tools' 'qt5-serialport' 'qt5-svg'
+- 'qt5-webengine' 'qt5-webkit' 'qt5-websockets' 'qt5-x11extras' 'qt5-networkauth')
++ 'qt5-webkit' 'qt5-websockets' 'qt5-x11extras' 'qt5-networkauth')
+ source=("http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-$pkgver/PyQt5_gpl-$pkgver.tar.gz" pyqt-support-new-qt.patch)
+ sha512sums=('04cd0292f7a088f9c0d088d7c73ec96cfc40253f771dfdf194eb92be7635e6fcaf04863fa24215e9c34a096658549bb2feeb8d8fdca1e39ed87f0256ef0f790b'
+ '9e4184291c0ece0bf375da3e0cf6e3f22df33eea1ee2b981fe9e2a0ba7d625583dd513c029c49562189986c0145262ac2aa8e5aa85701a981b3ed4061f4acf36')
+@@ -83,7 +83,6 @@ package_python-pyqt5(){
+ 'qt5-serialport: QtSerialPort'
+ 'qt5-websockets: QtWebSockets'
+ 'qt5-connectivity: QtNfc, QtBluetooth'
+- 'qt5-webengine: QtWebEngine, QtWebEngineCore, QtWebEngineWidgets'
+ 'qt5-x11extras: QtX11Extras'
+ 'qt5-networkauth: QtNetworkAuth')
+
+@@ -109,7 +108,6 @@ package_python2-pyqt5(){
+ 'qt5-serialport: QtSerialPort'
+ 'qt5-websockets: QtWebSockets'
+ 'qt5-connectivity: QtNfc, QtBluetooth'
+- 'qt5-webengine: QtWebEngine, QtWebEngineCore, QtWebEngineWidgets'
+ 'qt5-x11extras: QtX11Extras'
+ 'qt5-networkauth: QtNetworkAuth')
+
diff --git a/src/stage4/patches/python-lxml.patch b/src/stage4/patches/python-lxml.patch
new file mode 100644
index 0000000..bd1d890
--- /dev/null
+++ b/src/stage4/patches/python-lxml.patch
@@ -0,0 +1,12 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:15:25.879660799 +0200
++++ b/PKGBUILD 2018-04-05 08:15:25.879660799 +0200
+@@ -10,7 +10,7 @@ arch=('x86_64')
+ license=('BSD' 'custom')
+ url="http://lxml.de/"
+ makedepends=('libxslt' 'python-setuptools' 'python2-setuptools' 'epydoc' 'python2-pygments'
+- 'python2-docutils')
++ 'python2-docutils' 'cython' 'cython2')
+ checkdepends=('python-cssselect' 'python2-cssselect' 'python-html5lib' 'python2-html5lib'
+ 'python-beautifulsoup4' 'python2-beautifulsoup4' 'cython' 'cython2')
+ source=("https://github.com/lxml/lxml/archive/lxml-$pkgver.tar.gz")
diff --git a/src/stage4/patches/python-numpy.patch b/src/stage4/patches/python-numpy.patch
new file mode 100644
index 0000000..2b249b7
--- /dev/null
+++ b/src/stage4/patches/python-numpy.patch
@@ -0,0 +1,24 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:13:41.324670708 +0200
++++ b/PKGBUILD 2018-04-05 08:13:41.325670708 +0200
+@@ -15,12 +15,18 @@ url="http://www.numpy.org/"
+ makedepends=('cblas' 'lapack' 'python' 'python2' 'python-setuptools' 'python2-setuptools' 'gcc-fortran'
+ 'python-nose' 'python2-nose' 'cython' 'cython2')
+ options=('staticlibs')
+-source=("$pkgbase-$pkgver.tar.gz::https://github.com/numpy/numpy/archive/v$pkgver.tar.gz" 'site.cfg')
++source=("$pkgbase-$pkgver.tar.gz::https://github.com/numpy/numpy/archive/v$pkgver.tar.gz" 'site.cfg'
++ "http://oirase.annexia.org/tmp/numpy-add-riscv64.patch")
+ sha512sums=('65b10462011e033669b700f0688df2e8630a097323fc7d72e71549fdfc2258546fe6f1317e0d51e1a0c9ab86451e0998ccbc7daa9af690652a96034571d5b76b'
+- '03a0f161be4963625f110a26167efbd300a12bd4cf99c8250c47ac865466d03fc8640e7e4fb6a59c39bf8b797609f5ed50afbc720d1fcbd2c4c57263cf8b406b')
++ '03a0f161be4963625f110a26167efbd300a12bd4cf99c8250c47ac865466d03fc8640e7e4fb6a59c39bf8b797609f5ed50afbc720d1fcbd2c4c57263cf8b406b'
++ 'd8aed46906740527a0f9f501480c73616b1e38483db38a08009addbed4fa9ac786b65cf2e8ad125283373dc9577fa1227248c52b1bef96f617cc61a8dda4137c')
+
+ prepare() {
+ cp site.cfg numpy-$pkgver
++ cd numpy-$pkgver
++ patch -Np1 -i ../numpy-add-riscv64.patch
++ cd ..
++
+ cp -a numpy-$pkgver numpy-py2-$pkgver
+ cd numpy-py2-$pkgver
+
diff --git a/src/stage4/patches/r.patch b/src/stage4/patches/r.patch
new file mode 100644
index 0000000..f4beb2f
--- /dev/null
+++ b/src/stage4/patches/r.patch
@@ -0,0 +1,12 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 08:21:03.761628775 +0200
++++ b/PKGBUILD 2018-04-05 08:21:03.762628775 +0200
+@@ -13,7 +13,7 @@ url='https://www.r-project.org/'
+ depends=('blas' 'lapack' 'bzip2' 'libpng' 'libjpeg' 'libtiff'
+ 'ncurses' 'pcre' 'readline' 'zlib' 'perl' 'gcc-libs'
+ 'libxt' 'libxmu' 'pango' 'xz' 'zip' 'unzip' 'curl' 'icu')
+-makedepends=('jdk7-openjdk' 'gcc-fortran' 'tk')
++makedepends=('gcc-fortran' 'tk')
+ optdepends=('tk: tcl/tk interface' 'texlive-bin: latex sty files' 'gcc-fortran: needed to compile some CRAN packages')
+ backup=('etc/R/Makeconf' 'etc/R/Renviron' 'etc/R/ldpaths' 'etc/R/repositories' 'etc/R/javaconf')
+ options=('!makeflags' '!emptydirs')
diff --git a/src/stage4/patches/sqlite.patch b/src/stage4/patches/sqlite.patch
new file mode 100644
index 0000000..9b8a670
--- /dev/null
+++ b/src/stage4/patches/sqlite.patch
@@ -0,0 +1,11 @@
+--- a/PKGBUILD 2018-03-31 09:12:38.249279305 +0200
++++ b/PKGBUILD 2018-03-31 09:28:36.403188494 +0200
+@@ -3,7 +3,7 @@
+ # Contributor: Tom Newsom <Jeepster@gmx.co.uk>
+
+ pkgbase="sqlite"
+-pkgname=('sqlite' 'sqlite-tcl' 'sqlite-doc' 'sqlite-analyzer')
++pkgname=('sqlite' 'sqlite-tcl' 'sqlite-analyzer')
+ _srcver=3220000
+ _docver=${_srcver}
+ #_docver=3080001
diff --git a/src/stage4/patches/subversion.patch b/src/stage4/patches/subversion.patch
new file mode 100644
index 0000000..cf13d9c
--- /dev/null
+++ b/src/stage4/patches/subversion.patch
@@ -0,0 +1,43 @@
+--- a/PKGBUILD 2018-04-04 12:13:48.830493966 +0200
++++ b/PKGBUILD 2018-04-04 17:30:25.376693524 +0200
+@@ -13,13 +13,12 @@ arch=('x86_64')
+ url="http://subversion.apache.org/"
+ license=('APACHE')
+ depends=('sqlite' 'file' 'serf' 'systemd')
+-makedepends=('apache' 'python2' 'perl' 'swig' 'java-environment'
++makedepends=('apache' 'python2' 'perl' 'swig'
+ 'libgnome-keyring' 'kdelibs' 'ruby')
+ optdepends=('libgnome-keyring: for GNOME Keyring for auth credentials'
+ 'kdebase-runtime: for KWallet for auth credentials'
+ 'bash-completion: for svn bash completion'
+ 'python2: for some hook scripts'
+- 'java-environment: for Java support'
+ 'ruby: for some hook scripts')
+ provides=('svn')
+ backup=('etc/xinetd.d/svn' 'etc/conf.d/svnserve')
+@@ -59,7 +58,6 @@ build() {
+ ./configure --prefix=/usr --with-apr=/usr --with-apr-util=/usr \
+ --with-zlib=/usr --with-serf=/usr --with-apxs \
+ --with-sqlite=/usr \
+- --enable-javahl --with-jdk=/usr/lib/jvm/default \
+ --with-gnome-keyring --with-kwallet \
+ --with-apache-libexecdir=/usr/lib/httpd/modules \
+ --with-ruby-sitedir=/usr/lib/ruby/vendor_ruby \
+@@ -67,7 +65,7 @@ build() {
+
+ make LT_LDFLAGS="-L$Fdestdir/usr/lib"
+ make swig_pydir=/usr/lib/python2.7/site-packages/libsvn \
+- swig_pydir_extra=/usr/lib/python2.7/site-packages/svn swig-py swig-pl javahl swig-rb
++ swig_pydir_extra=/usr/lib/python2.7/site-packages/svn swig-py swig-pl swig-rb
+ }
+
+ check() {
+@@ -83,7 +81,7 @@ package() {
+ make DESTDIR="${pkgdir}" INSTALLDIRS=vendor \
+ swig_pydir=/usr/lib/python2.7/site-packages/libsvn \
+ swig_pydir_extra=/usr/lib/python2.7/site-packages/svn \
+- install install-swig-py install-swig-pl install-javahl install-swig-rb
++ install install-swig-py install-swig-pl install-swig-rb
+
+ install -dm755 "${pkgdir}"/usr/share/subversion
+ cp -a tools/hook-scripts "${pkgdir}"/usr/share/subversion/
diff --git a/src/stage4/patches/systemd.patch b/src/stage4/patches/systemd.patch
index 97523f9..62177a6 100644
--- a/src/stage4/patches/systemd.patch
+++ b/src/stage4/patches/systemd.patch
@@ -1,337 +1,22 @@
---- a/PKGBUILD 2018-03-23 22:23:45.957305112 +0100
-+++ b/PKGBUILD 2018-03-24 19:42:50.231346687 +0100
-@@ -53,7 +53,9 @@ source=('git+https://github.com/systemd/
- '0004-FSDG-os-release-Default-ID-to-gnu-linux-instead-of-l.patch'
- '0005-FSDG-systemd-resolved-Fallback-hostname-to-gnu-linux.patch'
- '0006-FSDG-man-Use-FSDG-operating-systems-as-examples.patch'
-- '0007-FSDG-bootctl-Say-Systemd-Boot-Manager-instead-of-Lin.patch')
-+ '0007-FSDG-bootctl-Say-Systemd-Boot-Manager-instead-of-Lin.patch'
-+ '0001-rename-noreturn-into-_noreturn_.patch'
-+ '0002-fix-linux-fs-h-and-sys-mount-h-collisions.patch')
- sha512sums=('SKIP'
- 'SKIP'
- '9348683829190628e25b7b3300fd880c426d555bde330d5fc5150a9a54b3ad9d4d1f2e69ea1dc6d6f086693dacc53c5af30f1fa7ad9b479791fd77bcdafa430e'
-@@ -80,7 +82,9 @@ sha512sums=('SKIP'
- 'fbcc54a62b6f3f7ec1dfad8317160c3057f145e542a423a2fd6b5c141012929aeb977491afe35b16c4903b5fd0d1469f3d87d1c8a036b4d6b623ac7dbe682ff5'
- '4e86eac4132d5bd712061d09c14141d91e6bfd2f3879a1fc4a92a15fa77d01552de5c9ebae4a67be2b2a54223a53f2538ba03d4fa0c96ecd1e62a4e8cf341fd1'
- 'b94fc1dee0707aec7c94a1e9e709f98a54018f94b44159b95b4a7fd01446bdd30a6b2d440926448c10a33e62092d6cf8e051ef27f26a369797bafbef093418bb'
-- '6a16666f18b7075a68733376f4b1fe34dd2aa29eaf43e693a98e303b9c5202317636816cb4a914d5141801026d1693dd4de2f79e0950aa777e8de6e4879cd9d0')
-+ '6a16666f18b7075a68733376f4b1fe34dd2aa29eaf43e693a98e303b9c5202317636816cb4a914d5141801026d1693dd4de2f79e0950aa777e8de6e4879cd9d0'
-+ 'c1f9d01a3f31c6f0858af3fc21dece4ef5e912946414b5700b1fa9d0307dd2fd81dced5e5ad2bcd7f446a7b5dba89a5c883883df86c9037778ddf39294e60aeb'
-+ '3228a6d2b2a070869c1dd3425055b60f7a8a6054650738e4e0548ef597e8d22117bbbe571f92fe165cd7d5016f8f1cf9ebf63299bad3e2061d4df96706659b19')
-
+--- a/PKGBUILD 2018-03-16 18:23:58.112034593 +0100
++++ b/PKGBUILD 2018-03-16 18:59:17.686017180 +0100
+@@ -85,6 +85,10 @@ sha512sums=('SKIP'
_backports=(
# core: do not free heap-allocated strings (#8391) (FS#57741)
-@@ -147,6 +151,11 @@ prepare() {
- # Replace cdrom/dialout/tape groups with optical/uucp/storage
- patch -Np1 -i ../0001-Use-Arch-device-access-groups.patch
+ '5cbaad2f6795088db56063d20695c6444595822f'
++ # basic/macros: rename noreturn into _noreturn_ (#8456)
++ '848e863acc51ecfb0f3955c498874588201d9130'
++ # core: don't include libmount.h in a header file (#8580)
++ '227b8a762fea1458547be2cdf0e6e4aac0079730'
+ )
+
+ _reverts=(
+@@ -261,7 +265,7 @@ package_systemd() {
+ rm -rv "$pkgdir"/etc/systemd/system/*
+
+ # we'll create this on installation
+- rmdir "$pkgdir"/var/log/journal/remote
++ rm -rf "$pkgdir"/var/log/journal/remote
-+ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893602
-+ patch -Np1 -i ../0001-rename-noreturn-into-_noreturn_.patch
-+ # https://github.com/systemd/systemd/issues/8507
-+ patch -Np1 -i ../0002-fix-linux-fs-h-and-sys-mount-h-collisions.patch
-+
- # apply FSDG patches
- local _patch
- for _patch in "$srcdir"/????-FSDG-*.patch; do
---- /dev/null 2018-03-21 10:59:45.661284739 +0100
-+++ b/0001-rename-noreturn-into-_noreturn_.patch 2018-03-24 19:42:11.766029988 +0100
-@@ -0,0 +1,198 @@
-+From 848e863acc51ecfb0f3955c498874588201d9130 Mon Sep 17 00:00:00 2001
-+From: Franck Bui <fbui@suse.com>
-+Date: Thu, 15 Mar 2018 06:23:46 +0100
-+Subject: [PATCH] basic/macros: rename noreturn into _noreturn_ (#8456)
-+MIME-Version: 1.0
-+Content-Type: text/plain; charset=UTF-8
-+Content-Transfer-Encoding: 8bit
-+
-+"noreturn" is reserved and can be used in other header files we include:
-+
-+ [ 16s] In file included from /usr/include/gcrypt.h:30:0,
-+ [ 16s] from ../src/journal/journal-file.h:26,
-+ [ 16s] from ../src/journal/journal-vacuum.c:31:
-+ [ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token
-+ [ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
-+
-+Here we include grcrypt.h (which in turns include gpg-error.h) *after* we
-+"noreturn" was defined in macro.h.
-+---
-+ src/basic/log.c | 4 ++--
-+ src/basic/log.h | 4 ++--
-+ src/basic/macro.h | 19 +++++++++----------
-+ src/basic/process-util.c | 2 +-
-+ src/basic/process-util.h | 2 +-
-+ src/core/main.c | 4 ++--
-+ src/journal/test-journal-interleaving.c | 2 +-
-+ src/shared/pager.c | 2 +-
-+ src/udev/collect/collect.c | 2 +-
-+ 9 files changed, 20 insertions(+), 21 deletions(-)
-+
-+diff --git a/src/basic/log.c b/src/basic/log.c
-+index 7a7f2cbec13..16a2431c548 100644
-+--- a/src/basic/log.c
-++++ b/src/basic/log.c
-+@@ -814,7 +814,7 @@ static void log_assert(
-+ log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
-+ }
-+
-+-noreturn void log_assert_failed_realm(
-++_noreturn_ void log_assert_failed_realm(
-+ LogRealm realm,
-+ const char *text,
-+ const char *file,
-+@@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm(
-+ abort();
-+ }
-+
-+-noreturn void log_assert_failed_unreachable_realm(
-++_noreturn_ void log_assert_failed_unreachable_realm(
-+ LogRealm realm,
-+ const char *text,
-+ const char *file,
-+diff --git a/src/basic/log.h b/src/basic/log.h
-+index efcf0f1bfc1..314be128a23 100644
-+--- a/src/basic/log.h
-++++ b/src/basic/log.h
-+@@ -186,7 +186,7 @@ int log_dump_internal(
-+ char *buffer);
-+
-+ /* Logging for various assertions */
-+-noreturn void log_assert_failed_realm(
-++_noreturn_ void log_assert_failed_realm(
-+ LogRealm realm,
-+ const char *text,
-+ const char *file,
-+@@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm(
-+ #define log_assert_failed(text, ...) \
-+ log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
-+
-+-noreturn void log_assert_failed_unreachable_realm(
-++_noreturn_ void log_assert_failed_unreachable_realm(
-+ LogRealm realm,
-+ const char *text,
-+ const char *file,
-+diff --git a/src/basic/macro.h b/src/basic/macro.h
-+index 95be63a2040..8911edfc4be 100644
-+--- a/src/basic/macro.h
-++++ b/src/basic/macro.h
-+@@ -53,6 +53,15 @@
-+ #else
-+ #define _fallthrough_
-+ #endif
-++/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
-++ * compiler versions */
-++#ifndef _noreturn_
-++#if __STDC_VERSION__ >= 201112L
-++#define _noreturn_ _Noreturn
-++#else
-++#define _noreturn_ __attribute__((noreturn))
-++#endif
-++#endif
-+
-+ /* Temporarily disable some warnings */
-+ #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
-+@@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
-+ #endif
-+ #endif
-+
-+-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
-+- * compiler versions */
-+-#ifndef noreturn
-+-#if __STDC_VERSION__ >= 201112L
-+-#define noreturn _Noreturn
-+-#else
-+-#define noreturn __attribute__((noreturn))
-+-#endif
-+-#endif
-+-
-+ #define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
-+ static inline void func##p(type *p) { \
-+ if (*p) \
-+diff --git a/src/basic/process-util.c b/src/basic/process-util.c
-+index aa9846db5dc..e6120af5b68 100644
-+--- a/src/basic/process-util.c
-++++ b/src/basic/process-util.c
-+@@ -987,7 +987,7 @@ bool is_main_thread(void) {
-+ return cached > 0;
-+ }
-+
-+-noreturn void freeze(void) {
-++_noreturn_ void freeze(void) {
-+
-+ log_close();
-+
-+diff --git a/src/basic/process-util.h b/src/basic/process-util.h
-+index 93029e36e5f..5170adec7bb 100644
-+--- a/src/basic/process-util.h
-++++ b/src/basic/process-util.h
-+@@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid);
-+
-+ bool is_main_thread(void);
-+
-+-noreturn void freeze(void);
-++_noreturn_ void freeze(void);
-+
-+ bool oom_score_adjust_is_valid(int oa);
-+
-+diff --git a/src/core/main.c b/src/core/main.c
-+index 076846a41c0..4b2d1492373 100644
-+--- a/src/core/main.c
-++++ b/src/core/main.c
-+@@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX;
-+ static sd_id128_t arg_machine_id = {};
-+ static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
-+
-+-noreturn static void freeze_or_reboot(void) {
-++_noreturn_ static void freeze_or_reboot(void) {
-+
-+ if (arg_crash_reboot) {
-+ log_notice("Rebooting in 10s...");
-+@@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) {
-+ freeze();
-+ }
-+
-+-noreturn static void crash(int sig) {
-++_noreturn_ static void crash(int sig) {
-+ struct sigaction sa;
-+ pid_t pid;
-+
-+diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
-+index 5a88b2774fa..d87bdbdd32a 100644
-+--- a/src/journal/test-journal-interleaving.c
-++++ b/src/journal/test-journal-interleaving.c
-+@@ -37,7 +37,7 @@
-+
-+ static bool arg_keep = false;
-+
-+-noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
-++_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
-+ log_internal(LOG_CRIT, error, file, line, func,
-+ "'%s' failed at %s:%u (%s): %m", text, file, line, func);
-+ abort();
-+diff --git a/src/shared/pager.c b/src/shared/pager.c
-+index 75db3c985bd..681af9c40e3 100644
-+--- a/src/shared/pager.c
-++++ b/src/shared/pager.c
-+@@ -47,7 +47,7 @@ static int stored_stderr = -1;
-+ static bool stdout_redirected = false;
-+ static bool stderr_redirected = false;
-+
-+-noreturn static void pager_fallback(void) {
-++_noreturn_ static void pager_fallback(void) {
-+ int r;
-+
-+ r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0);
-+diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
-+index 2821640e93b..c8fa47b3d7d 100644
-+--- a/src/udev/collect/collect.c
-++++ b/src/udev/collect/collect.c
-+@@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
-+ return container_of(node, struct _mate, node);
-+ }
-+
-+-noreturn static void sig_alrm(int signo)
-++_noreturn_ static void sig_alrm(int signo)
-+ {
-+ exit(4);
-+ }
---- /dev/null 2018-03-21 10:59:45.661284739 +0100
-+++ b/0002-fix-linux-fs-h-and-sys-mount-h-collisions.patch 2018-03-24 19:42:11.767029996 +0100
-@@ -0,0 +1,97 @@
-+From eb50b6d936c474f5bc2974c059f6432222af4de4 Mon Sep 17 00:00:00 2001
-+From: Karel Zak <kzak@redhat.com>
-+Date: Thu, 22 Mar 2018 12:50:45 +0100
-+Subject: [PATCH] Fix linux/fs.h and sys/mount.h collisions
-+
-+* (kernel-headers) linux/fs.h and (glibc) sys/mount.h contains MS_* constants
-+ and because it's without #ifdefs you cannot include the both files together
-+ in the same code
-+
-+* (systemd) src/basic/missing.h contains another copy of MS_* constants
-+
-+The patch removes local systemd MS_* fallbacks, cleanup fs.h and
-+mount.h include.
-+
-+Signed-off-by: Karel Zak <kzak@redhat.com>
-+---
-+ src/basic/missing.h | 40 ----------------------------------------
-+ src/core/load-fragment.c | 1 -
-+ src/shared/bus-unit-util.c | 2 ++
-+ 3 files changed, 2 insertions(+), 41 deletions(-)
-+
-+diff --git a/src/basic/missing.h b/src/basic/missing.h
-+index 567aea8da9c..6802dd27c7b 100644
-+--- a/src/basic/missing.h
-++++ b/src/basic/missing.h
-+@@ -524,46 +524,6 @@ struct btrfs_ioctl_quota_ctl_args {
-+ #define OCFS2_SUPER_MAGIC 0x7461636f
-+ #endif
-+
-+-#ifndef MS_MOVE
-+-#define MS_MOVE 8192
-+-#endif
-+-
-+-#ifndef MS_REC
-+-#define MS_REC 16384
-+-#endif
-+-
-+-#ifndef MS_PRIVATE
-+-#define MS_PRIVATE (1<<18)
-+-#endif
-+-
-+-#ifndef MS_REC
-+-#define MS_REC (1<<19)
-+-#endif
-+-
-+-#ifndef MS_SHARED
-+-#define MS_SHARED (1<<20)
-+-#endif
-+-
-+-#ifndef MS_RELATIME
-+-#define MS_RELATIME (1<<21)
-+-#endif
-+-
-+-#ifndef MS_KERNMOUNT
-+-#define MS_KERNMOUNT (1<<22)
-+-#endif
-+-
-+-#ifndef MS_I_VERSION
-+-#define MS_I_VERSION (1<<23)
-+-#endif
-+-
-+-#ifndef MS_STRICTATIME
-+-#define MS_STRICTATIME (1<<24)
-+-#endif
-+-
-+-#ifndef MS_LAZYTIME
-+-#define MS_LAZYTIME (1<<25)
-+-#endif
-+-
-+ #ifndef SCM_SECURITY
-+ #define SCM_SECURITY 0x03
-+ #endif
-+diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
-+index 94605ab0d02..49f8a8c6da1 100644
-+--- a/src/core/load-fragment.c
-++++ b/src/core/load-fragment.c
-+@@ -21,7 +21,6 @@
-+
-+ #include <errno.h>
-+ #include <fcntl.h>
-+-#include <linux/fs.h>
-+ #include <linux/oom.h>
-+ #if HAVE_SECCOMP
-+ #include <seccomp.h>
-+diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
-+index 23e05daf48c..6e7ea10e714 100644
-+--- a/src/shared/bus-unit-util.c
-++++ b/src/shared/bus-unit-util.c
-+@@ -52,6 +52,8 @@
-+ #include "utf8.h"
-+ #include "util.h"
-+
-++#include <sys/mount.h>
-++
-+ int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u) {
-+ assert(message);
-+ assert(u);
+ # executable (symlinks) shipped with systemd-sysvcompat
+ rm "$pkgdir"/usr/bin/{halt,init,poweroff,reboot,runlevel,shutdown,telinit}
diff --git a/src/stage4/patches/vala-breakdeps.patch b/src/stage4/patches/vala-breakdeps.patch
new file mode 100644
index 0000000..2efb73a
--- /dev/null
+++ b/src/stage4/patches/vala-breakdeps.patch
@@ -0,0 +1,52 @@
+diff -rupN a/PKGBUILD b/PKGBUILD
+--- a/PKGBUILD 2018-04-05 20:31:07.519477171 +0200
++++ b/PKGBUILD 2018-04-05 20:31:07.520477171 +0200
+@@ -10,40 +10,27 @@ pkgdesc="Compiler for the GObject type s
+ url="https://wiki.gnome.org/Projects/Vala"
+ arch=(x86_64)
+ license=(LGPL)
+-depends=(glib2 gtk-doc graphviz ttf-font pkg-config gcc)
+-makedepends=(libxslt vala git help2man)
++depends=(glib2 gtk-doc ttf-font pkg-config gcc)
++makedepends=(libxslt git help2man)
+ checkdepends=(dbus libx11 gobject-introspection)
+ provides=(valadoc)
+ conflicts=(valadoc)
+ replaces=(valadoc)
+ _commit=3a11e70aefae4f2344b6352440e82cab0963f4f7 # tags/0.40.2^0
+-source=("git+https://git.gnome.org/browse/vala#commit=$_commit")
++source=("git://git.gnome.org/vala-bootstrap")
+ sha256sums=('SKIP')
+
+-pkgver() {
+- cd $pkgname
+- git describe --tags | sed 's/-/+/g'
+-}
+-
+-prepare() {
+- cd $pkgname
+- NOCONFIGURE=1 ./autogen.sh
+-}
+-
+ build() {
+- cd $pkgname
+- ./configure --prefix=/usr
++ cd $pkgname-bootstrap
++ ./autogen.sh
++ ./configure --prefix=/usr --disable-build-from-vala \
++ --disable-vapigen --disable-silent-rules
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+ }
+
+-check() {
+- cd $pkgname
+- make check
+-}
+-
+ package() {
+- cd $pkgname
++ cd $pkgname-bootstrap
+ make DESTDIR="$pkgdir" install
+ }
+
diff --git a/src/stage4/patches/vid.stab.patch b/src/stage4/patches/vid.stab.patch
new file mode 100644
index 0000000..7923a12
--- /dev/null
+++ b/src/stage4/patches/vid.stab.patch
@@ -0,0 +1,12 @@
+--- a/PKGBUILD 2018-04-04 11:40:28.747683529 +0200
++++ b/PKGBUILD 2018-04-04 17:23:24.062733455 +0200
+@@ -24,6 +24,9 @@ prepare() {
+ rm -rf build
+ fi
+ mkdir build
++
++ # disable sse support
++ sed -i '/FindSSE/d' CMakeLists.txt
+ }
+
+ build() {
diff --git a/src/stage4/patches/vulkan-loader-layers.patch b/src/stage4/patches/vulkan-loader-layers.patch
new file mode 100644
index 0000000..64580ea
--- /dev/null
+++ b/src/stage4/patches/vulkan-loader-layers.patch
@@ -0,0 +1,18 @@
+--- a/PKGBUILD 2018-04-04 19:52:04.012888046 +0200
++++ b/PKGBUILD 2018-04-04 20:28:28.093681044 +0200
+@@ -14,10 +14,14 @@ makedepends=(git cmake python-lxml libx1
+ source=("https://github.com/KhronosGroup/${_pkgname}/archive/sdk-${pkgver}.tar.gz")
+ sha256sums=('bd30ffe25a0723775ea8427d65e96bbad6f5130674ac6577ec639b54ce811397')
+
+-build() {
++prepare() {
+ cd "${srcdir}/${_pkgname}-sdk-${pkgver}"
+
+ ./update_external_sources.sh
++}
++
++build() {
++ cd "${srcdir}/${_pkgname}-sdk-${pkgver}"
+
+ rm -rf build ; mkdir build ; cd build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
diff --git a/src/stage4/patches/webrtc-audio-processing.patch b/src/stage4/patches/webrtc-audio-processing.patch
new file mode 100644
index 0000000..ca9977d
--- /dev/null
+++ b/src/stage4/patches/webrtc-audio-processing.patch
@@ -0,0 +1,40 @@
+--- a/PKGBUILD 2018-04-04 01:48:45.544048429 +0200
++++ b/PKGBUILD 2018-04-04 08:31:13.560759744 +0200
+@@ -11,8 +11,10 @@ license=(custom)
+ depends=(gcc-libs)
+ makedepends=(git)
+ _commit=fc0e76139404e08cc5b8024daafa1ddf576a4e21 # tags/v0.3^0
+-source=("git+https://anongit.freedesktop.org/git/pulseaudio/webrtc-audio-processing#commit=$_commit")
+-sha256sums=('SKIP')
++source=("git+https://anongit.freedesktop.org/git/pulseaudio/webrtc-audio-processing#commit=$_commit"
++ "webrtc-audio-processing-riscv.patch")
++sha256sums=('SKIP'
++ '4eaed1caef3af5995f52044692c111e5fccd6209b16ab78847e28d4ae51256a1')
+
+ pkgver() {
+ cd $pkgname
+@@ -21,6 +23,7 @@ pkgver() {
+
+ prepare() {
+ cd $pkgname
++ patch -Np1 -i ../webrtc-audio-processing-riscv.patch
+ NOCONFIGURE=1 ./autogen.sh
+ }
+
+--- /dev/null 2018-03-20 11:36:27.102196685 +0100
++++ b/webrtc-audio-processing-riscv.patch 2018-04-04 08:30:10.946765678 +0200
+@@ -0,0 +1,14 @@
++diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
++index d875490..ed1e9a4 100644
++--- a/webrtc/typedefs.h
+++++ b/webrtc/typedefs.h
++@@ -47,6 +47,9 @@
++ #elif defined(__pnacl__)
++ #define WEBRTC_ARCH_32_BITS
++ #define WEBRTC_ARCH_LITTLE_ENDIAN
+++#elif defined(__riscv)
+++#define WEBRTC_ARCH_64_BITS
+++#define WEBRTC_ARCH_LITTLE_ENDIAN
++ #else
++ #error Please add support for your architecture in typedefs.h
++ #endif
diff --git a/src/stage4/patches/zstd.patch b/src/stage4/patches/zstd.patch
new file mode 100644
index 0000000..bab7b1b
--- /dev/null
+++ b/src/stage4/patches/zstd.patch
@@ -0,0 +1,10 @@
+--- a/PKGBUILD 2018-04-04 18:44:37.262271586 +0200
++++ b/PKGBUILD 2018-04-04 18:51:04.978234839 +0200
+@@ -17,6 +17,7 @@ sha1sums=('4bbdc23ab3d4fa18b3b7bd84900b7
+
+ build() {
+ cd $pkgname-$pkgver
++ export LDFLAGS="$LDFLAGS -latomic"
+ make
+ make zstdmt
+ make -C contrib/pzstd
diff --git a/src/stage4/stage4.sh b/src/stage4/stage4.sh
index 682c0e5..d8304f6 100644
--- a/src/stage4/stage4.sh
+++ b/src/stage4/stage4.sh
@@ -24,47 +24,65 @@
. "$TOPSRCDIR"/stage4/chroot.sh
stage4_makepkg() {
- package_fetch_upstream_pkgfiles "$1" || return
- package_import_keys "$1" || return
- package_patch "$1" || return
+ local pkgname="${1%-breakdeps}"
+ local prefix=()
+ [ "x$1" != "x$pkgname" ] && prefix=(-r -p breakdeps)
+
+ package_fetch_upstream_pkgfiles "$pkgname" || return
+ package_import_keys "$pkgname" || return
+ package_patch "${prefix[@]}" "$pkgname" || return
# substitute common variables
sed "s#@MULTILIB@#${MULTILIB:-disable}#g" \
PKGBUILD.in > PKGBUILD
+ # prepare the pkgbuild
package_enable_arch "$CARCH"
+ echo "checkdepends=()" >> PKGBUILD
# check built dependencies
local dep
for dep in $(srcinfo_builddeps -n); do
deptree_check_depend "$1" "$dep" || return
done
- for dep in $(srcinfo_rundeps "$1"); do
+ for dep in $(srcinfo_rundeps "$pkgname"); do
deptree_check_depend "$1" "$dep" || return
done
- # postpone build if necessary
- deptree_is_satisfyable "$1" || return 0
+ if ! deptree_is_satisfyable "$1"; then
+ # add a temporary -breakdeps build, if a patch exists
+ if [ "x$1" == "x$pkgname" ] && package_has_patch -p breakdeps "$1"; then
+ deptree_add_entry "$1-breakdeps" "$1"
+ sed -i "s/ $pkgname / $pkgname-breakdeps /g" "$DEPTREE"
+ fi
+ # postpone actual build
+ return 0
+ fi
# don't rebuild if already exists
check_pkgfile "$PKGPOOL" "$1" && return
- # disable checkdepends
- echo "checkdepends=()" >> PKGBUILD
+ # prepare the chroot
+ yes | librechroot \
+ -n "$CHOST-stage4" \
+ -C "$BUILDDIR"/config/pacman.conf \
+ -M "$BUILDDIR"/config/makepkg.conf \
+ run pacman -Scc || return
- # regular build otherwise
+ # build the package
"$BUILDDIR/libremakepkg-$CARCH.sh" -n "$CHOST"-stage4 || return
}
stage4_package_build() {
+ local pkgname="${1%-breakdeps}"
local pkgarch
- pkgarch=$(pkgarch "$1") || return
+ pkgarch=$(pkgarch "$pkgname") || return
# clean staging
rm -f "$PKGDEST"/*
- if [ "x$pkgarch" == "xany" ] || [ "x$1" == "xca-certificates-mozilla" ]; then
- package_reuse_upstream "$1" || return
+ if [ "x$pkgarch" == "xany" ]; then
+ package_reuse_upstream "$pkgname" || return
else
stage4_makepkg "$1" || return
fi
@@ -72,31 +90,49 @@ stage4_package_build() {
# postpone on unmet dependencies
deptree_is_satisfyable "$1" || return 0
- # release the package
- local pkgfile pkgname pkgrepo
- for pkgfile in "$PKGDEST"/*; do
- pkgname="${pkgfile%-*-*-*}"
- pkgrepo=$(package_get_upstream_repo "$pkgname")
- pushd "$PKGDEST/../$pkgrepo/os/$CARCH" >/dev/null || return
-
- ln -fs ../../../pool/"$(basename "$pkgfile")" "$(basename "$pkgfile")"
- mv "$pkgfile" "$PKGPOOL"
- repo-add -qR "$pkgrepo.db.tar.gz" "$(basename "$pkgfile")"
+ # release built packages
+ shopt -s nullglob
+ local pkgfiles=("$PKGDEST"/*)
+ shopt -u nullglob
+
+ local file name repo
+ for file in "${pkgfiles[@]}"; do
+ file="$(basename "$file")"
+ name="${file%-*-*-*}"
+ echo -n "checking for $name upstream repo ..."
+ repo=$(package_get_upstream_repo "$name")
+ echo "$repo"
+
+ if [ "x$1" != "x$pkgname" ]; then
+ mv "$PKGDEST/$file" "$PKGDEST/${file/$name/$name-breakdeps}" || return
+ file="${file/$name/$name-breakdeps}"
+ name="$name-breakdeps"
+ else
+ rm -f "$PKGPOOL/${file/$name/$name-breakdeps}" \
+ "$PKGPOOL/../$repo/os/$CARCH/${file/$name/$name-breakdeps}"
+ fi
+
+ pushd "$PKGDEST/../$repo/os/$CARCH" >/dev/null || return
+
+ ln -fs ../../../pool/"$file" "$file" || return
+ mv "$PKGDEST/$file" "$PKGPOOL" || return
+ repo-add -q -R "$repo.db.tar.gz" "$PKGPOOL/$file" || return
popd >/dev/null || return
done
}
stage4_package_install() {
- local pkgfile
- pkgfile=$(find "$PKGPOOL" -regex "^.*/$1-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$" | head -n1)
- [ -n "$pkgfile" ] || { error "$1: pkgfile not found"; return "$ERROR_MISSING"; }
+ local esc pkgfile
+ esc=$(printf '%s\n' "$1" | sed 's:[][\/.+^$*]:\\&:g')
+ pkgfile=$(find "$PKGPOOL" -regex "^.*/$esc-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$" | head -n1)
+ [ -n "$pkgfile" ] || { error -n "$1: pkgfile not found"; return "$ERROR_MISSING"; }
yes | librechroot \
-n "$CHOST-stage4" \
-C "$BUILDDIR"/config/pacman.conf \
-M "$BUILDDIR"/config/makepkg.conf \
- run pacman -Udd /repos/pool/"$(basename "$pkgfile")" || return
+ run pacman -U /repos/pool/"$(basename "$pkgfile")" || return
yes | librechroot \
-n "$CHOST-stage4" \
-C "$BUILDDIR"/config/pacman.conf \
@@ -123,17 +159,17 @@ stage4() {
binfmt_enable
+ prepare_deptree "${groups[@]}" || die -e "$ERROR_BUILDFAIL" "failed to prepare DEPTREE"
+ echo "remaining pkges: $(wc -l < "$DEPTREE") / $(wc -l < "$DEPTREE".FULL)"
+ [ -s "$DEPTREE" ] || return 0
+
prepare_stage4_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
prepare_stage4_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
- prepare_deptree "${groups[@]}" || die -e "$ERROR_BUILDFAIL" "failed to prepare DEPTREE"
- echo "remaining pkges: $(wc -l < "$DEPTREE") / $(wc -l < "$DEPTREE".FULL)"
- if [ -s "$DEPTREE" ]; then
- check_exe -r librechroot libremakepkg
+ check_exe -r librechroot libremakepkg
- # build packages from deptree
- packages_build_all stage4_package_build stage4_package_install || return
- fi
+ # build packages from deptree
+ packages_build_all stage4_package_build stage4_package_install || return
# cleanup
umount_stage4_chrootdir