Author Topic: WM on Linux  (Read 6370 times)

0 Members and 1 Guest are viewing this topic.

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
WM on Linux
« on: December 24, 2016, 09:37:28 AM »
Just a few hints for people trying to compile WM on Linux:


  • You need premake4, liblua5.1, libsdl1.2-dev (same for sdl-gfx, sdl-ttl, sdl-image)
  • You will need to create a link from sdl.h to SDL.h (inside include/SDL) folder.
  • If your include path isn't /usr/include then you might have problems compiling it.
--

Consider this a work in progress (and that is version 1).


To create the link:


Code: [Select]
cd /usr/include/SDL
sudo ln -s SDL.h sdl.h



if you have everything above just type:


Code: [Select]
premake4 gmake

and


Code: [Select]
make config=release

if you want to see the compiler flags used:

Code: [Select]
make config=release verbose=1
« Last Edit: January 05, 2017, 12:08:56 PM by _rhetorik_ »

Offline MuteDay

  • Sr. Member
  • ****
  • Posts: 421
  • Loving life and PinkPetal Family
Re: WM on Linux
« Reply #1 on: December 24, 2016, 11:22:31 AM »
Will Libsdl2 work. because i can find libsdl1 on my system
Please Enjoy all the hard work i Do to help make the game and forums a better place :)

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
Re: WM on Linux
« Reply #2 on: December 24, 2016, 02:48:27 PM »
I don't think so.


If you run a debian based system i am quite sure you can find a package on the distro repo. The name of the package on Ubuntu Xenial is libsdl1.2-dev. And it might be different for other distros.

Offline MuteDay

  • Sr. Member
  • ****
  • Posts: 421
  • Loving life and PinkPetal Family
Re: WM on Linux
« Reply #3 on: December 24, 2016, 03:04:00 PM »
Alright ill look and see if i can find the other ones i got libsdl but missing (as far as i know) the ttf




on side note care to explain how to create link from sdl to SDL please
Please Enjoy all the hard work i Do to help make the game and forums a better place :)

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
Re: WM on Linux
« Reply #4 on: December 24, 2016, 08:13:49 PM »

on side note care to explain how to create link from sdl to SDL please


cd /usr/include/SDL
sudo ln -s SDL.h sdl.h


I am updating the makefile to do it alone. Hopefully next version will be a bit smarter.

Offline MuteDay

  • Sr. Member
  • ****
  • Posts: 421
  • Loving life and PinkPetal Family
Re: WM on Linux
« Reply #5 on: December 24, 2016, 08:23:57 PM »
awsome thank you

Please Enjoy all the hard work i Do to help make the game and forums a better place :)

Offline jimbobiii

  • Newbie
  • *
  • Posts: 23
Re: WM on Linux
« Reply #6 on: January 05, 2017, 03:46:02 AM »
SDL link shouldn't be needed - most distros install the header with the correct name (SDL.h).

Game seems to compile fine with the above libraries installed. Doesn't seem to find (or properly sort, at least) image files that start with uppercase letters (although it might work on a case-insensitive file system). Could probably be fixed if I knew how the game was sorting images into categories, but I don't want to dig through the code tonight. Also seems like there're some weird font-rendering artifacts on things like the girls' stat pages, maybe related to newline formatting in some areas. Probably SDL-related as it doesn't happen with the same font files on Windows.

The install option in the Makefile is completely broken; took me all of two minutes to fix it, or at least get it to do something useful.

Interestingly enough WMEditor seems to work just fine with Mono. Builds fine with xbuild and even the precompiled version works well (as well as it does on Windows, anyways) without Wine, although it has trouble finding the proper config files.

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
Re: WM on Linux
« Reply #7 on: January 05, 2017, 07:02:46 AM »
SDL link shouldn't be needed - most distros install the header with the correct name (SDL.h).

(...)

The install option in the Makefile is completely broken; took me all of two minutes to fix it, or at least get it to do something useful.


The game source uses #include <sdl.h>. Again another problem of case sensitive x insensitive systems.


I haven't changed anything in the install section. Right now I am going a completely different way of compiling it using a premake script.


Premake is a nice software that creates building scripts. It will create a much better version than my handmade makefile with the added bonus of working on Mac and Windows and generating project files for visual studio, xcode and codelite.

Offline MuteDay

  • Sr. Member
  • ****
  • Posts: 421
  • Loving life and PinkPetal Family
Re: WM on Linux
« Reply #8 on: January 05, 2017, 08:07:32 AM »

The game source uses #include <sdl.h>. Again another problem of case sensitive x insensitive systems.


I haven't changed anything in the install section. Right now I am going a completely different way of compiling it using a premake script.


Premake is a nice software that creates building scripts. It will create a much better version than my handmade makefile with the added bonus of working on Mac and Windows and generating project files for visual studio, xcode and codelite.


any chance it might also support codeblocks?
Please Enjoy all the hard work i Do to help make the game and forums a better place :)

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
Re: WM on Linux
« Reply #9 on: January 05, 2017, 11:59:16 AM »

any chance it might also support codeblocks?


yep, it does. Here is a list of supported IDEs:


https://github.com/premake/premake-4.x/wiki/Premake_Quick_Start#using-premake


I have submitted a PR with the new script. And i will update instructions on how to build using it.


Offline MuteDay

  • Sr. Member
  • ****
  • Posts: 421
  • Loving life and PinkPetal Family
Re: WM on Linux
« Reply #10 on: January 05, 2017, 03:36:07 PM »
works amazing for me. at least while building with code blocks
Please Enjoy all the hard work i Do to help make the game and forums a better place :)

Offline jimbobiii

  • Newbie
  • *
  • Posts: 23
Re: WM on Linux
« Reply #11 on: January 13, 2017, 12:42:24 AM »
The premake script seems to pull in all .cpp/.h files it finds, which is a good idea in theory but broken by the current update - cScreenMovie seems to have replaced cMovieScreen, but files for both still exist. Because the premake script generates objects from both and tries to link them, the build fails as we're trying to define multiple functions of the same name.

I'm really not enjoying the idea of digging through the code to try and find the filename issue, but I'm guessing the image names get read in as a string, cast to a lowercase string at some point (during categorization?), and a call to open happens using that lowercase string as the filename rather than the original string - there's no reason this should fail on Windows, under normal circumstances. Seems to be a problem with how images are handled and not much else; girl and item files read in as they're supposed to.

If anyone wants to batch-sort their images to lowercase anyways, rather than fixing the root problem, just save the following as a bash script in your Characters folder and run it; it'll recursively go through the subfolders and rename whatever's found there to a lowercase name, while leaving folder names and .girlsx/.rgirlsx files untouched. Took under a minute to work through a 16.5GB backup folder.
Code: [Select]
for i in */;
do
    cd "$i"
    perl-rename -f 'y/A-Z/a-z/' *.*
    cd ..
done
perl-rename might be called prename on your distro, or it could even be the default rename tool, and if you have multiple files in one folder with the same name (Image,jpg, image.JPG, image.jpg, etc) something's gonna get overwritten. Might also be a pain sorting in new images in the future, and it doesn't go more than a single subdirectory deep (I have no idea if the game is even capable of mulitple-level scanning for girls/images).

Offline MuteDay

  • Sr. Member
  • ****
  • Posts: 421
  • Loving life and PinkPetal Family
Re: WM on Linux
« Reply #12 on: January 13, 2017, 02:11:48 AM »
Guess that makes it so now we have two different ways. one a bash file the other a simple application rofl
Please Enjoy all the hard work i Do to help make the game and forums a better place :)

Offline _rhetorik_

  • Jr. Member
  • **
  • Posts: 63
Re: WM on Linux
« Reply #13 on: January 14, 2017, 08:35:54 AM »
The premake script seems to pull in all .cpp/.h files it finds, which is a good idea in theory but broken by the current update - cScreenMovie seems to have replaced cMovieScreen, but files for both still exist. Because the premake script generates objects from both and tries to link them, the build fails as we're trying to define multiple functions of the same name.


You can remove a file from the premake script by doing:


Code: [Select]
excludes({'filename.cpp'})


or add a #IF 0 #ENDIF block in the cpp file ...
« Last Edit: January 14, 2017, 08:42:17 AM by _rhetorik_ »

Offline jimbobiii

  • Newbie
  • *
  • Posts: 23
Re: WM on Linux
« Reply #14 on: May 06, 2017, 03:10:11 AM »
I've got a very hackish solution for loading images regardless of case-sensitivity on Linux, which is a start, at least. Unfortunately it also essentially doubles the seek time and probably doesn't handle some edge cases. I'd have figured the easiest solution would be to just have the file handler's regex searches ignore case, but that breaks literally everything else somehow.

EDIT: or I just suck at regular expressions. 'Proper' fix turned out to be adding ten characters to one file, at the expense of what I'd call good-practices *NIX compliance. I can't think of any situation for this project where case sensitivity would be useful, though; if you've got enough images where you'd need to use both upper and lower-case variants of a filename, you've probably already got bigger problems.

Now to try and figure out the cause of the null characters in some of the displayed scripts. EDIT2: which just seem to be caused when newline characters aren't preceded by a space, which is a fix that my regex skills are good enough for.
« Last Edit: May 07, 2017, 02:22:22 AM by jimbobiii »