msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.27k stars 1.22k forks source link

Error with /usr/bin/makepkg: line 434 #22037

Closed 3rav closed 4 weeks ago

3rav commented 4 weeks ago

I have strange error with makepkg file with scotch build by cmake:

[520/520] Linking C executable src\check\test_scotch_dgraph_redist.exe
==> Starting package_mingw-w64-x86_64-scotch()...
/usr/bin/makepkg: line 434: package_mingw-w64-x86_64-scotch: command not found
==> ERROR: A failure occurred in package_mingw-w64-x86_64-scotch().
    Aborting...

adaptation from archlinux: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=scotch

Biswa96 commented 4 weeks ago

Please provide your PKGBUILD file.

3rav commented 4 weeks ago
# Contributor: Oleg A. Khlybov <fougas@mail.ru>

_realname=scotch
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
         "${MINGW_PACKAGE_PREFIX}-${_realname}-int64")
pkgdesc='Graph partitioning and sparse matrix ordering package (mingw-w64)'
pkgver=7.0.5
pkgrel=1
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
         "${MINGW_PACKAGE_PREFIX}-libsystre"
         "${MINGW_PACKAGE_PREFIX}-msmpi")
makedepends=("bison"
             "flex"
             "${MINGW_PACKAGE_PREFIX}-cc")
options=('!strip' 'staticlibs')
license=('spdx:CECILL-C')
url="https://www.labri.fr/perso/pelegrin/scotch/"
source=("https://gitlab.inria.fr/scotch/scotch/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.gz"
        "Makefile.idx32.inc"
        "Makefile.idx64.inc"
        "0002-pipe-fix.patch"
        "0004-dummysizes-regex.patch")
sha256sums=('385507a9712bb9057497b9ac3f24ad2132bd3f3f8c7a62e78324fc58f2a0079b'
            '4221b69dcc53230ff4d6bc18e3982f6d39971a99fc17f4dab609fc19b99d8a30'
            'c52bf0598332d8139a37606e7ea9376b7f841059047c0c977b205a763fc7e97a'
            'b6e76b1d2f35b3fcc771b97a35a468d6314ee3a619defef18b82fc7654638a49'
            '15dd82d4c7b118e08316df4242d647bdaa1f180ff143ee33fe84633c97aac111')

prepare() {
  sed -i 's/DESTINATION man/DESTINATION share\/man/g' ${_realname}-v${pkgver}/CMakeLists.txt
  cd "${srcdir}/${_realname}-v${pkgver}"
  for p in ${source[*]:3}; do
    patch -p1 -i "$srcdir/$p"
  done
}

build() {
  mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"

  declare -a extra_config
  if check_option "debug" "n"; then
    extra_config+=("-DCMAKE_BUILD_TYPE=Release")
  else
    extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
  fi

  MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
    ${MINGW_PREFIX}/bin/cmake \
      -GNinja \
      -DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
      -DCMAKE_CXX_STANDARD_LIBRARIES="-lz -lgnurx -lscotcherr" \
      "${extra_config[@]}" \
      -DBUILD_SHARED_LIBS=OFF \
      -DINSTALL_METIS_HEADERS=ON \
      -DBUILD_PTSCOTCH=ON \
      -DBUILD_LIBESMUMPS=ON \
      -DBUILD_LIBSCOTCHMETIS=OFF \
      ../${_realname}-v${pkgver}

  ${MINGW_PREFIX}/bin/cmake --build .

}

#check() {
#  cd "${srcdir}/build-${MSYSTEM}"
#  make -C build test
#}

package() {
  cd "${srcdir}"/build-${MSYSTEM}
  #DESTDIR=${pkgdir} cmake --build . --target install
  #install -Dm644 "${srcdir}"/${_realname}-v${pkgver}/doc/CeCILL-C_V1-en.txt "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
  DESTDIR=${pkgdir} cmake --install build
}
Biswa96 commented 4 weeks ago

You have to add package function for each package. In this case, the package function name should be package_scotch() and package_scotch-int64(). Do not mix underscore with hyphen. Then add the contents of mingw-w64-splitpkg-wrappers-1.0.template file at last. See any other PKGBUILD file where split packages are done, e.g. pango.

The technique is documented here https://man.archlinux.org/man/PKGBUILD.5#PACKAGE_SPLITTING

3rav commented 4 weeks ago

Is it possible to unify the names now, like openblas?: openblas and openblas64

scotch and scotch-int64 -> scotch and scotch64

Biswa96 commented 4 weeks ago

Is it possible to unify the names now, like openblas?

Yeah, sure. Just check if the package function is correct accordingly. Otherwise, makepkg will be sad :)