From eb07b4bb6a203e0f1a62f70b081a3bc2b5ddd0a9 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 13 Feb 2018 17:51:46 +0100 Subject: [PATCH] New package: higan-106 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: #11618 [via git-merge-pr] Signed-off-by: Jürgen Buchmüller --- srcpkgs/higan/patches/makefile-fixes.patch | 24 ++++++++ srcpkgs/higan/patches/use_sharedpath.patch | 16 ++++++ srcpkgs/higan/template | 66 ++++++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 srcpkgs/higan/patches/makefile-fixes.patch create mode 100644 srcpkgs/higan/patches/use_sharedpath.patch create mode 100644 srcpkgs/higan/template diff --git a/srcpkgs/higan/patches/makefile-fixes.patch b/srcpkgs/higan/patches/makefile-fixes.patch new file mode 100644 index 00000000000..5784899c92d --- /dev/null +++ b/srcpkgs/higan/patches/makefile-fixes.patch @@ -0,0 +1,24 @@ +Description: Makefile fixes + * Remove -march=native build flag. + - This will cause gcc to use all instruction subsets + available on the build machine, meaning that the program + will not work on computers where they are not available. + - Also the flag is not supported on many architectures + (armhf, s390, s390x, powerpc, ia64, ...). + * Linking with dl is also required on kfreebsd. +Author: Tobias Hansen + + +--- higan/GNUmakefile ++++ higan/GNUmakefile +@@ -26,9 +26,8 @@ + flags += -fopenmp + link += -fopenmp + ifeq ($(binary),application) +- flags += -march=native + link += -Wl,-export-dynamic +- link += -lX11 -lXext ++ link += -lX11 -lXext -ldl + else ifeq ($(binary),library) + flags += -fPIC + link += -shared diff --git a/srcpkgs/higan/patches/use_sharedpath.patch b/srcpkgs/higan/patches/use_sharedpath.patch new file mode 100644 index 00000000000..599fe3d5ff8 --- /dev/null +++ b/srcpkgs/higan/patches/use_sharedpath.patch @@ -0,0 +1,16 @@ +Description: Use sharedpath() when locating files + To find files that are in /usr/share/higan. +Author: Tobias Hansen + +--- higan/target-tomoko/tomoko.cpp ++++ higan/target-tomoko/tomoko.cpp +@@ -11,6 +11,9 @@ + location = {Path::config(), "higan/", name}; + if(inode::exists(location)) return location; + ++ location = {Path::shared(), "higan/", name}; ++ if(inode::exists(location)) return location; ++ + directory::create({Path::local(), "higan/"}); + return {Path::local(), "higan/", name}; + } diff --git a/srcpkgs/higan/template b/srcpkgs/higan/template new file mode 100644 index 00000000000..97e3cb096e8 --- /dev/null +++ b/srcpkgs/higan/template @@ -0,0 +1,66 @@ +# Template file for 'higan' +pkgname=higan +version=106 +revision=1 +wrksrc="higan_v${version}-source" +build_style=gnu-makefile +build_wrksrc=higan +make_build_args='compiler=${CXX}' +make_install_args="prefix=${DESTDIR}/usr" +hostmakedepends="p7zip pkg-config SDL-devel" +makedepends="gtk+-devel gtksourceview2-devel libgomp-devel + $(vopt_if sdl SDL-devel) + $(vopt_if opengl MesaLib-devel) $(vopt_if xv libXv-devel) + $(vopt_if ao libao-devel) $(vopt_if alsa alsa-lib-devel) + $(vopt_if openal libopenal-devel) $(vopt_if pulseaudio pulseaudio-devel)" +short_desc="Multi-system emulator (SNES/Game Boy/Mega Drive/PC Engine/WonderSwan)" +maintainer="John " +license="GPL-3" +homepage="https://byuu.org/emulation/higan/" +distfiles="https://download.byuu.org/higan_v${version}-source.7z" +checksum=6564f91f232040c46c052de763dc139e94005e0f2376959fdacbb6ccd3fd6d18 + +build_options="icarus pulseaudio alsa oss openal ao sdl xv opengl udev" +build_options_default="icarus pulseaudio alsa oss openal ao sdl xv opengl udev" +desc_option_ao="Enable support for cross-platform audio" +desc_option_icarus="Enable the icarus binary" +desc_option_openal="Enable support for 3D audio" +desc_option_opengl="Enable support for OpenGL" +desc_option_oss="Enable support for OSS" +desc_option_udev="Enable support for udev" +desc_option_xv="Enable support for Xv" + +disable_module() { + echo Disabling: "$1" + sed -i \ + -e "s|$1\b||" \ + "${wrksrc}"/higan/target-tomoko/GNUmakefile +} + +do_configure() { + $(vopt_if pulseaudio '' 'disable_module audio.pulseaudio') + $(vopt_if pulseaudio '' 'disable_module audio.pulseaudiosimple') + $(vopt_if alsa '' 'disable_module audio.alsa') + $(vopt_if oss '' 'disable_module audio.oss') + $(vopt_if openal '' 'disable_module audio.openal') + $(vopt_if ao '' 'disable_module audio.ao') + + $(vopt_if sdl '' 'disable_module video.sdl') + $(vopt_if xv '' 'disable_module video.xvideo') + $(vopt_if opengl '' 'disable_module video.glx') + + $(vopt_if sdl '' 'disable_module input.sdl') + $(vopt_if udev '' 'disable_module input.udev') +} + +if [ "$build_option_icarus" ];then + post_build() { + cd $wrksrc/icarus + make ${makejobs} ${make_build_args} + } + + post_install() { + cd $wrksrc/icarus + make STRIP=true ${make_install_args} install + } +fi