MXE compile on linux for linux - mxe

So I saw this project http://mxe.cc/ and tried it, it seems like it is very easy to compile stuff for windows with this. I tried to hack it a little bit to compile binaries for linux instead, because, if it compiles for other system so easily how can it be hard to compile for host? 90% of the stuff seems to just build out of the box, but there are some errors and therefore I cannot build. I want to ask, how correctly should I configure mxe to build for the linux host? I know this is not supported but I don't think it should be that hard because we build from source anyway. And there are next to no modifications for downloaded sources too (in a windows build that is).
For people who might ask why I don't want to use shared stuff, I want to basically have two options:
dpkg package for user with dependencies specified (the linux way)
single standalone static executable
Any suggestions? Or maybe there's whole another guide on linux on how to build things from scratch (without a lot of manual work like mxe does)?

Related

Install v4l2loopback in WSL2

I am currently struggling with v4l2loopback installation on WSL2.
Some context:
Recently, I have read about create a virtual video device in Linux and then mock its output from an image or video file.
This is quite important for testing or developing purposes, for example in order to attach a virtual webcam that reproduces a video file as a loop to the android emulator.
After some research I got to the conclusion I don't want to use desktop applications and it might be easy to run even in a CI or similar, therefore v4l2loopback looks nice, but I am currently a Windows user.
I enabled WSL2 on my machine, downloaded the repo, and tried to execute make command like in the repo description.
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/angel/v4l2loopback modules
make[1]: *** /lib/modules/4.19.84-microsoft-standard/build: No such file or directory. Stop.
make: *** [Makefile:43: v4l2loopback.ko] Error 2
I googled a little bit and i found that issue on GitHub where a similar output (for another tool) is mentioned.
There, someone mentioned that WSL2 Kernel Config can be adjusted in order to add more modules ( maybe and hopefully one of them could make work v4l2-loopback 😂 or at least that I think).
I also googled in order to check out custom WSL builds but I am not really sure what I need to make it work or even if I am going in the right direction.
Is there something I 've missed in order to make v4l2loopback work?
In the case only a custom WSL2 build would work, how should I proceed?
Thanks in advance 🤘
I am not familiar with WSL...
-- Ah, it appears WSL doesn't have a linux kernel at all: see
https://unix.stackexchange.com/questions/594470/wsl-2-does-not-have-lib-modules .
So it's useless building the v4l2loopback mod; even if you'd be able to build it, there's nothing, no kernel, to load it!
Maybe an alternative for you might be running Virtualbox (it's free, and available for Windows) on your windows machine, and load a real Linux distro of your own choice in it. Then build the v4l2loop module, after installing the kernel development headers, and install the mod (after building, as root do insmod v4l2loop.ko) and play with it.
Thus, you are on your way. Far more elegant, and far easier. Also will have you make an enormous and important climb on the 'getting familiar with Linux' ladder, as well as maybe familiarize yourself with a virtual machine(?).
I'd definitely go for that.

Lua SDK for IntelliJ on a Linux system?

Trying to set up IntelliJ IDEA with the Lua plugin. This requires me to direct it to the location of a Lua SDK. All instructions I have been able to find for this are on a Windows system, pointing to a specific directory in Program Files. I am running a Linux system. I've built and installed Lua 5.3.4 (newest version at time of writing) from source, but as far as I can tell that doesn't include any equivalent to the SDK needed – it just drops a variety of necessary files in /usr/local/{bin,include,lib,man/man1} and creates two empty directories /usr/local/{lib,share}/lua/5.3.
Am I missing something conceptual? Do I need to get something else (the existence of which I have been unable to confirm)? Should I just give up on this and find another IDE? The plugin seems to come with two SDKs, Kahlua and LuaJ, but I don't know how well either of these match up to either standard Lua or LuaJit, which are what I would be using.
This is assuming you are using this Lua plugin for IntelliJ:
If you have installed Lua via DNF or yum simply guide IntelliJ to /urs/bin and it'll find it. (I assume this also works for other installers like apt or brew.)
It looks like the SDK is just looking for two files lua and luac which both live in /usr/bin.

Cygwin & OCaml: OPAM + Batteries

I extensively use Cygwin on a Windows 8 environment (I do not want to go ahead and boot/load Linux directly on the machine). I use the OCamlIDE plug-in for Eclipse and have experienced relatively no problems using this workflow setup.
However, I would like to use Batteries so that I may make use of use of its dynamic arrays among a few other interesting features that will speed up my development process.
I have tried this method: http://ocaml.org/install.html, but I get the following error:
$ sh ./opam_installer.sh /usr/local/bin
No file yet for i686:CYGWIN_NT-6.2-WOW64
What am I missing and how would I configure Cygwin so that it can accept the Opam installer? When I tried yet a different way of building Opam, I got:
'i686-w64-mingw32-gcc' is not recognized as an internal or external command,
as a Makefile error and reason for building failure. It seems something is wrong related to mingw32-gcc, what do I need to install and/or configure for my Cygwin to get it to compile/build things properly. I have wget and curl installed as well.
My overall question: What is the best way to get Batteries installed on my system with the minimum of time spent tracing all of its dependencies by hand? Is there a way I can just build the library module, such as BatDynArray and the includes:
include BatEnum.Enumerable
include BatInterfaces.Mappable
That way I can just call them directly in my code with open...;; and/or include...;;;
OCaml works beautifully on Windows with WODI, which is a Cygwin-based distribution that includes Batteries and tons of other useful packages (which are a pain to install manually on Windows).
I urge you to take a shot at WODI, which I believe to be an indispensable tool for the
rest of us, the forgotten souls, who have to deal with Windows.
First of all, include does not do what you think it does. open Batteries should be exactly what you're looking for. OPAM is not yet solid on windows (maybe Thomas could give an update on where things stand).
Frankly, I would recommend to install a linux on a VM, you should be able to get started with OPAM instantly then. Otherwise, take a look at this package manager for OCaml which focuses on cross platform support: http://yypkg.forge.ocamlcore.org/. I've never tried it myself however. The last package manger you could try is GODI, I'm not sure about its windows support though.
Finally, if none of these options work then it should be possible to install batteries from the source. All you need is OCaml and make. And if there are problems with this approach then you should definitely follow up on them either here or on the bug tracker because batteries does intend to support windows AFAIK.

Install Mono Runtime Locally

Here is my situation. I am on a Mac using Brew as my package manager. I had mono installed on my machine and I was doing all sorts of development in C#. I was doing web development, gui development, ect. When I tried to update my machine using Brew, I got an error. Uninstalling Mono solved the issue.
So, what I did is I toyed around and I created a 2nd user on my machine. Now, this user doesn't need anything to work. I just need Mono and Mono Develop to work on this user without installing anything globally. Everything needs to be installed locally.
So to be specific, I am the only on who uses my machine. My /Users directory looks like this.
/Users/dillon
/Users/dummy
So if I could install mono, in let's say:
/Users/dummy/.mono
Then in my .profile:
export MONO_PATH=/Users/dummy/.mono
Obviously this isn't a perfect world but I was wondering if anyone is an expert on this subject?
(Also, I use this dummy user for other stuff, I use it for Wine and I have a collection of software from school on this user.)
You need to build Mono from source to install it into a custom location (in which case you can install it anywhere you like).
You can install MonoDevelop.app anywhere, but getting it to use your custom Mono is a bit trickier. You might be able to make it work by mucking around with the relevant environment variables though.
How to install Mono in a custom location and the relevant environment variables is all covered here: http://mono-project.com/Parallel_Mono_Environments

Cross platform patching

I have a program that I intend to install on Linux and Windows machines. I have it cross-compiling fine (with autotools), but at some point I would like the program to be able to update its binaries. The only ways I can think of doing this are:
Give users write access to "C:\Program Files\Foo Program" or "/usr/bin/foo_program".
or
Install the program to the user's profile/home directory.
Neither of these seems like a good idea. What would you do?
You need to give us more details on what you are trying to do - I don't understsand the link between cross platform, patching and your question.
If you need to be able to auto update the program, on linux at least, the best solution is to provide a binary package (rpm, deb, whatever, depending on your target), which is updated regularly - so that new versions will be picked up by the package manager. On windows and mac os x, things are usually more decentralized, each program has its own update manager. The best technical solution depends on the technology (C/C++/python/whatever). One exception I can think of on Linux is vmplayer, which tells you when there is a new version - but you still have to install the new version.
If the program binary is writeable, you could download the patch or the new bits to %TEMP% or /tmp then apply them to the binary. I don't think you need to be able to create new files in the directory. But you're going to run into problems on Windows with the file being in use while you try and patch it.