You are not logged in.

#1 2019-03-08 01:27:32

Trebuchette
Member
Registered: 2019-03-08
Posts: 4

bsnes - Super Nintendo emulator

Bsnes used to be a very popular SNES emulator, and then the author merged it into his all-encompassing emulator Higan. However, he's now separated it out, in an attempt to create an emulator solely focused on SNES emulation and ease of use, and he's released the new version. I created an AUR package for it at https://aur.archlinux.org/packages/bsnes/.

I'm fairly new to this whole "creating packages" thing, so feedback is welcome!

Offline

#2 2019-03-08 01:48:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: bsnes - Super Nintendo emulator

Please remove all the empty variables/arrays.  If they aren't used, they shouldn't be in the PKGBUILD.

Then, you should not include pkgdir in the prefix, it should be the DESTDIR for any reasonable makefile.

EDIT: and PKGBUILDs are not (should not be) executable.

EDIT 2: Despite being called "GNUmakefile" those makefiles do not even respect DESTDIR, so ignore that part.  And it seems "prefix" is really just used almost how DESTDIR should be and is never actually used the way the common makefile "prefix" variable is - so including pkgdir in it should be ok ... but it still makes me cringe having that in a PKGBUILD. (it's safe as "prefix" is never passed as a macro definition in a compiler command, but it's only used for 'cp' commands ... yes 'cp', not 'install').

Sidenote: I don't trust big software projects from people who don't know how to use makefiles properly.

Last edited by Trilby (2019-03-08 01:55:14)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2019-03-08 02:24:53

Trebuchette
Member
Registered: 2019-03-08
Posts: 4

Re: bsnes - Super Nintendo emulator

Yeah, it's got some weird custom Makefile stuff in it, for sure.

(Not sure how the PKGBUILD got executable - fixed it)

Thanks!

Offline

#4 2019-03-08 21:36:07

loqs
Member
Registered: 2014-03-06
Posts: 17,327

Re: bsnes - Super Nintendo emulator

PKGBUILD is 0755 in bsnes 107-2

Compiling ../hiro/hiro.cpp ...
g++ -x c++ -std=c++17 -DHIRO_GTK=2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/uuid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/atk-1.0 -I/usr/include/gtksourceview-2.0 -pthread -I/usr/include/libxml2  -I. -I.. -O3 -DBUILD_PERFORMANCE -fopenmp -fno-strict-aliasing -fwrapv -march=native -DCORE_SFC -DCORE_GB -MMD -MP -MF obj/hiro-gtk2.d

Ignoring all FLAGS and -march=native

Offline

#5 2019-03-09 01:54:59

Trebuchette
Member
Registered: 2019-03-08
Posts: 4

Re: bsnes - Super Nintendo emulator

loqs wrote:

PKGBUILD is 0755 in bsnes 107-2

Compiling ../hiro/hiro.cpp ...
g++ -x c++ -std=c++17 -DHIRO_GTK=2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/uuid -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/atk-1.0 -I/usr/include/gtksourceview-2.0 -pthread -I/usr/include/libxml2  -I. -I.. -O3 -DBUILD_PERFORMANCE -fopenmp -fno-strict-aliasing -fwrapv -march=native -DCORE_SFC -DCORE_GB -MMD -MP -MF obj/hiro-gtk2.d

Ignoring all FLAGS and -march=native

Fixed permissions; thanks!

The makefile for bsnes is really weird; it conforms to basically zero standards. Should I try and patch it to accept common flags?

Offline

#6 2019-03-09 16:42:58

loqs
Member
Registered: 2014-03-06
Posts: 17,327

Re: bsnes - Super Nintendo emulator

I would be pragmatic about it and patch it in this order:

  1. Add LDFLAGS to the linking of bsnes so the binary gains FULL RELRO and the change should only be in one place.

  2. Remove -march=native for an empty string so the generated package is portable.

  3. Add CXXFLAG and CPPFLAGS this may well not be maintainable

Offline

#7 2019-03-10 09:05:38

Trebuchette
Member
Registered: 2019-03-08
Posts: 4

Re: bsnes - Super Nintendo emulator

As it turns out, the higan package in the Community repo's patches are almost the same as what bsnes needs; I just adapted them. LDFLAGS and CXXFLAGS are included, and -march=native is removed.

Offline

Board footer

Powered by FluxBB