discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Windows distribution viability


From: Riccardo Mottola
Subject: Re: Windows distribution viability
Date: Thu, 12 Dec 2024 18:14:29 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.19

Hi Simon,


Simon Gornall wrote:
I’ve been a Mac engineer for the last couple of decades, and now I find myself looking at writing something that will work on both Windows and the Mac. If it were just for me, (from reading around) I think it’d be quite straightforward - just install MSYS, the GNUstep packages, and start running with it, but I might want to distribute this application in the future, and I’m cautious about requiring a GNUstep install as a part of that, it seems like a reasonably high bar.

I distribute a windows Application regularly since years and will give you some details on my setup.

Until some years ago, MinGW of MSYS ("1") was our way to build on windows and distribute things. For that, we supplied NSIS installers for GNUstep core and developer tools. This allowed then to distribute your application the same way, using the GS core non-dev package as a requirement. Unfortunately, while that environment still works, it is not really maintained anymore so we use MSYS2 and MinGW32 or MinGW64.
That one has an internal package manager system (pacman).

Maybe NSIS installers could be created also for MSYS2, but never delved into it.

So, an way to get things on windows is install all packages from the command line. You could in theory also make your app available such way. You need to supply inside the folder a specially crafted configuration file

There is however a third way, which is the currently the one I settled to: a self-contained folder. a GNUstep app will look first in system for libraries, but then also for the whole tree inside itself.

At the end, libraries are DLLs, so it is a matter of getting all paths and dependencies to work. MSYS and MINGW themselves are at core a main DLL for runtime purposes.

More details below.

It is very convenient, unzip and start. Of course it is a "fat" distribution and useful for one app, if you have more than one, you would end up duplicating things


In fact, I’ll be using SDL (3, if it matters) for the graphics side (which is cross-platform), what I’m really after here is the runtime and Foundation framework that I’ve come to know and love - even better if it has ARC :)

If you settle to the GCC runtime (no ARC) you get it ready as a package from pacman of msys. So it is a matter of installing deps and then just building gnustep core with "configure, make install" and then your own frameworks and apps.

In my app I use standard AppKit and for my needs the win32 backend is enough, the code is well portable. No need for SDL or C++, but YMMV.


Here a guide I wrote:
https://mediawiki.gnustep.org/index.php/Installation_MSYS2

If you want the libobjc2 runtime instead, you need additional steps to install it and additional dependencies.



I have read a fair number of “it’s hard to get it working on Windows” posts/articles but I’m hoping these are a bit self-selecting - people who did struggle and wrote about it doesn’t mean that everyone struggles… They’re also a bit older, and I’m (again) hoping things keep improving :)

No getting it on windows it not that difficult, as proven. But depending on your method of distribution existing solutions may suit you or not.

I thus prepare an environment with GNUStep and there I install many frameworks and applications and run from the command line.

When I want to distribute, I run a script that packages and copies all things together and then removes things not needed. That part needs to be tweaked depending the dependency of each app and what your installation contains.

You can check
https://github.com/rmottola/DataBasin

There note two special files:

https://github.com/rmottola/DataBasin/blob/master/windows-GNUstep.conf
This represents the configuration to find the whole GNUstep distribution

This instead is the script, commented, I think you can understand it:
https://github.com/rmottola/DataBasin/blob/master/windows_package.sh

I tried to make it parametric... perhaps you just need to change APP_NAME :)

This copies also MINGW DLLs, so you end up with a folder where you can just launch your app with "double click" on the exe. Technicall a "snapshot".

There are minor details that can be discussed and improved, if you are interested in this method.

Riccardo






reply via email to

[Prev in Thread] Current Thread [Next in Thread]