(SOLVED) Install mingw-w64 for cross compiling

Hi,

I am trying to cross compile from Manjaro to Windows, but to do so I need to install mingw-w64. How can I do this? It does not look like there is a package provided by Manjaro so I have been looking at the AUR repositories. I will be honest in saying I am not sure how to build packages from the AUR when dependencies are required.

What I have tried:

sudo pacman -Syu
sudo pacman -Ss mingw

which yields no results. I then did this:
pamac search mingw-w64-gcc
with result:

mingw-w64-gcc-bin  10.1.0-1  AUR 
    Cross GCC for the MinGW-w64 cross-compiler (pre-compiled)

But when I install:

pamac install mingw-w64-gcc-bin

I get:

Error: Failed to prepare transaction: target not found: mingw-w64-gcc-bin

I then tried from this post after installing yay:

yay -Ss mingw-w64
yay -S --needed mingw-w64-gcc mingw-w64-g++ 

which ends up with:

==> ERROR: PKGBUILD contains CRLF characters and cannot be sourced.
error downloading sources: mingw-w64-crt-bin

Usually when I get this CRLF error I simply use dos2unix to convert the file, but this seems like the files downloaded have the error and I am unsure on how to change files being downloaded...

Any ideas on what steps I can take to install mingw-w64 on Manjaro?

did you try.
pamac build mingw-w64-gcc-bin

I did not, but when I tried it now I get the same result:

Preparing...
Cloning mingw-w64-gcc-bin build files...
Checking mingw-w64-gcc-bin dependencies...
Error: Failed to prepare transaction: target not found: mingw-w64-gcc-bin

Edit build files ? [y/N] n

I solved this with a manual installation, unfortunately I am unsure on how to update the script to install the dependencies. I will leave the steps I followed here for if anyone may ever find this useful.

I downloaded the following tar files from this site (each download will go to the AUR repo):

mingw-w64-binutils-bin
mingw-w64-crt-bin
mingw-w64-headers-bin
mingw-w64-winpthreads-bin

Manually extracted each file and ran makepkg -si within each folder.

Once all the dependencies were installed I ran pamac build mingw-w64-gcc-bin and still got an error. So then downloaded the file mingw-w64-gcc-10.1.0.tar.xz from the same site and created a file called PKGBUILD in the same directory as the mingw-w64-gcc-10.1.0.tar.xz file.

Then copied the contents of the build file (shown by the error of the build command) pasted that in the PKGBUILD file. Edited the source("dir/to/mingw-w64-gcc-10.1.0.tar.xz")line and ran:

makepkg -si

which then successfully installed the mingw-w64 package.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by