diff options
-rw-r--r-- | .SRCINFO | 27 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 97 | ||||
-rw-r--r-- | nestopia.install | 30 |
4 files changed, 125 insertions, 37 deletions
@@ -1,21 +1,20 @@ pkgbase = nestopia - pkgdesc = An NES emulator featuring cycle exact emulation, a ridiculous number of mappers, and lots of custom sound chips. - pkgver = 1.49 + pkgdesc = High-accuracy NES/Famicom emulator + pkgver = 1.52.1 pkgrel = 1 - url = http://0ldsk00l.ca/nestopia/ + url = https://github.com/0ldsk00l/nestopia + install = nestopia.install arch = x86_64 - license = GPL - makedepends = unzip - makedepends = mesa - makedepends = xdg-utils - makedepends = git + license = GPL-2.0-only makedepends = autoconf-archive - depends = sdl2 - depends = gtk3 + makedepends = mesa + makedepends = clang + makedepends = lld + depends = fltk depends = libarchive - depends = libao - source = git+https://github.com/rdanbrook/nestopia.git#tag=1.49 - sha256sums = SKIP + depends = sdl2 + depends = zlib + source = nestopia-1.52.1.tar.gz::https://github.com/0ldsk00l/nestopia/archive/1.52.1.tar.gz + sha256sums = c9c0bce673eb3b625b538b462e49c00ed1ee1ded1e0bad09be780076880968b5 pkgname = nestopia - diff --git a/.gitignore b/.gitignore index 749c6a6e7224..018a3de08144 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -pkg/ -src/ -nestopia -*pkg.tar* +* +!PKGBUILD +!.SRCINFO +!.gitignore @@ -1,29 +1,88 @@ -# $Id: PKGBUILD 266875 2017-11-15 14:29:11Z foutrelis $ -# Maintainer: aimileus < me at aimileus dot nl > -# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com> -# Contributor: Tiago Pierezan Camargo <tcamargo@gmail.com> -# Contributor: robb_force <robb_force@holybuffalo.net> - -pkgname=nestopia -pkgver=1.49 +# Maintainer: +# Contributor: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG +# Contributor: aimileus, Sergej Pupykin, Tiago Pierezan Camargo, robb_force + +## useful links +# http://0ldsk00l.ca/nestopia/ +# https://github.com/0ldsk00l/nestopia + +## options +: ${_build_clang:=true} +: ${_build_mold:=false} +: ${_build_noglu:=true} + +: ${_build_avx:=false} + +unset _pkgtype +[[ "${_build_avx::1}" == "t" ]] && _pkgtype+="-avx" + +## basic info +_pkgname="nestopia" +pkgname="$_pkgname${_pkgtype:-}" +pkgver=1.52.1 pkgrel=1 -pkgdesc='An NES emulator featuring cycle exact emulation, a ridiculous number of mappers, and lots of custom sound chips.' -url='http://0ldsk00l.ca/nestopia/' -license=('GPL') +pkgdesc="High-accuracy NES/Famicom emulator" +url="https://github.com/0ldsk00l/nestopia" +license=('GPL-2.0-only') arch=('x86_64') -depends=('sdl2' 'gtk3' 'libarchive' 'libao') -makedepends=('unzip' 'mesa' 'xdg-utils' 'git' 'autoconf-archive') -source=("git+https://github.com/rdanbrook/nestopia.git#tag=$pkgver") -sha256sums=('SKIP') + +depends=( + fltk + libarchive + sdl2 + zlib + + ## implicit + #hicolor-icon-theme + #libglvnd +) +makedepends=( + autoconf-archive + mesa +) + +[ "${_build_clang::1}" == "t" ] && makedepends+=('clang' 'lld' ) +[ "${_build_mold::1}" == "t" ] && makedepends+=('mold' ) +[ "${_build_noglu::1}" != "t" ] && makedepends+=('glu') + +install="$_pkgname.install" + +_pkgsrc="$_pkgname-$pkgver" +_pkgext="tar.gz" +source=("$_pkgsrc.$_pkgext"::"https://github.com/0ldsk00l/nestopia/archive/$pkgver.$_pkgext") +sha256sums=('c9c0bce673eb3b625b538b462e49c00ed1ee1ded1e0bad09be780076880968b5') build() { - cd "$pkgname" - autoreconf -vif + if [[ "${_build_clang::1}" == "t" ]] ; then + export CC=clang + export CXX=clang++ + export CXXFLAGS+=" -Wno-narrowing -Wno-ignored-optimization-argument" + fi + + if [[ "${_build_mold::1}" == "t" ]] ; then + export LDFLAGS+=" -flto -fuse-ld=mold" + elif [[ "${_build_clang::1}" == "t" ]] ; then + export LDFLAGS+=" -fuse-ld=lld" + fi + + if [[ "${_build_avx::1}" == "t" ]] ; then + export CFLAGS="$(echo "$CFLAGS" | sed -E 's@(\s*-(march|mtune)=\S+\s*)@ @g;s@\s*-O[0-9]\s*@ @g;s@\s+@ @g') -march=x86-64-v3 -mtune=generic -O3" + export CXXFLAGS="$(echo "$CXXFLAGS" | sed -E 's@(\s*-(march|mtune)=\S+\s*)@ @g;s@\s*-O[0-9]\s*@ @g;s@\s+@ @g') -march=x86-64-v3 -mtune=generic -O3" + fi + + cd "$_pkgsrc" + autoreconf -fi ./configure --prefix=/usr + + [ "${_build_noglu::1}" == "t" ] && sed -E -i Makefile -e "s#-lGLU ##g" + + # respect CFLAGS -march=... + local _march=$(sed -E 's#^.*(-march.*-O\S*) .*$#\1#' <<< "${CFLAGS}") + [ -n _march ] && sed -E -i Makefile -e "s#-march.*-O\S* #$_march #g" + make } package() { - cd "$pkgname" - make install DESTDIR="$pkgdir" + make -C "$_pkgsrc" install DESTDIR="$pkgdir" } diff --git a/nestopia.install b/nestopia.install new file mode 100644 index 000000000000..e42ee19237d3 --- /dev/null +++ b/nestopia.install @@ -0,0 +1,30 @@ +# Colored makepkg-like functions +msg_blue() { + printf "${BLUE}==>${BOLD} $1${ALL_OFF}\n" +} + +note1() { + printf "${BLUE}==>${YELLOW} NOTE:${BOLD} $1${ALL_OFF}\n" +} + +note2() { + printf "${BLUE}==> ${BOLD} $1${ALL_OFF}\n" +} + +ALL_OFF="$(tput sgr0)" +BOLD="${ALL_OFF}$(tput bold)" +BLACK="${BOLD}$(tput setaf 0)" +RED="${BOLD}$(tput setaf 1)" +GREEN="${BOLD}$(tput setaf 2)" +YELLOW="${BOLD}$(tput setaf 3)" +BLUE="${BOLD}$(tput setaf 4)" +MAGENTA="${BOLD}$(tput setaf 5)" +CYAN="${BOLD}$(tput setaf 6)" +WHITE="${BOLD}$(tput setaf 7)" + +post_upgrade() { + if [ $(vercmp "$2" 1.51.0) -lt 0 ]; then + note1 "The settings and data directories have been moved" + note2 "from ~/.nestopia to respect xdg basedir spec." + fi +} |