JGR's Patch Pack

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Argus
Tycoon
Tycoon
Posts: 1204
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: JGR's Patch Pack

Post by Argus »

Thanks for tip, I'll try :)
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

I could try to help here.. I've been working on creating a stand-alone (static) package for MacOS, meaning one does not need to have a compiling environment present at their Mac computer. I'm hoping someone will test it for me. I'm willing to try the same for Linux.
To be clear, it is all JGR's work and I'm essentially only repacking it to MacOS package!
So, with JGR's permission I will post the MacOS .dmg file here (as I did before), and also I will dive into Linux.
I'm willing to do this because I know how frustrating it is having an operating system other than Windows, and not being able to play because the compiling process seems like hocus-pocus to you.
As an aside, the new wiki page is not really helping anymore with this, and you have to figure much more stuff out by yourself (as a noob anyways, like me :roll:).

JGR wrote: 22 Nov 2020 18:28
Juergen p. wrote: 22 Nov 2020 18:17 Hi JGR,
thanks for your answer.
The game itself is available as a deb, of course, but I don't see exactly how to bind the "source.zip" from github as you add the link above. Is it correct to download the source.zip, unpack and afterwards run the "make_bundle.sh"? But where have I to unpack und run the sh?
Many thanks for your help.
best regards
Juergen
Any empty directory will do.
Assuming that you have the dependencies as per the wiki page, running build.sh should be sufficient.
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

vincentkoevoets wrote: 10 Dec 2020 21:57 I could try to help here.. I've been working on creating a stand-alone (static) package for MacOS, meaning one does not need to have a compiling environment present at their Mac computer. I'm hoping someone will test it for me. I'm willing to try the same for Linux.
To be clear, it is all JGR's work and I'm essentially only repacking it to MacOS package!
So, with JGR's permission I will post the MacOS .dmg file here (as I did before), and also I will dive into Linux.
I'm willing to do this because I know how frustrating it is having an operating system other than Windows, and not being able to play because the compiling process seems like hocus-pocus to you.
As an aside, the new wiki page is not really helping anymore with this, and you have to figure much more stuff out by yourself (as a noob anyways, like me :roll:).

JGR wrote: 22 Nov 2020 18:28
Juergen p. wrote: 22 Nov 2020 18:17 Hi JGR,
thanks for your answer.
The game itself is available as a deb, of course, but I don't see exactly how to bind the "source.zip" from github as you add the link above. Is it correct to download the source.zip, unpack and afterwards run the "make_bundle.sh"? But where have I to unpack und run the sh?
Many thanks for your help.
best regards
Juergen
Any empty directory will do.
Assuming that you have the dependencies as per the wiki page, running build.sh should be sufficient.
I have no objections to posting MacOS binaries in the thread. I'm sure that other Msc users would find it useful.

One thing to draw your attention to though, is that the trunk developers have recently noticed a bug which can cause optimised LLVM builds on MacOS to crash.
This is fixed upstream and now in my branch, but this is not in the most recent release of this patchpack.
This can be triggered by news messages.
If you are planning on doing the most recent release, I'd recommend checking for this.

Linux is a much broader target. Binaries built for one distro/version are in general not portable to others. Realistically you would need to pick specific distro(s) rather than just "Linux".
As nearly all desktop Linux distros come with sensible dev environments out of the box, it's not as pressing an issue as it is for Mac and Windows.

The upstream wiki is not set in stone, and I'm sure that edits or suggestions to make it easier to use would not go unappreciated.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

JGR wrote: 10 Dec 2020 22:46 I have no objections to posting MacOS binaries in the thread. I'm sure that other Msc users would find it useful.

One thing to draw your attention to though, is that the trunk developers have recently noticed a bug which can cause optimised LLVM builds on MacOS to crash.
This is fixed upstream and now in my branch, but this is not in the most recent release of this patchpack.
This can be triggered by news messages.
If you are planning on doing the most recent release, I'd recommend checking for this.
Okay, I did indeed compile the latest release. As I have news disabled in the game, I did not noticed this (yet). So I can compile with the latest commits instead? Or else just wait for the next release and compile and post that one.
JGR wrote: 10 Dec 2020 22:46 Linux is a much broader target. Binaries built for one distro/version are in general not portable to others. Realistically you would need to pick specific distro(s) rather than just "Linux".
As nearly all desktop Linux distros come with sensible dev environments out of the box, it's not as pressing an issue as it is for Mac and Windows.

The upstream wiki is not set in stone, and I'm sure that edits or suggestions to make it easier to use would not go unappreciated.

Hmm okay, I knew that there where indeed a lot of Linux distros. Maybe I'll try it just for the fun of it, but I will not be posting Linux binaries then.

Hah, never realized I could edit the wiki myself, maybe I'll give it a spin :D
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

vincentkoevoets wrote: 10 Dec 2020 23:10 Okay, I did indeed compile the latest release. As I have news disabled in the game, I did not noticed this (yet). So I can compile with the latest commits instead? Or else just wait for the next release and compile and post that one.
I'm not sure when the next release will be.
Other than this mac issue there are only minor changes so far since the last release.

You may be able to avoid this issue and get a working build of the last release by compiling with -fno-delete-null-pointer-checks, but I haven't actually tested that.
Ex TTDPatch Coder
Patch Pack, Github
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

JGR wrote: 11 Dec 2020 00:13
vincentkoevoets wrote: 10 Dec 2020 23:10 Okay, I did indeed compile the latest release. As I have news disabled in the game, I did not noticed this (yet). So I can compile with the latest commits instead? Or else just wait for the next release and compile and post that one.
I'm not sure when the next release will be.
Other than this mac issue there are only minor changes so far since the last release.

You may be able to avoid this issue and get a working build of the last release by compiling with -fno-delete-null-pointer-checks, but I haven't actually tested that.
Well actually my last 0.39.1 build is working fine, and I cannot seem to produce any crash. But for good measure I compiled with -fno-delete-null-pointer-checks and I will attach both builds to this post.
openttd-jgrpp-0.39.1-macosx.dmg
OpenTTD jgrpp-0.39.1
(8.48 MiB) Downloaded 136 times
openttd-jgrpp-0.39.1-macosx_-fno_delete_null_pointer_checks.dmg
OpenTTD jgrpp-0.39.1 compiled with -fno_delete_null_pointer_checks
(8.48 MiB) Downloaded 72 times
Argus
Tycoon
Tycoon
Posts: 1204
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: JGR's Patch Pack

Post by Argus »

Crash on input to settings.
No crashlog created, sending savegame.... It said something about the length of the day...
Attachments
Jihoamerickákorsika01jgr.sav
(1.69 MiB) Downloaded 72 times
Argus
Tycoon
Tycoon
Posts: 1204
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: JGR's Patch Pack

Post by Argus »

I couldn't do it again in the embedded savegame
This file has been created, maybe it will help
http://leteckaposta.cz/232907030
Argus
Tycoon
Tycoon
Posts: 1204
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: JGR's Patch Pack

Post by Argus »

Sorry, I didn't notice the new way of creating logs
http://leteckaposta.cz/440994892
Attachments
crash-20201212T093951Z.png
(1.22 MiB) Not downloaded yet
User avatar
JGR
Tycoon
Tycoon
Posts: 2560
Joined: 08 Aug 2005 13:46
Location: Ipswich

Re: JGR's Patch Pack

Post by JGR »

Argus wrote: 12 Dec 2020 09:45 Crash on input to settings.
No crashlog created, sending savegame.... It said something about the length of the day...
Edit: Thanks for reporting this, I will investigate.
Ex TTDPatch Coder
Patch Pack, Github
Argus
Tycoon
Tycoon
Posts: 1204
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: JGR's Patch Pack

Post by Argus »

If this crashed again, I will send another log.
Sagenhaft
Engineer
Engineer
Posts: 4
Joined: 12 Dec 2020 21:28

Re: JGR's Patch Pack

Post by Sagenhaft »

I wonder is someone could help with compiling 0.39.1 for Mac.

I am running 10.15 - Catalina

I have all the dep installed since before the compile method switched to cmake.
Additionally before running this compile I installed LibLZMA, LZO, and fcitx.

When I run "make" I get:

"[ 44%] Linking CXX executable openttd
ld: warning: dylib (/opt/local/lib/libpng.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/liblzo2.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/liblzo2.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/libfreetype.dylib) was built for newer macOS version (10.15) than being linked (10.9)
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
convert_tofrom_fs(void*, char const*) in unix.cpp.o
"_libiconv_open", referenced from:
OTTD2FS(char const*) in unix.cpp.o
FS2OTTD(char const*) in unix.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [openttd] Error 1
make[1]: *** [CMakeFiles/openttd.dir/all] Error 2
make: *** [all] Error 2"

And the compile fails, no game to launch.
Any ideas would be welcomed, I can only assume I have not installed some dependency that I haven't read about.

Thanks.
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

Sagenhaft wrote: 12 Dec 2020 21:36 I wonder is someone could help with compiling 0.39.1 for Mac.

I am running 10.15 - Catalina

I have all the dep installed since before the compile method switched to cmake.
Additionally before running this compile I installed LibLZMA, LZO, and fcitx.

When I run "make" I get:

"[ 44%] Linking CXX executable openttd
ld: warning: dylib (/opt/local/lib/libpng.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/liblzo2.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/liblzo2.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/libfreetype.dylib) was built for newer macOS version (10.15) than being linked (10.9)
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
convert_tofrom_fs(void*, char const*) in unix.cpp.o
"_libiconv_open", referenced from:
OTTD2FS(char const*) in unix.cpp.o
FS2OTTD(char const*) in unix.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [openttd] Error 1
make[1]: *** [CMakeFiles/openttd.dir/all] Error 2
make: *** [all] Error 2"

And the compile fails, no game to launch.
Any ideas would be welcomed, I can only assume I have not installed some dependency that I haven't read about.

Thanks.
I'd say, start fresh. Do you use Macports? Try Homebrew, this solved most of my problems compiling on MacOS. There is probably multiple versions of libiconv on your system. It's a long story about the difference between _iconv and _libiconv if I remember correctly.
Also, I posted a build for MacOS just a few posts back, did you try that one?
Sagenhaft
Engineer
Engineer
Posts: 4
Joined: 12 Dec 2020 21:28

Re: JGR's Patch Pack

Post by Sagenhaft »

vincentkoevoets wrote: 13 Dec 2020 00:29
Sagenhaft wrote: 12 Dec 2020 21:36 I wonder is someone could help with compiling 0.39.1 for Mac.

I am running 10.15 - Catalina

I have all the dep installed since before the compile method switched to cmake.
Additionally before running this compile I installed LibLZMA, LZO, and fcitx.

When I run "make" I get:

"[ 44%] Linking CXX executable openttd
ld: warning: dylib (/opt/local/lib/libpng.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/liblzo2.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/liblzo2.dylib) was built for newer macOS version (10.15) than being linked (10.9)
ld: warning: dylib (/opt/local/lib/libfreetype.dylib) was built for newer macOS version (10.15) than being linked (10.9)
Undefined symbols for architecture x86_64:
"_libiconv", referenced from:
convert_tofrom_fs(void*, char const*) in unix.cpp.o
"_libiconv_open", referenced from:
OTTD2FS(char const*) in unix.cpp.o
FS2OTTD(char const*) in unix.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [openttd] Error 1
make[1]: *** [CMakeFiles/openttd.dir/all] Error 2
make: *** [all] Error 2"

And the compile fails, no game to launch.
Any ideas would be welcomed, I can only assume I have not installed some dependency that I haven't read about.

Thanks.
I'd say, start fresh. Do you use Macports? Try Homebrew, this solved most of my problems compiling on MacOS. There is probably multiple versions of libiconv on your system. It's a long story about the difference between _iconv and _libiconv if I remember correctly.
Also, I posted a build for MacOS just a few posts back, did you try that one?
Oh, completely missed that. I saw the post about intending to upload one..not the actual link. I will try it now.
Yes I am using mac ports. Conflict makes sense. Do you happen to know what's the easiest way to get rid of all the dep, to get a fresh start?

Thank you.

UPDATE

Open TTD starts, but asks to download base graphics at every startup. It also doesn't recognise any of the grf and has no sound. I think this is to do with the libraries.
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

Sagenhaft wrote: 13 Dec 2020 01:51 Open TTD starts, but asks to download base graphics at every startup.
it might be that the location where it's trying to save the .cfg file (and basesets) is not writable. might be a read-only directory, or a misconfigured path. try giving a config file location with "-c"
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

Sagenhaft wrote: 13 Dec 2020 01:51 Oh, completely missed that. I saw the post about intending to upload one..not the actual link. I will try it now.
Yes I am using mac ports. Conflict makes sense. Do you happen to know what's the easiest way to get rid of all the dep, to get a fresh start?

Thank you.

UPDATE

Open TTD starts, but asks to download base graphics at every startup. It also doesn't recognise any of the grf and has no sound. I think this is to do with the libraries.
Hmm, it could be the OpenTTD directory is corrupted. As long as the game launches, the libraries should be fine (as they are includes in the dmg file). I'd advise to delete the OpenTTD directory altogether, and then start fresh with the MacOS build. OpenTTD directory is /users/<username>/documents/OpenTTD. The game will create this directory again on launch. Be advised that all the downloaded GRF's will be gone and also you need to redownload the base GRF sets. Savegames are also stored here, so be sure to backup the files before proceeding. Essentially, after that you just start from scratch as you would with a fresh installation of the game.

