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

Add support for DragonFly BSD x86_64 #1593

Merged

Conversation

liweitianux
Copy link
Contributor

@liweitianux liweitianux commented Feb 18, 2024

DragonFly BSD is currently x86_64 only, so don't bother with other
architectures at the moment.

The changes are based on the existing support for other BSDs.

Enhance native/Makefile to include more paths for searching for X11
headers, because the X11 header paths are different on BSDs. In
addition, add the X11INC variable to allow user to specify extra paths
for X11 headers if really necessary.

Tested on DragonFly 6.5 with OpenJDK 17.0.8 and Ant 1.10.13.

@liweitianux
Copy link
Contributor Author

liweitianux commented Feb 18, 2024

For the record, the main steps to build it on DragonFly are:

$ pkg install openjdk17 apache-ant libX11 autoconf
$ env JAVA_VERSION=17 X11INCDIR=/usr/local/include ant native
$ env JAVA_VERSION=17 X11INCDIR=/usr/local/include ant dist test test-platform

By the way, I've put the built native library at: https://leaf.dragonflybsd.org/~aly/java/jna/dragonflybsd-x86-64.jar

Thank you.

@matthiasblaesing
Copy link
Member

I was naive:

  1. I grabbed the ISO from the download page: https://www.dragonflybsd.org/download/
  2. Installed from the ISO in a VirtualBox
  3. Logged in as root
  4. Configured AUTO repository according to: https://www.dragonflybsd.org/docs/howtos/HowToDPorts/#index2h2:
    image
  5. Got this:
    image

Any pointers?

Copy link
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First impression is good, I left two inline comments and will look some more when I can build this.

native/libffi/README.md Outdated Show resolved Hide resolved
native/Makefile Outdated Show resolved Hide resolved
@liweitianux
Copy link
Contributor Author

5. Got this:

Any pointers?

Hi @tuxillo, any ideas about this pkg HTTPS issue? I remember you've resolved it 😅

Thanks.

@liweitianux liweitianux force-pushed the dragonflybsd branch 2 times, most recently from b1ef244 to 923bc3a Compare February 21, 2024 02:27
@tuxillo
Copy link

tuxillo commented Feb 21, 2024

  1. Got this:

Can you please check if you have the ca_nss_root package installed?

root@:~ # pkg info | fgrep root                      
ca_root_nss-3.51.1             Root certificate bundle from the Mozilla Project

If it's installed, see if the cert.pem symlink is in place:

root@:~ # ls -l /etc/ssl/cert.pem  
lrwxr-xr-x  1 root  wheel  38 Dec 30  2022 /etc/ssl/cert.pem -> /usr/local/share/certs/ca-root-nss.crt

@liweitianux
Copy link
Contributor Author

4. Configured AUTO repository according to: https://www.dragonflybsd.org/docs/howtos/HowToDPorts/#index2h2:

Any pointers?

Ah, it seems you were making a typo in the repo config... The mirror_type should be HTTP instead of NONE.

So the AUTO repo config should read like:

AUTO: {
	url: https://pkg.dragonflybsd.org/pkg/${ABI}/LATEST
	mirror_type: HTTP
}

Cheers.

@liweitianux
Copy link
Contributor Author

If the SSL issue still exists, a workaround is to use an HTTP mirror, like the Wolfpond.

@matthiasblaesing
Copy link
Member

@liweitianux thanks for the pointers. Your pointer to check the /etc/ssl/cert.pem file was spot on. I added the symlink, updated the repository configuration (I had HTTP in it, but tested NONE, well was wrong) and the got pkg to install the necessary packages. git did not work on dragonfly (complaining about missing symbols in libcurl), but I copied my local JNA checkout with rsync.

After that the build worked surprisingly well.

Copy link
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from a the question regarding the default include directories, I think this looks done.

There is #1587 for fixing a resource leak, which means all native libraries need to be rebuild and a request to rebuild the loongarch64 binaries for older glibc. With that wave, I'll also build the dragonfly binaries.

native/Makefile Outdated Show resolved Hide resolved
@matthiasblaesing
Copy link
Member

@liweitianux could you please add either an empty version of dragonflybsd-x86-64.jar based on out-of-date.jar or your build?

DragonFly BSD is currently x86_64 only, so don't bother with other
architectures at the moment.

The changes are based on the existing support for other BSDs.

Enhance 'native/Makefile' to include more paths for searching for X11
headers, because the X11 header paths are different on BSDs.  In
addition, add the 'X11INC' variable to allow user to specify extra paths
for X11 headers if really necessary.

Tested on DragonFly 6.5 with OpenJDK 17.0.8 and Ant 1.10.13.
@matthiasblaesing matthiasblaesing merged commit 3727b4b into java-native-access:master Mar 8, 2024
8 checks passed
@matthiasblaesing
Copy link
Member

Merged to master and rebuild native libraries. Thank you.

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

Successfully merging this pull request may close these issues.

None yet

3 participants