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

FreeBSD fixes #2864

Merged
merged 2 commits into from
Oct 17, 2018
Merged

FreeBSD fixes #2864

merged 2 commits into from
Oct 17, 2018

Conversation

sghctoma
Copy link
Contributor

This PR fixes two issues on FreeBSD:

  1. CLOCK_MONOTONIC appeared in IEEE Std. 1003.1-200x, it was not part of POSIX.1b (the 1993 version). FreeBSD treats it accordingly, thus _POSIX_C_SOURCE needs to be set to 200112L.
  2. PR Make SYSCONFDIR FHS compliant when "prefix" is set #2855 basically hardcodes the config file path to /etc, which is a problem on e.g. FreeBSD, where the expected path for config files of non-base software is '/usr/local/etc'. Meson sets sysconfdir to '/etc' explicitly only when prefix is '/usr', so it is still possible to use '/usr/local' as prefix, and install the config files under '/usr/local/etc'. This commit allows to do that by setting sysconfdir based on whether prefix is '/usr', or not.

CLOCK_MONOTONIC appeared in IEEE Std. 1003.1-200x, it was not part of
POSIX.1b (the 1993 version), and FreeBSD treats it accordingly.
PR swaywm#2855 basically hardcodes the config file path to /etc, which is a
problem on e.g. FreeBSD, where the expected path for config files of
non-base software is '/usr/local/etc'.
Meson sets sysconfdir to '/etc' explicitly only when prefix is '/usr',
so it is still possible to use '/usr/local' as prefix, and install the
config files under '/usr/local/etc'. This commit allows to do that by
setting sysconfdir based on the value of prefix.
@ddevault ddevault merged commit 46dafbf into swaywm:master Oct 17, 2018
@ddevault
Copy link
Contributor

Thanks!

@ddevault
Copy link
Contributor

Hey, can you write a little shell script which compiles wlroots and sway from scratch on FreeBSD? I'll translate this into a build file and we can do continuous integration on FreeBSD to catch these errors earlier.

@sghctoma
Copy link
Contributor Author

Yeah, sure, I'll write the script this weekend.

@sghctoma
Copy link
Contributor Author

Hey, @SirCmpwn

I've put the script here: https://gist.github.com/sghctoma/df3acbe8f082c593fa53670d2836f397
You will need FreeBSD 12 for this, and the script will only build wlroots and sway, you won't be able to run it (because we don't have EVDEV support in the default kernel, and there are some issues with epoll-shim).

2 similar comments
@sghctoma
Copy link
Contributor Author

Hey, @SirCmpwn

I've put the script here: https://gist.github.com/sghctoma/df3acbe8f082c593fa53670d2836f397
You will need FreeBSD 12 for this, and the script will only build wlroots and sway, you won't be able to run it (because we don't have EVDEV support in the default kernel, and there are some issues with epoll-shim).

@sghctoma
Copy link
Contributor Author

Hey, @SirCmpwn

I've put the script here: https://gist.github.com/sghctoma/df3acbe8f082c593fa53670d2836f397
You will need FreeBSD 12 for this, and the script will only build wlroots and sway, you won't be able to run it (because we don't have EVDEV support in the default kernel, and there are some issues with epoll-shim).

@ddevault
Copy link
Contributor

Thanks @sghctoma! I'll get this working soon.

@sghctoma
Copy link
Contributor Author

My pleasure.
And sorry for sending this three times, plus in e-mail. I was getting error messages, and my comments didn't show up here when I sent them because of the GitHub outage.

@ddevault
Copy link
Contributor

Can you give me that patch in a more patchy form? This sort of base64 thing doesn't translate well to my CI platform.

@ddevault
Copy link
Contributor

Another couple of issues:

  • I hit automake issues when installing wayland-protocols from ports: details
  • Can you send me an email and/or patch with the necessary fixes for scdoc?

I can also hook you up with a sr.ht account if you want to play with this build manifest yourself.

I hope these comments are getting through...

@sghctoma
Copy link
Contributor Author

The patch agains the ports tree would be quite large (~160kB), but I've just found out GitHub also "speaks" SVN, so I can export individual directories from a repo. This version of the script uses this to get new libinput+deps: https://gist.github.com/sghctoma/d627dbb72d262a45187cda0542e1bef0
Is it ok this way?

Looking at the builds.sr.ht job, it seems you have an old ports tree (wayland-protocols 1.12 and wayland 1.14), I think that's the reason of the automake issue. You need to run portsnap fetch update.

As for scdoc, I was reading the Makefile of an older version, and didn't realize I can set MANDIR form env. Anyways, I'll send a patch that does that automatically.

An sr.ht account would be nice, thanks! I've tried setting it up in a VM, but had some troubles with the database, and didn't have much time to troubleshoot yet.

@ddevault
Copy link
Contributor

This version of the script uses this to get new libinput+deps: >https://gist.github.com/sghctoma/d627dbb72d262a45187cda0542e1bef0
Is it ok this way?

Sure.

Looking at the builds.sr.ht job, it seems you have an old ports tree (wayland-protocols 1.12 and wayland 1.14), I think that's the reason of the automake issue. You need to run portsnap fetch update.

Ah, thanks. Do you think this is something I should be running for all FreeBSD users when booting up their build VMs?

@ddevault
Copy link
Contributor

portsnap fetch update - can this be done non-interactively?

@ddevault
Copy link
Contributor

@sghctoma
Copy link
Contributor Author

Do you think this is something I should be running for all FreeBSD users when booting up their build VMs?

To be honest, I would reconsider even installing the ports tree in the first place by default. Mixing ports and packages is generally not a good idea because of the version differences (installing from ports could result in rebuilding lots of stuff), and I would assume most users won't need it anyways. Those who do, could fetch it from manifest.
But if you do install it, than yes, updating when booting up would be a good idea.

portsnap fetch update - can this be done non-interactively?

This should be non-interactive by default (without the --interactive option), but will check.

Issues with job 9016:

  • You try to run portsnap without sudo (also pkg remove and the epoll-shim.pc redirect)
  • portsnap cron is not a good idea here, since it sleeps a random amount up to one hour.

I'll get my builds.sr.ht running, and fix the manifest today.

@sghctoma
Copy link
Contributor Author

Okay, I see why you did portsnap cron. I'm trying to find a solution for this.

@sghctoma
Copy link
Contributor Author

Here is my current manifest: https://builds.sr.ht/api/jobs/9140/manifest
It builds wlroots, but you need FreeBSD 12.0 (which is currently in BETA1 phase) for sway because of this bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231425

@ddevault
Copy link
Contributor

Thanks! I'll adapt this for wlroots and we'll add sway when FreeBSD 12 rolls around.

@ddevault
Copy link
Contributor

Sorry for the wait, I had to add support for this to dispatch.sr.ht...

swaywm/wlroots#1336

@sghctoma
Copy link
Contributor Author

Thanks! I'll adapt this for wlroots and we'll add sway when FreeBSD 12 rolls around.

Awesome, glad I could help!
FreeBSD 12 is due in late December, I will remind you when it's released.

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

Successfully merging this pull request may close these issues.

2 participants