Bug 211855 - emulators/higan: Update to 102
Summary: emulators/higan: Update to 102
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-08-15 02:36 UTC by Naram Qashat
Modified: 2017-04-10 13:18 UTC (History)
1 user (show)

See Also:


Attachments
higan-100.patch (17.12 KB, patch)
2016-08-15 02:36 UTC, Naram Qashat
cyberbotx: maintainer-approval+
Details | Diff
higan-101.patch (16.96 KB, patch)
2016-08-18 15:59 UTC, Naram Qashat
cyberbotx: maintainer-approval+
Details | Diff
higan-102.patch (23.45 KB, patch)
2017-03-18 18:21 UTC, Naram Qashat
cyberbotx: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Naram Qashat 2016-08-15 02:36:44 UTC
Created attachment 173686 [details]
higan-100.patch

* Update to 100 (byuu, higan's author, says that 100 means it was the 100th release, not version 1.00, thus why I've decided to abide by that for this update)
* Updated distinfo
* Uses C++14, marked as broken on FreeBSD 9 as it cannot compile it
* Removed PROFILE option group as byuu removed the other profile options (accuracy is the only choice now)
* Updated dependencies
* Updated patches (none of the old patches worked anymore, only the new patches work)

Tested with Poudriere for FreeBSD 10-amd64 and 10-i386. Also tested runtime on FreeBSD 10-amd64 (no audio seemed to play, I do not know why but I suspect it is because the emulation is so slow and cannot sync the audio enough to play it).
Comment 1 Dmitry Marakasov freebsd_committer freebsd_triage 2016-08-18 10:08:46 UTC
We have USES=7z, can't this patch be simplified by using it?
Comment 2 Naram Qashat 2016-08-18 15:59:41 UTC
Created attachment 173826 [details]
higan-101.patch

I must've missed seeing that USES get added in. I've updated the patch to utilize it, as well as also making it use v101 (I missed seeing that 101 got released until after I had submitted the bug). All the notes from the initial note apply still, and Poudriere still tests out on it.
Comment 3 VK freebsd_triage 2016-09-24 21:44:16 UTC
(In reply to Naram Qashat from comment #2)

> All the notes from the initial note apply still, and Poudriere still
> tests out on it.

Thanks for your patch. Please confirm the changes pass the QA (portlint, Poudriere).
Comment 4 Naram Qashat 2016-09-25 21:20:34 UTC
As I said in my previous reply, I did test it. You even quoted me saying I tested it. And yes, it does pass portlint as well, with the exception of not having a LICENSE set.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2016-11-06 00:44:49 UTC
Comment on attachment 173826 [details]
higan-101.patch

Can you provide a link to upstream changelog for this version that can be used in commit message?

poudriere bulk -t complains

  ===========================================================================
  ====> Running Q/A tests (stage-qa)
  ====> Checking for pkg-plist issues (check-plist)
  ===> Parsing plist
  ===> Checking for items in STAGEDIR missing from pkg-plist
  Error: Orphaned: %%DATADIR%%/Mega Drive.sys/manifest.bml
  ===> Checking for items in pkg-plist which are not in STAGEDIR
  ===> Error: Plist issues found.
  *** [check-plist] Error code 1

On 11.0 or later build is broken:

  /usr/bin/ld: cannot find -lomp
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

USES=compiler:openmp cannot be used here due to bug 199603 and bug 210337, so either drop -fopenmp or make it conditional. Note, devel/openmp is currently broken on FreeBSD i386 unlike Linux i386 or Windows 32bit.

> +MASTER_SITES=	http://download.byuu.org/ \

Does it still work? The homepage points at http://helmet.kafuka.org/

  fetch: http://download.byuu.org/higan_v101-source.7z: Not Found

> +USES=		7z:p7zip ...

Nothing to change here! libarchive on 10.* has trouble with solid archives but works fine on 11.0+ or if compressed with -ms=off. If more such consumers appear it maybe worth to limit libarchive to 11.0+ in USES=7z.

  => SHA256 Checksum OK for higan_v101-source.7z.
  tar: Damaged 7-Zip archive
  tar: Error exit delayed from previous errors.
  *** Error code 1

> +BROKEN_FreeBSD_9=	no C++14 support

It builds fine with lang/gcc5. Try replacing with

  FAVORITE_COMPILER=	${COMPILER_TYPE} # c++14-lib

but as LDFLAGS aren't respected runtime fails

  $ higan
  /usr/lib/libgomp.so.1: version GOMP_4.0 required by /usr/local/bin/higan not found

one way to fix is by passing default flags (see DO_MAKE_BUILD below)

  MAKE_ENV=	link="${LDFLAGS} ${LIBS}"
  ...
  post-patch:
  	${REINPLACE_CMD} '/link :=/d' ${WRKSRC}/nall/GNUmakefile

>  MAKE_ENV+=	compiler="${CXX}" cflags="-x c -std=c99 ${CFLAGS}" \
> -		cppflags="-x c++ -std=c++11 ${CXXFLAGS}"
> +		cppflags="-x c++ -std=c++14 ${CXXFLAGS}"

Convert -std=* to USE_CSTD=c99 + USE_CXXSTD=c++14.

> GTK2_DESC=		Build with GTK+2 GUI
> QT4_DESC=		Build with QT4 GUI
> GLX_DESC=		Build GLX video driver

Some of these should be dropped. See Mk/bsd.options.desc.mk

> +GTK2_USE=	GNOME=cairo,gdkpixbuf2,gtk20,gtksourceview2
> +GTK2_USES=	gettext
> +GTK2_LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
> +			libfreetype.so:print/freetype2

Maybe sort these like you do for mandatory dependencies i.e., LIB_DEPENDS before any USE*.
Also, some dependencies can be dropped via LDFLAGS += -Wl,--as-needed

  --- higan	before
  +++ higan	after
  @@ -9,18 +9,11 @@ Dynamic section at offset 0x3c22f8 conta
    0x0000000000000001 (NEEDED)             Shared library: [libgtksourceview-2.0.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libgtk-x11-2.0.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libgdk-x11-2.0.so.0]
  - 0x0000000000000001 (NEEDED)             Shared library: [libpangocairo-1.0.so.0]
  - 0x0000000000000001 (NEEDED)             Shared library: [libatk-1.0.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libcairo.so.2]
    0x0000000000000001 (NEEDED)             Shared library: [libgdk_pixbuf-2.0.so.0]
  - 0x0000000000000001 (NEEDED)             Shared library: [libgio-2.0.so.0]
  - 0x0000000000000001 (NEEDED)             Shared library: [libpangoft2-1.0.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libpango-1.0.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libgobject-2.0.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libglib-2.0.so.0]
  - 0x0000000000000001 (NEEDED)             Shared library: [libintl.so.8]
  - 0x0000000000000001 (NEEDED)             Shared library: [libfontconfig.so.1]
  - 0x0000000000000001 (NEEDED)             Shared library: [libfreetype.so.6]
    0x0000000000000001 (NEEDED)             Shared library: [libomp.so.0]
    0x0000000000000001 (NEEDED)             Shared library: [libc++.so.1]
    0x0000000000000001 (NEEDED)             Shared library: [libcxxrt.so.1]

>  do-build:
> -.for d in . ananke
> +.for d in higan icarus
>  	(cd ${WRKSRC}/${d} && ${MAKE_CMD} ${MAKE_ENV})
>  .endfor

Call DO_MAKE_BUILD instead of MAKE_CMD. MAKE_ENV isn't supposed to override vendor variables unless ?= is used.

  MAKEFILE=	GNUmakefile
  ...
  do-build:
  .for d in higan icarus
  	@${DO_MAKE_BUILD} ${ALL_TARGET} -C${WRKSRC}/${d}
  .endfor

> +	${MKDIR} ${STAGEDIR}${DATADIR}
> +	${INSTALL_DATA} ${WRKSRC}/higan/data/cheats.bml ${STAGEDIR}${DATADIR}/
> +	(cd ${WRKSRC}/higan/systems && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}/)

MKDIR call can be omitted if you put COPYTREE_* before INSTALL_DATA.
Also, replace \* with . (dot).
Comment 6 Naram Qashat 2017-03-18 18:21:16 UTC
Created attachment 180930 [details]
higan-102.patch

This patch updates the port to version 102 instead of 101. All the notes from my previous updates still apply, but I will address Jan's last message here as well.

One other note is that I had to use GCC instead of Clang to get it to compile. higan's author, byuu, told me a couple months ago that doesn't use Clang due to the hiro part of higan crashing from its use and recommended using GCC 4.9 instead.

