From f5a23cc275ceba4a4904afe409585d3776e377e3 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Wed, 17 Jun 2015 13:28:56 +0200 Subject: [PATCH 1/6] New package: binfmt-support-2.1.5 --- .../binfmt-support/files/binfmt-support/finish | 2 ++ .../binfmt-support/files/binfmt-support/run | 3 +++ srcpkgs/binfmt-support/template | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 srcpkgs/binfmt-support/files/binfmt-support/finish create mode 100644 srcpkgs/binfmt-support/files/binfmt-support/run create mode 100644 srcpkgs/binfmt-support/template diff --git a/srcpkgs/binfmt-support/files/binfmt-support/finish b/srcpkgs/binfmt-support/files/binfmt-support/finish new file mode 100644 index 00000000000..908d0ebedcb --- /dev/null +++ b/srcpkgs/binfmt-support/files/binfmt-support/finish @@ -0,0 +1,2 @@ +#!/bin/sh +exec update-binfmts --disable diff --git a/srcpkgs/binfmt-support/files/binfmt-support/run b/srcpkgs/binfmt-support/files/binfmt-support/run new file mode 100644 index 00000000000..3c4d89207d9 --- /dev/null +++ b/srcpkgs/binfmt-support/files/binfmt-support/run @@ -0,0 +1,3 @@ +#!/bin/sh +update-binfmts --enable +exec chpst -b binfmt-support pause diff --git a/srcpkgs/binfmt-support/template b/srcpkgs/binfmt-support/template new file mode 100644 index 00000000000..a1cf78bef90 --- /dev/null +++ b/srcpkgs/binfmt-support/template @@ -0,0 +1,18 @@ +# Template file for 'binfmt-support' +pkgname=binfmt-support +version=2.1.5 +revision=1 +build_style=gnu-configure +hostmakedepends="pkg-config" +makedepends="libpipeline-devel" +short_desc="Register interpreters for various binary formats" +maintainer="Andrea Brancaleoni " +license="GPL-3" +homepage="http://packages.debian.org/en/sid/binfmt-support" +distfiles="${DEBIAN_SITE}/main/b/binfmt-support/binfmt-support_$version.orig.tar.gz" +checksum=4896f6bf86b0d918025bb88718f89923a4cf8c25f37c07cd76ebb75c52f9e8eb + +post_install() { + rm -r ${DESTDIR}/etc/init + vsv binfmt-support +} From 359830c45cbebe18941322c9f08889108394086c Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Thu, 18 Jun 2015 10:31:08 +0200 Subject: [PATCH 2/6] xbps-trigger: added binfmts --- srcpkgs/xbps-triggers/files/binfmts | 58 +++++++++++++++++++++++++++++ srcpkgs/xbps-triggers/template | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100755 srcpkgs/xbps-triggers/files/binfmts diff --git a/srcpkgs/xbps-triggers/files/binfmts b/srcpkgs/xbps-triggers/files/binfmts new file mode 100755 index 00000000000..596e0c5d103 --- /dev/null +++ b/srcpkgs/xbps-triggers/files/binfmts @@ -0,0 +1,58 @@ +#!/bin/sh +# +# binfmts trigger. +# +# Binaries can be specified like: +# binfmts=" [ ...]" +# +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] +# +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + +export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin" + +case "$ACTION" in +targets) + echo "post-install pre-remove" + ;; +run) + [ -x /usr/bin/update-binfmts ] || exit 0 + [ -z "${binfmts}" ] && exit 0 + + case "$TARGET" in + post-install) + echo "${binfmts}" | while read line; do + set -- ${line} + _bin="$1"; shift; _args="$@"; _bname="$(basename ${_bin})" + update-binfmts --package ${PKGNAME} --install ${_bname} ${_bin} ${_args} + done + ;; + pre-remove) + echo "${binfmts}" | while read line; do + set -- ${line} + _bin="$1"; shift; _args="$@"; _bname="$(basename ${_bin})" + if [ -f /var/lib/binfmts/${_bname} ]; then + update-binfmts --package ${PKGNAME} --remove ${_bname} ${_bin} + fi + done + ;; + *) + exit 1 + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 +# end diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index 825357859aa..c52d5517dbc 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -1,6 +1,6 @@ # Template file for 'xbps-triggers' pkgname=xbps-triggers -version=0.99 +version=0.100 revision=1 noarch=yes bootstrap=yes From be90180b48736d441e8b8be0f1775325cb41f229 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Sat, 20 Jun 2015 18:46:22 +0200 Subject: [PATCH 3/6] environment/setup-subpkg/subpkg.sh: add binfmts trigger support --- common/environment/setup-subpkg/subpkg.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/environment/setup-subpkg/subpkg.sh b/common/environment/setup-subpkg/subpkg.sh index 2733df4d20c..afa3efd34fc 100644 --- a/common/environment/setup-subpkg/subpkg.sh +++ b/common/environment/setup-subpkg/subpkg.sh @@ -40,3 +40,6 @@ unset -v systemd_services # xbps-triggers: mkdirs unset -v make_dirs + +# xbps-triggers: binfmts +unset -v binfmts From 972a87ba9f7b24a453ff52d205d805f93f2af0ca Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Sat, 20 Jun 2015 18:51:58 +0200 Subject: [PATCH 4/6] hooks/post-install/04-create-xbps-metadata-scripts.sh: add binfmts trigger support --- .../hooks/post-install/04-create-xbps-metadata-scripts.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh index 948b851a84b..d5e62b6aefc 100644 --- a/common/hooks/post-install/04-create-xbps-metadata-scripts.sh +++ b/common/hooks/post-install/04-create-xbps-metadata-scripts.sh @@ -117,6 +117,13 @@ _EOF echo "export make_dirs=\"${make_dirs}\"" >> $tmpf fi # + # Handle binfmts trigger + # + if [ -n "${binfmts}" ]; then + _add_trigger binfmts + echo "export binfmts=\"${binfmts}\"" >> $tmpf + fi + # # Handle systemd services. # if [ -n "$build_option_systemd" ]; then From c49b38976310b433d915519107aed3c6ba5598e9 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Sat, 20 Jun 2015 18:59:38 +0200 Subject: [PATCH 5/6] wine: added binfmts trigger --- srcpkgs/wine/template | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/srcpkgs/wine/template b/srcpkgs/wine/template index 199dd7c3329..62d6f42a8e0 100644 --- a/srcpkgs/wine/template +++ b/srcpkgs/wine/template @@ -1,7 +1,7 @@ # Template file for 'wine' pkgname=wine version=1.7.45 -revision=4 +revision=5 build_style=gnu-configure configure_args="--without-gstreamer" short_desc="Run Microsoft Windows applications" @@ -27,6 +27,8 @@ makedepends="gettext-devel lcms2-devel zlib-devel ncurses-devel depends="libXi libXinerama libXcomposite libXcursor libOSMesa desktop-file-utils hicolor-icon-theme liberation-fonts-ttf" +binfmts="/usr/bin/wine --magic MZ" + build_options="staging d3d9" desc_option_staging="Enable wine-staging patchset" desc_option_d3d9="Enable d3d9 state tracker patchset" From 23edd21207f091cbe6b200b066706c5b71c9feb5 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Mon, 22 Jun 2015 15:26:53 +0200 Subject: [PATCH 6/6] qemu-user-static: added binfmts trigger --- srcpkgs/qemu-user-static/template | 70 ++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/srcpkgs/qemu-user-static/template b/srcpkgs/qemu-user-static/template index a469d94bbe2..065448e8054 100644 --- a/srcpkgs/qemu-user-static/template +++ b/srcpkgs/qemu-user-static/template @@ -1,7 +1,7 @@ # Template file for 'qemu-user-static' pkgname=qemu-user-static version=2.2.1 -revision=1 +revision=2 wrksrc="qemu-${version}" hostmakedepends="pkg-config automake python" makedepends="libglib-devel pixman-devel libuuid-devel" @@ -12,6 +12,72 @@ license="GPL-2, LGPL-2.1" distfiles="http://wiki.qemu.org/download/qemu-${version}.tar.bz2" checksum=4617154c6ef744b83e10b744e392ad111dd351d435d6563ce24d8da75b1335a0 +_fmts="aarch64 alpha arm armeb cris i386 m68k microblaze mips mipsel mips64 mips64el ppc ppc64 ppc64abi32 ppc64le s390x sh4 sh4eb sparc sparc32plus sparc64 x86_64" + +_aarch64_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7' +_aarch64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_alpha_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90' +_alpha_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_arm_magic='\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00' +_arm_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_armeb_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28' +_armeb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_cris_magic='\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x4c\x00' +_cris_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_i386_magic='\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00' +_i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_m68k_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04' +_m68k_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_microblaze_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\xba\xab' +_microblaze_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_mips_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08' +_mips_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_mipsel_magic='\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00' +_mipsel_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_mips64_magic='\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08' +_mips64_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_mips64el_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00' +_mips64el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xfe\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_ppc_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14' +_ppc_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_ppc64_magic='\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15' +_ppc64_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_ppc64abi32_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15' +_ppc64abi32_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_s390x_magic='\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16' +_s390x_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_sh4_magic='\x7f\x45\x4c\x46\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00' +_sh4_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_sh4eb_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a' +_sh4eb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_sparc_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02' +_sparc_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_sparc32plus_magic='\x7f\x45\x4c\x46\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x12' +_sparc32plus_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_sparc64_magic='\x7f\x45\x4c\x46\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2b' +_sparc64_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff' +_x86_64_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00' +_x86_64_mask='\xff\xff\xff\xff\xff\xfe\xfe\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' +_ppc64le_magic='\x7f\x45\x4c\x46\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00' +_ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00' + +case "$XBPS_TARGET_MACHINE" in + x86_64*|i386*) _omit="i386|x86_64" ;; + armv*|aarch64*) _omit="arm|aarch64" ;; + mips*) _omit="${XBPS_TARGET_MACHINE%-*}" ;; + *) _omit="${XBPS_TARGET_MACHINE%-*}" ;; +esac + +for _fmt in $_fmts; do + eval "case $_fmt in $_omit) magic= ;; *) magic=\"\$_${_fmt}_magic\" mask=\"\$_${_fmt}_mask\" ;; esac" + if [ -n "$magic" ]; then + binfmts+="/usr/bin/qemu-$_fmt-static --magic '$magic' --mask '$mask' --offset 0 --credential yes +" + fi +done + +binfmts="${binfmts%?}" + do_configure() { ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec \ --disable-kvm --disable-vnc-png --disable-vnc-tls \ @@ -30,5 +96,5 @@ do_install() { done for f in ${DESTDIR}/usr/bin/*; do mv ${f} ${f}-static - done + done }