Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling in Alpine and Arch linux #43

Open
MorganPeterson opened this issue Apr 13, 2020 · 4 comments
Open

Compiling in Alpine and Arch linux #43

MorganPeterson opened this issue Apr 13, 2020 · 4 comments

Comments

@MorganPeterson
Copy link

MorganPeterson commented Apr 13, 2020

Related to #41
Compiling in Alpine linux from the master branch results in the compiler not finding curses.h and not having the man directory /usr/local.

I made these changes in config.def.h:

diff --git a/config.def.h b/config.def.h
index 248b296..f6ed0fc 100644
--- a/config.def.h
+++ b/config.def.h
@@ -61,7 +61,7 @@
 
 /* The path for the wide-character curses library. */
 #ifndef NCURSESW_INCLUDE_H
-    #if defined(__APPLE__) || !defined(__linux__) || defined(__FreeBSD__)
+    #if defined(__APPLE__) || !defined(__linux__) || !defined(linux) || defined(__FreeBSD__)
         #define NCURSESW_INCLUDE_H <curses.h>
     #else
         #define NCURSESW_INCLUDE_H <ncursesw/curses.h>

Then compiled it this way:

MANDIR=/usr/share make && make install

That allowed it to compile on Alpine.

On Arch Linux I had to do the same line replacement in config.def.h, but I did not have to change the MANDIR argument.

@MorganPeterson MorganPeterson changed the title Compiling in Alpine linux Compiling in Alpine and Arch linux Apr 15, 2020
@GuillaumeFavelier
Copy link

Thanks for reporting this!

I was able to compile it on my Arch linux once I applied the patch you described.

I just typed y when:

cp -i config.def.h config.h
cp: overwrite 'config.h'?

@domrc
Copy link
Contributor

domrc commented Apr 16, 2021

I do not get what this patch does for Arch Linux. mtm compiles fine, without modification, from https://aur.archlinux.org/packages/mtm-git/ (for me at least, on multiple x86_64 machines)
I can not speak for Alpine Linux.

@JackalSix
Copy link

Well if you look at the pkgbuild on aur it runs make with:
HEADERS='-DNCURSESW_INCLUDE_H="<ncurses.h>"'
So it looks like they just fix the same thing this patch would manually.

@domrc
Copy link
Contributor

domrc commented Sep 3, 2021

I quick decided to see if the patch would remove the need for said $HEADERS variable. I modified the PKGBUILD to comment out the HEADERS=... from the make line. I checked to see if it would build without it. It did not compile.
Then I used a prepare() function to patch the config.h and add the || !defined(linux) to the line modified in the patch. It didn't either.

TL;DR @JackalSix, I tried to see if that was the case, but it doesn't seem that way. Or maybe I'm missing something.

P.S. I then tried patching in || defined(linux) (not inverting this time) and got a compile without that HEADERS variable. But I don't know if that will mess with compiling on other Linux distros. HEADERS just seems safer at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants