-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19948 from qmfrederik/libobjc2
libobjc2: New package
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libobjc2-*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Maintainer: Frederik Carlier <[email protected]> | ||
|
||
_realname=libobjc2 | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") | ||
pkgver=2.2 | ||
pkgrel=1 | ||
pkgdesc="Objective-C runtime library intended for use with Clang. (mingw-w64)" | ||
arch=('any') | ||
mingw_arch=('mingw64' 'ucrt64') | ||
url="https://github.com/gnustep/libobjc2" | ||
license=('spdx:MIT') | ||
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake" | ||
"${MINGW_PACKAGE_PREFIX}-clang" | ||
"${MINGW_PACKAGE_PREFIX}-lld" | ||
'git') | ||
source=("https://github.com/gnustep/${_realname}/archive/refs/tags/v${pkgver}.zip" | ||
# Install runtime files in CMAKE_INSTALL_BINDIR when GNUstep is not installed | ||
"https://github.com/gnustep/libobjc2/commit/639c676bb8033422539e19a2e2888bdbd06507e5.patch") | ||
sha256sums=('3f72ea4955e3e4671d64c64c339f4947b6112b1b2dd02377c5c982057bbeda04' | ||
'aaa23146b3c2ec442b5dbf20606020bddd15230041ad738ef3a06e92d13605c3') | ||
|
||
prepare() { | ||
cd ${srcdir}/${_realname}-${pkgver} | ||
|
||
patch -p1 -i ${srcdir}/639c676bb8033422539e19a2e2888bdbd06507e5.patch | ||
} | ||
|
||
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 | ||
|
||
export LDFLAGS="-fuse-ld=lld -lstdc++ -lgcc_s" | ||
|
||
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \ | ||
"${MINGW_PREFIX}"/bin/cmake.exe \ | ||
-GNinja \ | ||
-DCMAKE_INSTALL_PREFIX="${MINGW_PREFIX}" \ | ||
-DCMAKE_C_COMPILER="clang" \ | ||
-DCMAKE_CXX_COMPILER="clang++" \ | ||
-DTESTS=ON \ | ||
"${extra_config[@]}" \ | ||
../${_realname}-${pkgver} | ||
|
||
"${MINGW_PREFIX}"/bin/cmake.exe --build . | ||
} | ||
|
||
check() { | ||
cd "${srcdir}/build-${MSYSTEM}" | ||
|
||
"${MINGW_PREFIX}"/bin/cmake.exe --build . --target test | ||
} | ||
|
||
package() { | ||
cd "${srcdir}/build-${MSYSTEM}" | ||
|
||
DESTDIR="${pkgdir}" "${MINGW_PREFIX}"/bin/cmake.exe --install . | ||
|
||
mv ${pkgdir}${MINGW_PREFIX}/lib/objc.lib ${pkgdir}${MINGW_PREFIX}/lib/objc.dll.a | ||
install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYING" | ||
} |