As for cleaning up Macports and installing Homebrew, I think we need to discuss that somewhere else. But for some quick help I'd start here:
- https://guide.macports.org/chunked/inst ... lling.html Uninstalling MacPorts
- https://brew.sh/index_nl Installing Homebrew
- Run cmake and just see which libraries are missing, and only install those with Homebrew

Good luck!
Sagenhaft
Engineer
Engineer
Posts: 4
Joined: 12 Dec 2020 21:28

Re: JGR's Patch Pack

Post by Sagenhaft »

vincentkoevoets wrote: 13 Dec 2020 11:39
Sagenhaft wrote: 13 Dec 2020 01:51 Oh, completely missed that. I saw the post about intending to upload one..not the actual link. I will try it now.
Yes I am using mac ports. Conflict makes sense. Do you happen to know what's the easiest way to get rid of all the dep, to get a fresh start?

Thank you.

UPDATE

Open TTD starts, but asks to download base graphics at every startup. It also doesn't recognise any of the grf and has no sound. I think this is to do with the libraries.
Hmm, it could be the OpenTTD directory is corrupted. As long as the game launches, the libraries should be fine (as they are includes in the dmg file). I'd advise to delete the OpenTTD directory altogether, and then start fresh with the MacOS build. OpenTTD directory is /users/<username>/documents/OpenTTD. The game will create this directory again on launch. Be advised that all the downloaded GRF's will be gone and also you need to redownload the base GRF sets. Savegames are also stored here, so be sure to backup the files before proceeding. Essentially, after that you just start from scratch as you would with a fresh installation of the game.

As for cleaning up Macports and installing Homebrew, I think we need to discuss that somewhere else. But for some quick help I'd start here:
- https://guide.macports.org/chunked/inst ... lling.html Uninstalling MacPorts
- https://brew.sh/index_nl Installing Homebrew
- Run cmake and just see which libraries are missing, and only install those with Homebrew

Good luck!
Thank you! It works now! :D

I uninstalled macports completely, redid "cmake .." then "make" still got a mismatch error for liblzo2, but I have an executable now, and the game starts, music grf and everything :D

Thanks for all your help. You learn something new everyday :)

EDIT:

The only thing I'm wondering now is how to make a dmg, or just have an .app like you uploaded. At the moment it looks like I have to keep terminal up and running while having the game on. Is it just "make bundle"?

Thank you.
Eddi
Tycoon
Tycoon
Posts: 8271
Joined: 17 Jan 2007 00:14

Re: JGR's Patch Pack

Post by Eddi »

it used to be "make bundle_dmg" or something like that.
User avatar
vincentkoevoets
Engineer
Engineer
Posts: 48
Joined: 14 Nov 2014 10:49
Location: Assen, Netherlands

Re: JGR's Patch Pack

Post by vincentkoevoets »

Sagenhaft wrote: 13 Dec 2020 12:24
EDIT:

The only thing I'm wondering now is how to make a dmg, or just have an .app like you uploaded. At the moment it looks like I have to keep terminal up and running while having the game on. Is it just "make bundle"?

Thank you.
In the build directory, try 'cpack'. After this you will find a bundles directory inside the build directory. Inside is the dmg file.
Sagenhaft
Engineer
Engineer
Posts: 4
Joined: 12 Dec 2020 21:28

Re: JGR's Patch Pack

Post by Sagenhaft »

vincentkoevoets wrote: 13 Dec 2020 13:24
Sagenhaft wrote: 13 Dec 2020 12:24
EDIT:

The only thing I'm wondering now is how to make a dmg, or just have an .app like you uploaded. At the moment it looks like I have to keep terminal up and running while having the game on. Is it just "make bundle"?

Thank you.
In the build directory, try 'cpack'. After this you will find a bundles directory inside the build directory. Inside is the dmg file.
That did it. It's behaving weird tho. By that I mean, it seems I had to redownload opengfx and opensfx, and unzip them in the application "Show content->Resources->baseset" so it's basically looking in the wrong place for all the files when I start up. It should be looking in ~/Documents/OpenTTD/.. which is there. This doesn't happen when I run it in terminal. By all accounts it's looking in the right place for all the resources and it's finding them. Not the case after I built the package. That's not a big inconvenience in the end. I can make it work like this.

Thanks for all your help :)
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 18 guests