Page MenuHomeFreeBSD

macOS patches for freebsd/pkg
AbandonedPublic

Authored by wosch on Mon, Jan 5, 3:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 8:14 AM
Unknown Object (File)
Fri, Jan 9, 6:20 PM
Unknown Object (File)
Thu, Jan 8, 5:53 AM
Unknown Object (File)
Wed, Jan 7, 7:26 AM
Unknown Object (File)
Tue, Jan 6, 1:05 PM
Unknown Object (File)
Mon, Jan 5, 10:47 PM
Subscribers
None

Details

Reviewers
bapt
Summary

To run `make packages' on macOS (cross compiling) we need a pkg(8) compiled and running on macOS.

This patch fixes a compile issue with memrchr for curl and sql long mapping.

see also
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=288165

Test Plan

here is a script to test the build on macoOS
curl -sSf -L -O https://people.freebsd.org/~wosch/tmp/pkg-macos.sh
sh pkg-macos.sh

on FreeBSD

git clone https://github.com/freebsd/pkg
curl -sSf -L -O https://people.freebsd.org/~wosch/tmp/pkg.diff
cd pkg
patch < ../pkg.diff
git clean -fdx; ./autogen.sh; ./configure; make -j $(sysctl -n hw.ncpu); ./src/pkg --version

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

wosch requested review of this revision.Mon, Jan 5, 3:41 PM
wosch created this revision.
external/libcurl/Makefile.autosetup
88

on macos why not using system libcurl ?

libpkg/pkg.h.in
56

this a too broad definition, this should only be defined in internal's header (this is public header.

libpkg/private/pkg.h
659

this breaks build on regular freebsd

there was a CI for macos, but because libatf and kyua broke, we removed mac for the ci.

Note this is how we configure pkg on macos in the ci: https://github.com/freebsd/pkg/blob/main/.github/workflows/build.yaml#L143

I have readded the macos CI and fix the code that needs fixing, I still consider we should use the installed libcurl when building on macos so I haven't fixed the libcurl part.

wosch abandoned this revision.EditedMon, Jan 12, 8:43 PM

I have readded the macos CI and fix the code that needs fixing, I still consider we should use the installed libcurl when building on macos so I haven't fixed the libcurl part.

I checked the latest version of https://github.com/freebsd/pkg and it works out-of-the-box on macOS 14/15/26 (arm + intel) with all clang versions 17 (system), 19,20,21

brew install autoconf automake libtool pkg-config libarchive openssl@3
env PKG_CONFIG_PATH=$(brew --prefix libarchive)/lib/pkgconfig ./configure --with-libcurl --with-libarchive.pc --with-openssl.pc CC=clang CXX=clang
make -j $(nproc)

Closing the review, many thanks!