Bug 242612 - games/ufoai: "Wrong JPEG library version: library is 90, caller expects 80"
Summary: games/ufoai: "Wrong JPEG library version: library is 90, caller expects 80"
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:
Depends on:
Blocks:
 
Reported: 2019-12-12 20:39 UTC by Peter Kien
Modified: 2020-08-07 20:30 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (m.tsatsenko)


Attachments
log of attempted make (11.37 KB, text/plain)
2020-08-05 01:30 UTC, storm16
no flags Details
Patch (6.74 KB, patch)
2020-08-05 23:02 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kien 2019-12-12 20:39:21 UTC
The program crashes during startup, complaining that we use the ...
..

 "Wrong JPEG library version: library is 90, caller expects 80"
Comment 1 attila.kover 2019-12-19 18:42:03 UTC
Same problem here under 12.1-RELEASE on an iMac 14,2, either with pkg and port install.
OS: FreeBSD macbsd 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
Comment 2 storm16 2020-08-04 22:24:37 UTC
Spoke to the upstream developers on irc and was given the following advice:

14:06 < VulcanRidr> I have a question. I am trying to install ufoai 2.5_9 on
                    FreeBSD 12.1p7. Game installs fine, but when I try to start
                    it, it quits with the error, "Wrong JPEG library version:
                    library is 90, caller expects 80" Is there a fix available
                    for this?
14:11 < Soliton> the error means the game was built with version 80 but gets
                 executed with version 90.
14:11 < Soliton> rebuild the game or install the older lib version.
14:12 < Soliton> (or run in a way that the older lib version is actually used.)
14:16 < VulcanRidr> So if I recompile from source, it will pick up the new
                    version?
14:18 < Soliton> i have no clue how your os works but that sounds like a sane
                 assumption.

I have the source, will have a go at compiling and report my results.
Comment 3 storm16 2020-08-05 01:30:09 UTC
Created attachment 217016 [details]
log of attempted make
Comment 4 storm16 2020-08-05 01:32:59 UTC
I believe the Makefile is geared toward linux, since it has thing like CC = gcc, CXX = g++, and so forth. Believe we need a FreeBSD-specific Makefile.
Comment 5 attila.kover 2020-08-05 16:43:22 UTC
(In reply to storm16 from comment #3)

This is FreeBSD, not Linux. FreBSD make works with FreeBSD Makefile. If you got a Makefile with GNU syntax, then you need to use gmake instead of make.
Comment 6 attila.kover 2020-08-05 16:48:01 UTC
(In reply to storm16 from comment #4)

The FreeBSD Makefiles are in /usr/ports/
Comment 7 attila.kover 2020-08-05 17:42:36 UTC
(In reply to storm16 from comment #3)

Just compiled 2.6 from git source (had to disable ufo2map and testall at configure and slightly edit src/tools/radiant/radiant/exec.cpp)

After launching the compiled ufo binary, it shows the splash screen and then it quits with the familiar error message:

Music: track changed from  to van_theme.
executing autoexec.cfg
"version" is "UFO: Alien Invasion 2.6-dev AMD64 Aug  5 2020 FreeBSD DEBUG"
Wrong JPEG library version: library is 90, caller expects 80
Comment 8 m.tsatsenko 2020-08-05 21:41:23 UTC
So, at least we have something.
Can you please post ldd output for the game binary?
Comment 9 Dmitry Marakasov freebsd_committer 2020-08-05 22:33:17 UTC
Sorry, I forgot abouth this PR completely. The problem is trivial - it bundles its own version of jpeg. I'm testing the fix right now.
Comment 10 Dmitry Marakasov freebsd_committer 2020-08-05 23:02:00 UTC
Created attachment 217041 [details]
Patch

- Fix detection of system jpeg by adding USES=localbase, this fixes crash on game start due to libraries conflict
- Make sure that bundled (ancient and likely vulnerable) third party libraries are not used by removing most of them
- Add missing depends
- Portlint nits
- Modernize options handling
- Silence patching
- Simplify radiant data installation
- Fix absolute symlink
Comment 11 storm16 2020-08-06 01:20:50 UTC
(In reply to Dmitry Marakasov from comment #10)

So download ufoai.patch, and 

patch -p1 /usr/ports/games/ufoai/Makefile < ufoai.patch
make install clean

Is this the right process? Because I think I missed a step. When I did it, it stopped and asked:

===>  Applying distribution patches for ufoai-2.5_10
===>  Applying FreeBSD patches for ufoai-2.5_10 from /usr/ports/games/ufoai/files
File to patch:    

What did I miss?
Comment 12 Dmitry Marakasov freebsd_committer 2020-08-06 14:21:44 UTC
> What did I miss?

There was an empty file left in files/ after patching. You need to either remove it or patch with -E.
Comment 13 commit-hook freebsd_committer 2020-08-07 20:23:40 UTC
A commit references this bug:

Author: amdmi3
Date: Fri Aug  7 20:22:47 UTC 2020
New revision: 544349
URL: https://svnweb.freebsd.org/changeset/ports/544349

Log:
  - Fix detection of system jpeg by adding USES=localbase, this fixes crash on game start due to libraries conflict
  - Fix build failure on 12.x i386 related to linking with OpenAL
  - Remove most bundled third party librarues ti ensure they are not used
  - Add missing depends
  - Portlint nits
  - Modernize options handling
  - Silence patching
  - Simplify radiant data installation
  - Fix absolute symlink

  PR:		242612
  Reported by:	peter.kien@posteo.org, attila.kover@guardian.co.uk, storm16@gmail.com
  Approved by:	maintainer timeout (m.tsatsenko@gmail.com, 8 months)

Changes:
  head/games/ufoai/Makefile
  head/games/ufoai/files/patch-src__libs__vorbis__config.h
  head/games/ufoai/pkg-plist