1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
# PORTING MG AND USING LIBBSD
I've maintained and ported mg for quite some time now and at first it was easy
recently it got harder and harder, since it was a moving target. Especially the
inclusion of some system specific libraries since about 2 years ago made it too
much of an effort for my humble coding skills.
So recently Jasper Lievisse Adriaanse asked me to try it again and I restarted
working on the project and ran into exactly the same problems again. While
googling for solutions, I ran into libbsd:
http://libbsd.freedesktop.org/wiki/
It's a porting library for OpenBSD code! And after installing that, it was a
piece of pie to get mg ported again.
## PORTING TO ALL OTHER PLATFORMS
Okay, that was Linux. Now I have to get the rest of all the previously supported
platforms working again. All help is welcome and as always: Please provide
patches, that do not break stuff for other platforms.
## BUILDING MG
So, basic instructions for building mg:
- Get the libbsd and libncurses dev packages installed.
- Run the following commands:
```
make
sudo make install
```
## USING CMAKE
You can also build mg with cmake, it goes like this:
- Get the libbsd and libncurses dev packages installed.
- Run the following commands:
```
mkdir build
cd build
cmake ..
make
sudo make install
```
*Kudos to Leonid Bobrov(@mazocomp) for adding CMAKE support.*
## USING MESON
You can also build mg using meson:
- Get the libbsd and libncurses dev packages installed.
- Run the following commands:
```
meson setup build
meson compile -C build
sudo meson install -C build
```
## STATIC BUILDS (on Linux)
I recently figured out how to make really portable static builds: On an alpine
linux system, build with the command:
```
make STATIC=yesplease
```
The default glibc provided with almost any other linux version does not really
support static binaries. https://www.musl-libc.org/ does not have this problem.
To make building static binaries more easy, check the mg-static directory, there
is a script which can build static binaries with support of podman and buildah.
## USING CVS
This code is the cvs checkout from the OpenBSD project, so if you install cvs
you can see the changes I made to make mg portable; Like this:
```
CVS_RSH=ssh cvs diff -uw
```
## FEATURE REQUESTS
I just maintain the port, all I do is importing all changes from the upstream
OpenBSD mg repository:
https://cvsweb.openbsd.org/src/usr.bin/mg/?sortby=date#dirlist
So your best course of action is to send them a feature request, or even better,
send them a patch.
## OUT OF SYNC
If you noticed portable mg is not in sync with the upstream release, feel free
to drop me a note and I'll update it ASAP.
|