Skip to content

Commit

Permalink
mingw-w64-codeblocks-git: Add package
Browse files Browse the repository at this point in the history
  • Loading branch information
stahta01 committed Nov 19, 2024
1 parent 216395b commit 17be6e6
Showing 1 changed file with 105 additions and 0 deletions.
105 changes: 105 additions & 0 deletions mingw-w64-codeblocks-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Contributor: Mehdi Chinoune <[email protected]>
# Contributor: Tim Stahlhut <[email protected]>

_wx_basever=3.2

_realname=codeblocks
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-git")
_basever=20.03
pkgver=20.03.r13586
pkgrel=1
_sourcedir=${_realname}-git
pkgdesc="Cross-platform C/C++ IDE (mingw-w64)"
arch=('any')
mingw_arch=('ucrt64' 'clang64' 'clangarm64' 'mingw64' 'mingw32')
url='https://www.codeblocks.org/'
msys2_repository_url="https://sourceforge.net/p/codeblocks/code/HEAD/tree/trunk/"
msys2_references=(
'archlinux: codeblocks'
)
license=('spdx:GPL-3.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-drmingw"
"${MINGW_PACKAGE_PREFIX}-hunspell"
"${MINGW_PACKAGE_PREFIX}-tinyxml"
"${MINGW_PACKAGE_PREFIX}-wxwidgets${_wx_basever}-msw-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-wxwidgets${_wx_basever}-msw"
"${MINGW_PACKAGE_PREFIX}-wxwidgets${_wx_basever}-msw-cb_headers"
"${MINGW_PACKAGE_PREFIX}-boost"
'zip'
'git')
optdepends=("${MINGW_PACKAGE_PREFIX}-clang-tools-extra: needed by Clangd_Client plugin"
"${MINGW_PACKAGE_PREFIX}-cppcheck: needed by cppcheck plugin")
source=(${_sourcedir}::"git+https://github.com/arnholm/codeblocks_sfmirror.git")
sha256sums=('SKIP')

apply_patch_with_msg() {
for _patch in "$@"
do
if patch --dry-run -Rbp1 -i "${srcdir}/${_patch}" > /dev/null 2>&1 ; then
msg2 "Skipping ${_patch} because it likely was already applied"
else
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
fi
done
}

pkgver() {
cd "${_sourcedir}"
_revision=$(git log --graph | grep 'git-svn-id' | head -n 1 | grep -o -e "@\([0-9]*\)" | tr -d '@ ')
printf ${_basever}.r${_revision}
}

prepare() {
cd "${_sourcedir}"

./bootstrap
}

build() {
[[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}"
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"

export lt_cv_deplibs_check_method='pass_all'

CXXFLAGS+=" -Wno-ignored-attributes" \
../${_sourcedir}/configure \
--prefix="${MINGW_PREFIX}" \
--disable-pch \
--with-contrib-plugins=all,-Valgrind

make

cd "${srcdir}/${_sourcedir}/src/tools/cbp2make"
make -f cbp2make.cbp.mak.unix clean
make -f cbp2make.cbp.mak.unix debug
}

check() {
cd "${srcdir}/build-${MSYSTEM}"

make check
}

package() {
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-cbp2make")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}" "${MINGW_PACKAGE_PREFIX}-cbp2make")

cd "${srcdir}/build-${MSYSTEM}"

make install DESTDIR="${pkgdir}"

[[ -f "${pkgdir}${MINGW_PREFIX}/lib/codeblocks/bin/libwxchartctrl-0.dll" ]] && mv "${pkgdir}"${MINGW_PREFIX}/lib/codeblocks/bin/*.dll "${pkgdir}"${MINGW_PREFIX}/bin

install -Dm644 "${srcdir}"/${_sourcedir}/COPYING \
"${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE

cd "${srcdir}/${_sourcedir}/src/tools/cbp2make"
mkdir -p "${pkgdir}${MINGW_PREFIX}/bin/"
cp bin/Debug/cbp2make.exe "${pkgdir}${MINGW_PREFIX}/bin/"
install -Dm644 "${srcdir}/${_sourcedir}/src/tools/cbp2make/COPYING" "${pkgdir}${MINGW_PREFIX}/share/licenses/cbp2make/LICENSE"
}

0 comments on commit 17be6e6

Please sign in to comment.