CPack create package for pacman and MSYS2/ MinGW - cmake

I already successfully created NSIS installers and Debian packages with CMake and CPack for other projects.
For a new C++ project I also want to provide various packages for different platforms. Besides Debian packages, I also want to create packages for MSYS2/ MinGW.
Now I am a little bit struggling to find documentation to create packages for MSYS2/ MinGW for pacman. Is this even possible and can CPack create packages for MSYS2/ MinGW?
Is there any documentation available or did somebody try the same? Can those packages create cross-platform? I know I can cross-compile for MinGW under Linux but can I also create those packages cross-platform?
Any hints would be appreciated! Thanks!

Related

How to configure cmake for msys2

I'm using external cmake with msys2, since cmake-gui provided by msys2 won't run (invalid win32 application). Now the problem is there's only so much I can configure using cmake-gui. I downloaded OpenALSoft today and when I ran make install it installed to C:\Program Files (x86)\. How do I configure external cmake to install into mingw32 or mingw64 depending on what's running? On top of that, I'm having a problem differentiating between PATH RPATH and PREFIX (and how those correspond to msys2 install structure), so if you could, please, clarify those too, I'd really appreciate that.
I always use this invocation to make sure the install directory is set to /mingw32 or /mingw64:
MSYS2_ARG_CONV_EXCL=- cmake . -G"MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX
And then when you want to install the built project, you must do this:
make install DESTDIR=/
All of this trickiness is due to the fact that CMake is a native Windows program that does not understand MSYS2-style paths like /, and MSYS2 has some automatic conversions of paths that happen when it detects you are running a native Windows program like CMake.
By the way, MSYS2's cmake-gui works for me, so maybe you should try reinstalling the CMake package in MSYS2 or something. However, I expect my answer to work for both the external CMake and the one in MSYS2.

How to install g++ in Cygwin?

I'm trying to compile a piece of MATLAB code containing a makefile. For the reason that I'm using Windows, I need to use Cygwin.
I have downloaded and installed Cygwin. When I tried to compile the code using make, there was an error that g++ is not found.
I searched for Cygwin package manager on the net and I installed apt-cyg but when I search for g++ using apt-cyg search g++, there is no result there!
I have updated package list (apt-cyg update) but finally I could not find c++ compiler for Cygwin!
How can I do it by apt-cyg package manager or any other way?
Try installing the package cygport. It will take care of many of the dependencies you need, including g++.
Finally I could find the answer in this link.
If one uses the MinGW installation file again, one can add some other packages.
I installed all Devel packages for MinGW and followed this tutorial which helped me to solve the problem.
If using apt-cyg and looking for g++ I would suggest to look up for the name gcc-g++ instead of just g++.
In this case the command would look like:
apt-cyg search gcc-g++ - for searching the package
or
apt-cyg install gcc-g++ - for installing the package
Hint:
Names of packages can be checked on the "Select Packages" page of the Cygwin installation program. There is no need to install, sometimes it is easier just to check the name of a package and cancel the installation.

msys2 and mingw64 gcc version mismatch? (msys-perl)

I just installed msys2 and mingw64, with their development packages. I really need perl-Gtk3. Perl is msys2 and compiled with gcc-4.9.x, Gtk and friends are mingw and compiled with gcc-5.
Perl complains "Glib.c: loadable library and perl binaries are mismatched (got handshake key 0xde00080, needed 0xdd80080)" when building Glib. Should this work?
Thanks.
PS ... mingw-w64-x86_64-perl is simply unable to compile. And yes, I'm careful to use a mingw shell vs an msys shell.
Are you still having this problem? I have been able to build a Perl dev environment in MinGW64, current as of this time.
I have been able to build Perl Gtk2 / Gtk3 applications in that environment and the GUIs work. (Both Gtk2 and Gtk3 based). These applications are used in a production environment with several thousand desktop users. The application runs on OSX, Windows, and Linux, and can be packed into a binary for release as an "executable" for those operating systems. The details here are for the Windows version.
I do this by either installing the requisite system packages first with pacman, then as necessary rebuilding whatever system library packages that I may have modified, from source, using makepkg-mingw.
Then I build the requisite Perl modules using the CPAN shell, and the "look" command.
I use pkg-config to detect what library and header files are needed.
I then build (at minimum), the Perl Glib, Pango, Cairo, Gtk2, and Gtk3 modules using the perl Makefile.PL command.
The LIBS and INC options need to be added to that command to create a Makefile that includes the correct header files, and links to the correct libraries. The EXTRALIBS and LDLOADLIBS sections of the Makefile needs be correct.
Also ExtUtils::MM_Win32.pm ExtUtils::Liblist::Kid.pm needed to be edited due to the different archname reported by the MinGW64 perl.
I am only giving a general answer, because I was thinking offing a YouTube video on this. If this is a desired topic I will.

Do I need to install wxWidget library separately when I download the wxFormbuilder?

I have recently started GUI development using wxwidget using C++ and MinGW.
Do I need to install wxWidget library separately when I download the wxFormbuilder?
Yes, you need wxwidgets installed to work with formbuilder. I suggest you to install codeblocks with mingw which you can find http://www.codeblocks.org/downloads/26 and follow this link https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide to compling wxwidgets. When you are installing formbuilder for the first I guess it will ask for the location of wxwidgets installed directory so you need to have this or else you can setup this later.
Let me know if you have queries

wxWindows 2.9 binary for windows

After an upgrade to the new Haskell Platform, my existing wxHaskell programs are broken.
They all seem to now require wxWidgets 2.9, for which I can't find any binary versions.
wxPack has 2.8, and beyond that one has to get a compiler and build it locally from what I see.
There are tutorials on this from various sources, each a few pages long, with various advice on setup, changing configurations, etc. Install wxConfig, install minGW compilers, setup configurations, rebuild, etc.
Is there any source of a simple binary install? I'd hope for some simple apt-get or cabal like tool, Haskell library tools (on Windows?) seem less integrated than others that I'm familiar with.
(Update) I did install and compile wxWidgets locally, and still cannot get the wxHaskell components to install. I'm sure that all of this just requires some fairly simple details, but again after some time already, hope not to have to spend a lot more time on this, and wish it was more automated!
Configuring wxc-0.90.0.3...
Configuring wxc to build against wxWidgets 2.9
setup.exe: Missing dependencies on foreign libraries:
* Missing C libraries: wxmsw29ud_all, wxtiffd, wxjpegd, wxpngd, wxzlibd,
wxregexud, wxexpatd, wxregexud
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: Error: some packages failed to install:
wx-0.90.0.1 depends on wxc-0.90.0.3 which failed to install.
wxc-0.90.0.3 failed during the configure step. The exception was: ExitFailure 1
wxcore-0.90.0.1 depends on wxc-0.90.0.3 which failed to install.
Yes, you can. CodeLite (C++ IDE I use) was recently upgraded to use wx29.
Since there are no binaries yet on repo, Dave set up some. Find all instruction in CodeLite's wiki below
wxWidgets 2.9 Packages and Repositories
If you are using windows Just go to download page for Codelite and download codelite with wxWidgets. Install it, copy the installed wxWidgets directory wherever it is needed!
Also it seems like there are official binaries. I have never tested download anything there so try yourself. The link is this one
Feel free to ask any question