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

It tries to find minizip when it should find minizip-ng #126

Open
playgithub opened this issue Feb 15, 2024 · 2 comments
Open

It tries to find minizip when it should find minizip-ng #126

playgithub opened this issue Feb 15, 2024 · 2 comments

Comments

@playgithub
Copy link

On arch linux, there no cmake file for the lib minizip to be found by find_package.

So minizip-ng is used instead, PKGBUILD as below installs xlsxio successfully

PKGBUILD

pkgname=xlsxio
pkgver="0.2"
pkgrel=1
pkgdesc="C library for reading and writing .xlsx files"
arch=('x86_64')
provides=('xlsxio')
url=https://github.com/brechtsanders/xlsxio
license=('MIT')
depends=('expat' 'minizip-ng')
makedepends=('cmake>=3.20' 'git' 'openssl')
source=("$pkgname-$pkgver"::"git+ssh://github.com/brechtsanders/xlsxio.git")
sha256sums=('SKIP')
install_prefix=/usr/local

build() {
    cd "$pkgname-$pkgver"

    cmake -S . \
          -B out \
          -DCMAKE_BUILD_TYPE=Release \
          -DBUILD_EXAMPLES=OFF \
          -DBUILD_STATIC=OFF \
          -DBUILD_TOOLS=OFF \
          -DWITH_MINIZIP_NG=ON \
          -DMINIZIP_NG_SUFFIX="-ng"

    cmake --build out -j 12
}

package() {
	cd "$pkgname-$pkgver"
    DESTDIR="$pkgdir/" cmake --install out --prefix="$install_prefix"
}

But when tries to use the lib in cmake, it fails:

find_package(xlsxio REQUIRED CONFIG)

error msg:

[cmake] CMake Error at /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:76 (find_package):
[cmake]   Could not find a package configuration file provided by "minizip" with any
[cmake]   of the following names:
[cmake] 
[cmake]     minizipConfig.cmake
[cmake]     minizip-config.cmake

Dig a little, /usr/local/cmake/xlsxio-config.cmake still finds minizip instead of minizip-ng:

INCLUDE(CMakeFindDependencyMacro)
IF (OFF)
  FIND_DEPENDENCY(LibZip)
ELSE()
  FIND_DEPENDENCY(minizip CONFIG)
ENDIF()
IF ()
  FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/include ${EXPAT_DIR})
  FIND_LIBRARY(EXPAT_LIBRARIES NAMES expat libexpat NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
ELSE()
  FIND_DEPENDENCY(EXPAT)
ENDIF()

IF(OFF)
  IF()
    FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw libexpatw NO_DEFAULT_PATH PATHS ${EXPAT_DIR}/lib ${EXPAT_DIR})
  ELSE()
    FIND_LIBRARY(EXPATW_LIBRARIES NAMES expatw)
  ENDIF()
ENDIF()

INCLUDE("${CMAKE_CURRENT_LIST_DIR}/xlsxioTargets.cmake")
@brechtsanders
Copy link
Owner

Did you try to build against minizip-ng 4.0.4 from https://github.com/zlib-ng/minizip-ng/releases ?

@playgithub
Copy link
Author

playgithub commented Feb 17, 2024

Did you try to build against minizip-ng 4.0.4 from https://github.com/zlib-ng/minizip-ng/releases ?

No, the version is already 4.0.4 in archlinux official repo.

$ pacman -Ss minizip-ng
extra/minizip-ng 4.0.4-1
    Fork of the popular zip manipulation library found in the zlib distribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants