pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkgsrc bootstrap on mac m1,



Hello,

Longtime user of pkgsrc, although not recently. This week I tried pkgin on mac and enough binaries worked for me to switch package managers, yay!

Looking to resolve a missing package, I bootstrapped pkgsrc and found two anomalies:

Build.sh: Scanning for functions... please ignore any errors.
... which compiler type seems to be used
$ clang -E  -I.  -DMKSH_BUILDSH -D_DARWIN_C_SOURCE  conftest.c |     sed -n '/^ *[ce]t *= */s/^ *\([ce]t\) *= */\1=/p' | tr -d \015 >x
[ ct="clang"
[ et="unknown"
$ clang  -I.  -DMKSH_BUILDSH -D_DARWIN_C_SOURCE    -version
| clang-15: error: unknown argument '-version'; did you mean '--version'?
| clang-15: error: no input files
$ clang -version
| clang-15: error: unknown argument '-version'; did you mean '--version'?
| clang-15: error: no input files
$ clang --version
| clang version 15.0.7
| Target: x86_64-apple-darwin22.3.0
| Thread model: posix
| InstalledDir: /opt/pkg/bin
==> which compiler type seems to be used... clang
... if the compiler works
$ clang   -I.  -DMKSH_BUILDSH -D_DARWIN_C_SOURCE   conftest.c  || for _f in ${tcfn}*; do case $_f in *.1|*.faq|*.ico) ;; *) rm -f "$_f" ;; esac; done
] conftest.c:2:10: fatal error: 'unistd.h' file not found
] #include <unistd.h>
]          ^~~~~~~~~~
] 1 error generated.
==> if the compiler works... no
===> exited with status 1
aborted.

This was resolved by removing the pkgin prefix from my path...

export PATH=$(sed 's,/pkg/,/x-pkg/,g' <<<$PATH)
rm -rf /opt/pkgsrc/bootstrap/work/ /opt/pkg-2022Q4/*
cd /opt/pkgsrc/bootstrap && ./bootstrap \
  --prefix /opt/pkg-2022Q4 --prefer-pkgsrc yes \
  --make-jobs 4 --unprivileged

Shouldn't Build.sh properly declare the Target (this is arm64, not x86_64) and InstallDir above? Why was /opt/pkg/bin identified as target and my declared prefix /opt/pkg-2022Q4 ignored? (FWIW there is no cc in my /opt/pkg/bin and that dir is not writeable by this user).

The above PATH export seems to fix my bootstrap issue, but this could be a full stop for new users? Was it wrong to prepend (vs append) my path env with /opt/pkg/bin? Should this situation be addressed in Build.sh? It looks like more full (bootstrap) paths should be set and used in Build.sh vs relying on env PATH? What is the best approach here?

Thanks,
-George

--
George Georgalis, (415) 894-2710, http://www.galis.org/



Home | Main Index | Thread Index | Old Index