harbour / core

Portable, xBase compatible programming language and environment
https://harbour.github.io/
Other
322 stars 207 forks source link

Alpine build #176

Open padiazg opened 6 years ago

padiazg commented 6 years ago

Hi, just want to know if anyone already tried to make an Alpine Build.

padiazg commented 6 years ago

Handled to compile in a Docker/Alpine container. Here is my github repo: https://github.com/padiazg/harbour-alpine

There is two files that had to modify, because of dependencies:

Working on test some other functionalities that are of my interest, postgres and CGI for example.

alcz commented 5 years ago

Some further comments on arc4.c problem: https://github.com/harbour/core/pull/180

Possible patch:

--- a/src/rtl/arc4.c
+++ b/src/rtl/arc4.c
@@ -50,7 +50,9 @@
 /* XXX: Check and possibly extend this to other Unix-like platforms */
 #if ( defined( HB_OS_BSD ) && ! defined( HB_OS_DARWIN ) ) || \
    ( defined( HB_OS_LINUX ) && ! defined ( HB_OS_ANDROID ) && ! defined ( __WATCOMC__ ) )
-#  define HAVE_SYS_SYSCTL_H
+#  if ( ! defined( HB_OS_LINUX ) || ( defined( __GLIBC__ ) || defined( __UCLIBC__ ) ) )
+#     define HAVE_SYS_SYSCTL_H
+#  endif
 #  define HAVE_DECL_CTL_KERN
 #  define HAVE_DECL_KERN_RANDOM
 #  if defined( HB_OS_LINUX )
felixd commented 5 years ago

@alcz No need to test for HB_OS_LINUX - already checked line above. Checking for GBLIC/UCLIBC works as well.

I have just tested that on Alpine. Works.

alcz commented 5 years ago

It is checked above together with HB_OS_BSD. I wouldn't want to change anything for such systems. They are rather non-GNU, but there is also Debian GNU/kFreeBSD.

Still my patch would touch BSD, i've edited it now, after your note. Need to make some build tests on other distros.

felixd commented 5 years ago

@padiazg It might not fix Alpine builds but works. You can use ubuntu images as build environment and then run compiled binary on Alpine (using Docker multi-stage builds).

https://docs.docker.com/develop/develop-images/multistage-build/

Example: https://github.com/felixd/docker-harbour-example/blob/master/restful-34/Dockerfile https://github.com/felixd/docker-harbour-example/blob/master/.travis.yml

Check: https://github.com/felixd/docker-harbour - based right now on ubuntu:latest https://github.com/felixd/docker-harbour-example

funlw65 commented 1 year ago

I don't know about Alpine builds... but I have Alpine 3.17 installed native (no containers) on one of my laptops and Harbour/Core compiles and installs ok if the required dev libraries are installed. It is also true for GNUCobol...

felixd commented 1 year ago

I don't know about Alpine builds... but I have Alpine 3.17 installed native (no containers) on one of my laptops and Harbour/Core compiles and installs ok if the required dev libraries are installed. It is also true for GNUCobol...

I have wrote that back in 2019. Things might have change since that time. Thanks for pointing that.