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

Pkgconfig CMake compatibility & switch to pkgconf #693

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install lld llvm coreutils
brew install lld llvm coreutils pkgconf
- name: Build
run: ./.ci_build_samples.sh
ubuntu:
Expand All @@ -57,6 +57,6 @@ jobs:
- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt-get -y install llvm lld
sudo apt-get -y install llvm lld pkgconf
- name: Build
run: ./.ci_build_samples.sh
2 changes: 1 addition & 1 deletion bin/activate
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CLANG_VERSION=$(clang --version | grep version | grep -o -m 1 "[0-9]\+\.[0-9]\+\
CLANG_VERSION_NUM=$(echo "$CLANG_VERSION" | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/')

if [ $CLANG_VERSION_NUM -lt 100000 ]; then
echo You have clang $CLANG_VERSION installed, but nxdk requires at least version 10. You may experience breakage.
echo You have clang $CLANG_VERSION installed, but nxdk requires at least version 10. You may experience breakage. >&2
fi

if [ "$1" = "-s" ]; then cat <<- DONE
Expand Down
6 changes: 3 additions & 3 deletions bin/nxdk-pkg-config
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export PKG_CONFIG_PATH=""
export PKG_CONFIG_SYSROOT_DIR=""
export PKG_CONFIG_LIBDIR=${NXDK_DIR}/lib/pkgconfig:${NXDK_DIR}/share/pkgconfig

[ "$1" = '--version' ] && exec pkg-config --version
exec pkg-config \
[ "$1" = '--version' ] && exec pkgconf --version
exec pkgconf \
--define-variable=NXDK_DIR=${NXDK_DIR} \
--define-prefix \
--static \
"$@"
"$@" | sed 's/\.lib\.lib/\.lib/g'
Copy link
Member

@JayFoxRox JayFoxRox Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow the PR description.

I thought the .lib.lib only happens when using --msvc-syntax, but now --msvc-syntax is absent?
(Also, why does it produce .lib.lib? This feels like a bug - was it reported?)

2 changes: 1 addition & 1 deletion lib/pkgconfig/SDL2_image.pc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Name: SDL2_image
Description: image loading library for Simple DirectMedia Layer
Version: 2.0.5
Requires: sdl2 >= 2.0.9 libjpeg libpng
Libs: ${NXDK_DIR}/lib/libSDL2_image.lib
Libs: -l${NXDK_DIR}/lib/libSDL2_image.lib
Cflags: -I${NXDK_DIR}/lib/sdl/SDL2_image
2 changes: 1 addition & 1 deletion lib/pkgconfig/SDL2_ttf.pc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Name: SDL2_ttf
Description: ttf library for Simple DirectMedia Layer with FreeType 2 support
Version: 2.0.14
Requires: sdl2 >= 2.0.9
Libs: ${NXDK_DIR}/lib/libSDL_ttf.lib ${NXDK_DIR}/lib/libfreetype.lib
Libs: -l${NXDK_DIR}/lib/libSDL_ttf.lib -l${NXDK_DIR}/lib/libfreetype.lib
Cflags: -I${NXDK_DIR}/lib/sdl -I${NXDK_DIR}/lib/sdl/SDL_ttf
4 changes: 2 additions & 2 deletions lib/pkgconfig/libjpeg.pc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: libjpeg
Description: A SIMD-accelerated JPEG codec that provides the libjpeg API
Version: 2.0.4
Libs: ${NXDK_DIR}/lib/libjpeg.lib
Cflags: -I${NXDK_DIR}/lib/libjpeg/libjpeg-turbo -I$(NXDK_DIR)/lib/libjpeg
Libs: -l${NXDK_DIR}/lib/libjpeg.lib
Cflags: -I${NXDK_DIR}/lib/libjpeg/libjpeg-turbo -I${NXDK_DIR}/lib/libjpeg
2 changes: 1 addition & 1 deletion lib/pkgconfig/libpng.pc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Name: libpng
Description: Loads and saves PNG files
Version: 1.6.37
Requires: zlib
Libs: ${NXDK_DIR}/lib/libpng.lib
Libs: -l${NXDK_DIR}/lib/libpng.lib
Cflags: -I${NXDK_DIR}/lib/libpng -I${NXDK_DIR}/lib/libpng/libpng
2 changes: 1 addition & 1 deletion lib/pkgconfig/sdl2.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Description: Simple DirectMedia Layer is a cross-platform multimedia library des
Version: 2.0.9
Requires:
Conflicts:
Libs: ${NXDK_DIR}/lib/libSDL2.lib
Libs: -l${NXDK_DIR}/lib/libSDL2.lib
Cflags: -I${NXDK_DIR}/lib/sdl/SDL2/include -DXBOX
2 changes: 1 addition & 1 deletion lib/pkgconfig/zlib.pc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Description: zlib compression library
Version: 1.2.11

Requires:
Libs: ${NXDK_DIR}/lib/libzlib.lib
Libs: -l${NXDK_DIR}/lib/libzlib.lib
Cflags: -I${NXDK_DIR}/lib/zlib/zlib -DZ_SOLO
Loading