Also something to note, from my first comment about audio not working at runtime, I believe it was possibly an issue with an old configuration file, as I was able to play audio with version 102 just fine.

Final thing to note about this particular patch is that I added a function to higan/target-tomoko/tomoko.cpp that checks in /usr/local/share prior to the user's directory, to allow for the system directories to be stores in a global location as opposed to the user's home directory. I believe this is due to byuu setting higan up in a way that it is meant to be built and installed by a user as opposed to globally.

In regards of an upstream changelog, I looked but could not find an actual changelog. Best thing I can find would be the news items on https://byuu.org/ itself.

I have fixed the pkg-plist so it passes poudriere.

The download site is still valid as of now, it just was not at the time of Jan's comment.

I removed the BROKEN line due to FreeBSD 9 being unsupported now, thus no longer needing to be marked as broken for that.

I've removed the cflags and cppflags from MAKE_ENV and used USE_CSTD and USE_CXXSTD instead (although with how the makefiles are set up, I don't think they are actually being used).

I've dropped descriptions that were in Mk/bsd.options.desc.mk.

I sorted the GTK2 option variables, but I did not bother with the as-needed flag.

I utilized DO_MAKE_BUILD as suggested.

I removed the usage of MKDIR on the directories that were being used by COPYTREE_SHARE, as well as used . in place of \*.

This updated was tested in poudriere for 10-i386, 10-amd64, 11-i386 and 11-amd64. I also tested it at runtime on my current system running 11-amd64 and it runs as expected. portlint mentions NLS knob (not possible as the source has no way to conditionally get use of gettext) and LICENSE (I found no license in the source or on the website).

Hopefully this is enough to get the port updated. I will also be mentioning this update to byuu and see if he has anything to change about it, but barring that, hopefully this will suffice.
Comment 7 Dmitry Marakasov freebsd_committer freebsd_triage 2017-03-28 18:05:48 UTC
It builds and looks fine, except that I'm worried about gcc requirement. Port which uses g++/libstdc++ cannot use C++ libraries build with clang/libc++, as even if it links, standard library incompatibility will explode at runtime. This only seem to be a problem when QT4 is enabled. Have you tested it with this option?
Comment 8 Naram Qashat 2017-03-28 18:26:11 UTC
I mainly went with gcc because higan's author byuu told me he was building with gcc and not clang, and I was getting a compile error within nall/arithmetic/natural.hpp when using clang. It is from a couple months ago, but this is what I was seeing with clang at the time:

http://kirby.cyberbotx.com/higan_102_clang_failure.txt

I don't believe the compile error was tied to any specific toolkit being used. I could run another test to see if it'll build with clang instead, but I have not heard from byuu to see if there is a fix to make higan compile with clang in this version or the next.

I did test higan at runtime, though, and it runs for me, but I also have a libmap.conf set up to have references to gcc-specific libraries go to their gcc49 equivalents, which may be giving me a false positive on my system.
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-04-10 13:18:14 UTC
A commit references this bug:

Author: amdmi3
Date: Mon Apr 10 13:17:18 UTC 2017
New revision: 438163
URL: https://svnweb.freebsd.org/changeset/ports/438163

Log:
  - Update to 102

  PR:		211855
  Submitted by:	cyberbotx@cyberbotx.com (maintainer)

Changes:
  head/emulators/higan/Makefile
  head/emulators/higan/distinfo
  head/emulators/higan/files/patch-higan_target-tomoko_GNUmakefile
  head/emulators/higan/files/patch-higan_target-tomoko_presentation_presentation.cpp
  head/emulators/higan/files/patch-higan_target-tomoko_program_medium.cpp
  head/emulators/higan/files/patch-higan_target-tomoko_tomoko.cpp
  head/emulators/higan/files/patch-higan_target-tomoko_tomoko.hpp
  head/emulators/higan/files/patch-higan_target-tomoko_tools_cheat-database.cpp
  head/emulators/higan/files/patch-icarus_core_core.cpp
  head/emulators/higan/files/patch-icarus_icarus.cpp
  head/emulators/higan/files/patch-nall-platform.hpp
  head/emulators/higan/files/patch-ruby__video__glx.cpp
  head/emulators/higan/files/patch-target-ethos-Makefile
  head/emulators/higan/files/patch-target-ethos_general_presentation.cpp
  head/emulators/higan/files/patch-target-ethos_utility_utility.cpp
  head/emulators/higan/pkg-plist