Help getting new port nrsc5 working

Joshua Root jmr at macports.org
Sat Apr 8 21:09:10 UTC 2023


On 9/4/2023 06:13, blake at netjibbing.com wrote:
> I have had this nrsc5 port sitting around for a long time in a broken 
> state. Would you happen to have any suggestions on how to address this 
> build error?
> 
> Full build log: 
> https://gist.github.com/trodemaster/2ef9d94db3b894ff690ebd365afed0cd 
> <https://gist.github.com/trodemaster/2ef9d94db3b894ff690ebd365afed0cd>
> WIP port file: 
> https://github.com/trodemaster/blakeports/blob/main/audio/nrsc5/Portfile 
> <https://github.com/trodemaster/blakeports/blob/main/audio/nrsc5/Portfile>
> 
> 
> /opt/local/var/macports/build/_opt_mports_blakeports_audio_nrsc5/nrsc5/work/nrsc5-59bc2968485635c16c7250696abc3e8ff765b72d/src/nrsc5.c:548:15: error: conflicting types for 'nrsc5_pipe_samples_cu8'
> NRSC5_API int nrsc5_pipe_samples_cu8(nrsc5_t *st, const uint8_t 
> *samples, unsigned int length)
>                ^
> /opt/local/include/nrsc5.h:578:5: note: previous declaration is here
> int nrsc5_pipe_samples_cu8(nrsc5_t *st, uint8_t *samples, unsigned int 
> length);
>      ^

 From the log:

:info:build cd 
/opt/local/var/macports/build/_opt_mports_blakeports_audio_nrsc5/nrsc5/work/build/src 
&& /usr/bin/clang -DGIT_COMMIT_HASH=\"unknown\" -D_GNU_SOURCE 
-I/opt/local/include 
-I/opt/local/var/macports/build/_opt_mports_blakeports_audio_nrsc5/nrsc5/work/build/src 
-I/opt/local/var/macports/build/_opt_mports_blakeports_audio_nrsc5/nrsc5/work/nrsc5-59bc2968485635c16c7250696abc3e8ff765b72d/include 
-pipe -Os -DNDEBUG -I/opt/local/include 
-isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -arch 
arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk 
-mmacosx-version-min=13.0 -fPIC --std=gnu11 -O3 -Wall -MD -MT 
src/CMakeFiles/nrsc5_object.dir/nrsc5.c.o -MF 
CMakeFiles/nrsc5_object.dir/nrsc5.c.o.d -o 
CMakeFiles/nrsc5_object.dir/nrsc5.c.o -c 
/opt/local/var/macports/build/_opt_mports_blakeports_audio_nrsc5/nrsc5/work/nrsc5-59bc2968485635c16c7250696abc3e8ff765b72d/src/nrsc5.c

The first '-I/opt/local/include' in that command is before the two -I 
flags specifying locations inside the workpath. The order that -I flags 
are specified on the command line controls the order in which 
directories are searched when a header is included. So 
/opt/local/include/nrsc5.h is found instead of the nrsc5.h in the source 
directory.

You'll most likely need to patch the CMakeLists.txt to fix this. Find 
where those flags are added and ensure that the internal locations are 
added to the start of the flags, and externally specified flags are 
added to the end. IIRC, cmake has BEFORE and AFTER options you can 
specify when adding include directories.

- Josh


More information about the macports-dev mailing list