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

libbsd: new Portfile 0.11.7 & files #19785

Closed
wants to merge 6 commits into from

Conversation

Zweihorn
Copy link
Contributor

@Zweihorn Zweihorn commented Aug 6, 2023

Provides new port libbsd and subport libbsd-devel with new Portfile and patch files.

  1. Currently, only the subport 'libbsd-devel' with patches builds successfully, based on an upstream git branch with macOS improvements.
  2. WIP: The port 'libbsd' is known to fail. There is contact with the upstream maintainer and the aim to have the patches included in an upstream version in the foreseable future.

Thanks to @guillem as the 'libbsd' upstream maintainer of the freedesktop project.

Description

Utility functions from BSD systems, stripped down to a subset of utilities not available to Mac OS X / macOS yet.

This library provides useful functions commonly found on BSD systems, and lacking on others like GNU systems. Thus making it easier to port projects with strong BSD origins, without needing to embed the same code over and over again on each project.

ref https://libbsd.freedesktop.org/wiki/
ref https://gitlab.freedesktop.org/libbsd/libbsd

However, this libbsd port provides a minimized subset of utilities and was reduced to those BSD functions which are not available to Mac OS X / macOS platforms by SDK on default.

This subset of BSD utilities new to macOS is:

  1. closefrom
  2. dehumanize_number
  3. explicit_bzero
  4. expand_number
  5. flopen
  6. freezero
  7. humanize_number
  8. pidfile
  9. reallocarray
  10. recallocarray
  11. setproctitle
  12. strtoi
  13. strtou
  14. timeconv

The libbsd-devel sub-port provides the development version of the libbsd port, as appropriate.

A new Portfile was established accordingly.

Patch files solely address the build process to allow for a build on macOS and are based on the existing files of the autotools chain. There is no change to the code of any utility. The patches (besides the b.m. workaround) should be reusable and should have no true influence on the build process to other operating systems.

The patch files included are:

  • patch010-configure.ac.diff - introducing new need_X flags as applicable for macOS and reordering most of the statements alphabetically to not get lost
  • patch015-src_Makefile.am.diff - making use of a.m. flags to reduce to a subset of utilities and reordering most of the statements alphabetically
  • patch016-src_Makefile.am_libbsd.sym.diff - cleaning the symbol table based on a workaround for macOS kindly provided by the upstream maintainer
  • patch017-test_Makefile.am.diff - making use of a.m. flags to reduce tests as applicable and reordering most of the statements alphabetically
  • patch018-man_Makefile.am.diff - combining existing manual pages by making use of a.m. flags to reduce make of manual pages as applicable to macOS and reordering most of the statements alphabetically

The 'include' files were not touched intentionally.

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 11.7.9 20G1426 x86_64
Xcode 13.0 13A233

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?

* 'libbsd v0.11.7' from FreeBSD
*  port 'libbsd' & subport 'libbsd-devel'
* port 'libbsd' known to fail
* subport 'libbsd-devel' with patches
  - taken from branch w/ macos improv
  - builds successfully
  - provides tests
  - CAVEAT: utility 'closefrom' fails
* WIP
@Zweihorn
Copy link
Contributor Author

Zweihorn commented Aug 6, 2023

NB: Builds with both 'libmd' 1.0.4_1 port and my local 'libmd' 1.1.0 port update.

ref #19784

@Zweihorn Zweihorn changed the title libbsd: new Portfile 0.11.7 & files (WIP) libbsd: new Portfile 0.11.7 & files Aug 7, 2023
@Zweihorn Zweihorn mentioned this pull request Aug 7, 2023
11 tasks
@Zweihorn
Copy link
Contributor Author

Zweihorn commented Aug 8, 2023

Provided as Merge Request (MR) to the upstream project.
re: https://gitlab.freedesktop.org/libbsd/libbsd/-/merge_requests/27

devel/libbsd/Portfile Outdated Show resolved Hide resolved
devel/libbsd/Portfile Outdated Show resolved Hide resolved
devel/libbsd/Portfile Outdated Show resolved Hide resolved
devel/libbsd/Portfile Outdated Show resolved Hide resolved
devel/libbsd/Portfile Outdated Show resolved Hide resolved
devel/libbsd/Portfile Outdated Show resolved Hide resolved
Update Portfile according to reviewer comments.
* Make use of 'PortGroup gitlab 1.0'

libbsd
* Move 'livecheck' here

libbsd-devel
* Set version explicitly
* Reorder 'depends_build' alphabetically

Re: https://github.com/macports/macports-ports/pull/19785/files/d5415d81aeaf0d6bdad3a334930870d935e615c5
libbsd: new port & sub-port with new Portfile 0.11.7 & patch files

* 'libbsd v0.11.7' from FreeBSD
* port 'libbsd' & subport 'libbsd-devel'
* port 'libbsd' known to fail
* subport 'libbsd-devel' with build patches
  - taken from upstream branch w/ macos improv
  - builds successfully
  - provides tests
  - CAVEAT: utility 'closefrom' fails test
* provides patches specific to the build process
* no patches to the upstream code basis

Furthermore:

* Make use of 'PortGroup gitlab 1.0'

libbsd
* Move 'livecheck' here

libbsd-devel
* Set version explicitly
* Reorder 'depends_build' alphabetically

Re: https://github.com/macports/macports-ports/pull/19785/files/d5415d81aeaf0d6bdad3a334930870d935e615c5
…macports-ports into libbsd-0.11.7a"

This reverts commit 41b9016, reversing
changes made to 961db61.
@Zweihorn
Copy link
Contributor Author

This mess calls for a new branch, I presume.

@Zweihorn Zweihorn closed this Aug 29, 2023
@Zweihorn Zweihorn deleted the libbsd-0.11.7a branch August 29, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants