简体   繁体   中英

MSYS2/MinGW64-makepkg installs the package in the wrong directories . Wrong PKGBUILD?

I create a PKGBUILD file to build 'bgfx' library and to create MSYS2/MinGW-64 package. The build goes well, the package is created too, but the package is installed in the wrong directories. I expect to be installed in c:/msys64/mingw64, but it is done in c:/msys64, *.exe files are installed in c:/msys64/bin.What should be done to install to c:/msys64/mingw64?

My PKGBUILD file:

# Maintainer: https://github.com/cppfever/bgfx-pkgbuild.git
_realname=bgfx
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.115.7933
pkgrel=1
pkgdesc="Cross-platform rendering library"
url=https://github.com/bkaradzic/bgfx.cmake.git
license=(BSD-2-Clause License)
arch=('any')
mingw_arch=('mingw64')
groups=()
depends=()
makedepends=("git" "${MINGW_PACKAGE_PREFIX}-cmake" "${MINGW_PACKAGE_PREFIX}-ninja")
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("${_realname}::git+https://github.com/bkaradzic/bgfx.cmake.git#tag=v1.115.7933-417f8b8")
noextract=()
md5sums=('SKIP')
validpgpkeys=()

prepare()
{
    cd ${srcdir}/${_realname}
    git submodule update --init --recursive
}

build() {
    cmake -S ${_realname} -B build -DCMAKE_BUILD_TYPE='Release' -G"Ninja"
    cmake --build build
}

package() {
    cmake --install ${srcdir}/build --prefix=${pkgdir} --strip
}

My environment variables:

# printenv
ProgramFiles(x86)=C:\Program Files (x86)
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=4
PROCESSOR_LEVEL=6
TERM_PROGRAM_VERSION=3.5.0
MINGW_PREFIX=/mingw64
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
USERDOMAIN_ROAMINGPROFILE=mans
HOSTNAME=mans
PROGRAMFILES=C:\Program Files
MSYSTEM=MINGW64
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/c/Users/man/AppData/Local/Temp
MINGW_CHOST=x86_64-w64-mingw32
OS=Windows_NT
HOMEDRIVE=C:
MSYSTEM_CARCH=x86_64
windows_tracing_flags=3
USERDOMAIN=mans
VS100COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\
PWD=/d/doc/cpp/bgfx/pkgbuild/bgfx.cmake/Release
USERPROFILE=C:\Users\man
MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
PRINTER=Microsoft XPS Document Writer
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
TZ=Asia/Novosibirsk
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
tmp=C:\Users\man\AppData\Local\Temp
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/
CommonProgramW6432=C:\Program Files\Common Files
HOME=/home/man
USERNAME=man
VBOX_MSI_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
COMSPEC=C:\Windows\system32\cmd.exe
APPDATA=C:\Users\man\AppData\Roaming
SYSTEMROOT=C:\Windows
LOCALAPPDATA=C:\Users\man\AppData\Local
COMPUTERNAME=MANS
INFOPATH=/usr/local/info:/usr/share/info:/usr/info:/share/info
TERM=xterm
LOGONSERVER=\\MANS
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
USER=man
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
FP_NO_HOST_CHECK=NO
MSYS_HOME=C:\msys64\usr
TEMP=/tmp
temp=C:\Users\man\AppData\Local\Temp
MSYSTEM_CHOST=x86_64-w64-mingw32
ORIGINAL_TMP=/c/Users/man/AppData/Local/Temp
SHLVL=1
PROCESSOR_REVISION=4e03
COMMONPROGRAMFILES=C:\Program Files\Common Files
LC_CTYPE=ru_RU.UTF-8
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
SESSIONNAME=Console
PS1=\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n\[\e[1m\]#\[\e[0m\]
MINGW_HOME=C:\msys64\mingw64
HOMEPATH=\Users\man
XDG_DATA_DIRS=/mingw64/share/:/usr/local/share/:/usr/share/
MSYSCON=mintty.exe
TMP=/tmp
VS90COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\
CONFIG_SITE=/etc/config.site
PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
ProgramW6432=C:\Program Files
MSYSTEM_PREFIX=/mingw64
WINDIR=C:\Windows
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:\Users\Public
SYSTEMDRIVE=C:
OLDPWD=/d/doc/cpp/bgfx/pkgbuild
TERM_PROGRAM=mintty
ProgramData=C:\ProgramData
_=/usr/bin/printenv

When you call cmake the first time, add this argument:

-DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM