Skip to content

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

Open
@playgithub

Description

@playgithub

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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions