Skip to content

Instantly share code, notes, and snippets.

@mingwandroid
Last active December 27, 2015 18:37
Show Gist options
  • Save mingwandroid/ddeca4ffe5cb7a215461 to your computer and use it in GitHub Desktop.
Save mingwandroid/ddeca4ffe5cb7a215461 to your computer and use it in GitHub Desktop.
MSYS2 MINGW-packages patch to enable lldb for mingw-w64-clang-svn PKGBUILD (untested!)
diff --git a/mingw-w64-clang-svn/PKGBUILD b/mingw-w64-clang-svn/PKGBUILD
index e216054..bdadd55 100644
--- a/mingw-w64-clang-svn/PKGBUILD
+++ b/mingw-w64-clang-svn/PKGBUILD
@@ -20,9 +20,10 @@ pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}-svn"
"${MINGW_PACKAGE_PREFIX}-libc++-svn"
"${MINGW_PACKAGE_PREFIX}-lld-svn"
"${MINGW_PACKAGE_PREFIX}-llvm-svn"
+ "${MINGW_PACKAGE_PREFIX}-lldb-svn"
)
-pkgver=60424.b883875
-pkgrel=2
+pkgver=60430.db7c3ac
+pkgrel=1
pkgdesc="C language family frontend for LLVM (mingw-w64)"
arch=('any')
url="http://llvm.org"
@@ -34,7 +35,7 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"python2"
"git")
depends=("${MINGW_PACKAGE_PREFIX}-gcc")
-options=('staticlibs') # 'debug' '!strip')
+options=('debug' '!strip')
source=("llvm"::"git+http://llvm.org/git/llvm.git"
"lld"::"git+http://llvm.org/git/lld.git"
"clang"::"git+http://llvm.org/git/clang.git"
@@ -43,6 +44,7 @@ source=("llvm"::"git+http://llvm.org/git/llvm.git"
"testsuite"::"git+http://llvm.org/git/test-suite.git"
"libcxxabi"::"git+http://llvm.org/git/libcxxabi.git"
"libcxx"::"git+http://llvm.org/git/libcxx.git"
+ "lldb"::"git+http://llvm.org/git/lldb.git"
0001-Fix-GetHostTriple-for-mingw-w64-in-msys.patch
0002-use-DESTDIR-on-windows.patch
0003-generate-proper-library-names-mingw.patch
@@ -56,6 +58,7 @@ source=("llvm"::"git+http://llvm.org/git/llvm.git"
#0021-0029 -> rt
#0031-0039 -> lld
#0041-0049 -> c++
+#0051-0059 -> lldb
md5sums=('SKIP'
'SKIP'
@@ -65,6 +68,7 @@ md5sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
+ 'SKIP'
'a384d4607d9dcdfdcac6912ac413ec58'
'4d696d298d70db32338659ce2cfa505f'
'9b56e0d949c72be49aa059fd626923e2'
@@ -119,7 +123,7 @@ prepare() {
mv "${srcdir}/clang" tools/clang
mv "${srcdir}/clang-tools-extra" tools/clang/tools/extra
mv "${srcdir}/lld" tools/lld
-# mv "${srcdir}/lldb" tools/lldb
+ mv "${srcdir}/lldb" tools/lldb
mv "${srcdir}/compiler-rt" projects/compiler-rt
mv "${srcdir}/libcxxabi" projects/libcxxabi
mv "${srcdir}/libcxx" projects/libcxx
@@ -137,6 +141,7 @@ build() {
if check_option "debug" "y"; then
extra_config+=(-DCMAKE_BUILD_TYPE=Debug)
+ VERBOSE="VERBOSE=1"
else
extra_config+=(-DCMAKE_BUILD_TYPE=Release)
fi
@@ -173,16 +178,14 @@ build() {
"${extra_config[@]}" \
../llvm
- make
+ make ${VERBOSE}
# Disable automatic installation of components that go into subpackages
- cp tools/cmake_install.cmake tools/cmake_install.cmake.orig
- cp tools/clang/tools/cmake_install.cmake tools/clang/tools/cmake_install.cmake.orig
- cp projects/cmake_install.cmake projects/cmake_install.cmake.orig
-
- sed -i '/\(clang\|lld\|lldb\)\/cmake_install.cmake/d' tools/cmake_install.cmake
- sed -i '/\(extra\|scan-build\|scan-view\)\/cmake_install.cmake/d' tools/clang/tools/cmake_install.cmake
- sed -i '/\(compiler-rt\|libcxxabi\|libcxx\)\/cmake_install.cmake/d' projects/cmake_install.cmake
+ # -i.orig to check what has been removed in-case it starts dropping more than it should
+ #
+ sed -i.orig '/\(clang\|lld\|lldb\)\/cmake_install.cmake/d' tools/cmake_install.cmake
+ sed -i.orig '/\(extra\|scan-build\|scan-view\)\/cmake_install.cmake/d' tools/clang/tools/cmake_install.cmake
+ sed -i.orig '/\(compiler-rt\|libcxxabi\|libcxx\)\/cmake_install.cmake/d' projects/cmake_install.cmake
}
#check() {
@@ -191,57 +194,6 @@ build() {
# make check || true
#}
-package_clang-svn() {
- pkgdesc="C language family frontend for LLVM (mingw-w64)"
- url="http://clang.llvm.org/"
- depends=("${MINGW_PACKAGE_PREFIX}-llvm-svn")
- provides=("${MINGW_PACKAGE_PREFIX}-clang")
- conflicts=("${MINGW_PACKAGE_PREFIX}-clang")
- pkgver=$(pkgver_internal "${srcdir}"/llvm/tools/clang)
-
- cd "${srcdir}/llvm"
- make -C ../build-${CARCH}/tools/clang DESTDIR="${pkgdir}" install
-
- # Install static clang library ..
- cp ../build-${CARCH}/lib/libclang.a ${pkgdir}${MINGW_PREFIX}/lib/
-}
-
-package_clang-analyzer-svn() {
- pkgdesc="A source code analysis framework (mingw-w64)"
- url="http://clang-analyzer.llvm.org/"
- depends=("${MINGW_PACKAGE_PREFIX}-clang-svn" "python2")
- provides=("${MINGW_PACKAGE_PREFIX}-clang-analyzer")
- conflicts=("${MINGW_PACKAGE_PREFIX}-clang-analyzer")
- pkgver=$(pkgver_internal "${srcdir}"/llvm/tools/clang)
-
- cd "${srcdir}"/llvm
- make -C ../build-${CARCH}/tools/clang/tools/scan-build -j1 DESTDIR="${pkgdir}" install
- make -C ../build-${CARCH}/tools/clang/tools/scan-view -j1 DESTDIR="${pkgdir}" install
-
- # Use Python 2
- sed -i \
- -e 's|env python$|&2|' \
- -e 's|/usr/bin/python$|&2|' \
- "${pkgdir}"${MINGW_PREFIX}/bin/scan-view
-
- # Compile Python scripts
- python2 -m compileall "${pkgdir}"${MINGW_PREFIX}/bin/clang-analyzer
- python2 -O -m compileall "${pkgdir}"${MINGW_PREFIX}/lib/clang-analyzer
- install -Dm644 LICENSE.TXT "${pkgdir}"${MINGW_PREFIX}/share/licenses/clang-analyzer/LICENSE
-}
-
-package_clang-tools-extra-svn() {
- pkgdesc="Extra tools built using Clang's tooling APIs (mingw-w64)"
- url="http://clang.llvm.org/"
- depends=("${MINGW_PACKAGE_PREFIX}-clang-svn")
- provides=("${MINGW_PACKAGE_PREFIX}-clang-tools-extra")
- conflicts=("${MINGW_PACKAGE_PREFIX}-clang-tools-extra")
- pkgver=$(pkgver_internal "${srcdir}"/llvm/tools/clang/tools/extra)
-
- cd "${srcdir}"/llvm
- make -C ../build-${CARCH}/tools/clang/tools/extra -j1 DESTDIR="${pkgdir}" install
-}
-
package_llvm-svn() {
pkgdesc="Low Level Virtual Machine (mingw-w64)"
#depends=("${MINGW_PACKAGE_PREFIX}-gcc") # "compiler-rt"
@@ -282,7 +234,7 @@ package_libcxxabi-svn() {
conflicts=("${MINGW_PACKAGE_PREFIX}-libc++abi")
pkgver=$(pkgver_internal "${srcdir}"/llvm/projects/libcxxabi)
- cd "${srcdir}/llvm"
+ cd "${srcdir}/llvm"
make -C ../build-${CARCH}/projects/libcxxabi -j1 DESTDIR="${pkgdir}" install
}
@@ -325,6 +277,57 @@ package_lld-svn() {
make -C ../build-${CARCH}/tools/lld -j1 DESTDIR="${pkgdir}" install
}
+package_clang-svn() {
+ pkgdesc="C language family frontend for LLVM (mingw-w64)"
+ url="http://clang.llvm.org/"
+ depends=("${MINGW_PACKAGE_PREFIX}-llvm-svn")
+ provides=("${MINGW_PACKAGE_PREFIX}-clang")
+ conflicts=("${MINGW_PACKAGE_PREFIX}-clang")
+ pkgver=$(pkgver_internal "${srcdir}"/llvm/tools/clang)
+
+ cd "${srcdir}/llvm"
+ make -C ../build-${CARCH}/tools/clang DESTDIR="${pkgdir}" install
+
+ # Install static clang library ..
+ cp ../build-${CARCH}/lib/libclang.a ${pkgdir}${MINGW_PREFIX}/lib/
+}
+
+package_clang-analyzer-svn() {
+ pkgdesc="A source code analysis framework (mingw-w64)"
+ url="http://clang-analyzer.llvm.org/"
+ depends=("${MINGW_PACKAGE_PREFIX}-clang-svn" "python2")
+ provides=("${MINGW_PACKAGE_PREFIX}-clang-analyzer")
+ conflicts=("${MINGW_PACKAGE_PREFIX}-clang-analyzer")
+ pkgver=$(pkgver_internal "${srcdir}"/llvm/tools/clang)
+
+ cd "${srcdir}"/llvm
+ make -C ../build-${CARCH}/tools/clang/tools/scan-build -j1 DESTDIR="${pkgdir}" install
+ make -C ../build-${CARCH}/tools/clang/tools/scan-view -j1 DESTDIR="${pkgdir}" install
+
+ # Use Python 2
+ sed -i \
+ -e 's|env python$|&2|' \
+ -e 's|/usr/bin/python$|&2|' \
+ "${pkgdir}"${MINGW_PREFIX}/bin/scan-view
+
+ # Compile Python scripts
+ python2 -m compileall "${pkgdir}"${MINGW_PREFIX}/bin/clang-analyzer
+ python2 -O -m compileall "${pkgdir}"${MINGW_PREFIX}/lib/clang-analyzer
+ install -Dm644 LICENSE.TXT "${pkgdir}"${MINGW_PREFIX}/share/licenses/clang-analyzer/LICENSE
+}
+
+package_clang-tools-extra-svn() {
+ pkgdesc="Extra tools built using Clang's tooling APIs (mingw-w64)"
+ url="http://clang.llvm.org/"
+ depends=("${MINGW_PACKAGE_PREFIX}-clang-svn")
+ provides=("${MINGW_PACKAGE_PREFIX}-clang-tools-extra")
+ conflicts=("${MINGW_PACKAGE_PREFIX}-clang-tools-extra")
+ pkgver=$(pkgver_internal "${srcdir}"/llvm/tools/clang/tools/extra)
+
+ cd "${srcdir}"/llvm
+ make -C ../build-${CARCH}/tools/clang/tools/extra -j1 DESTDIR="${pkgdir}" install
+}
+
# Wrappers
package_mingw-w64-i686-clang-svn(){
package_clang-svn
@@ -354,6 +357,10 @@ package_mingw-w64-i686-lld-svn(){
package_lld-svn
}
+package_mingw-w64-i686-lldb-svn(){
+ package_lldb-svn
+}
+
package_mingw-w64-i686-llvm-svn(){
package_llvm-svn
}
@@ -386,6 +393,10 @@ package_mingw-w64-x86_64-lld-svn(){
package_lld-svn
}
+package_mingw-w64-x86_64-lldb-svn(){
+ package_lldb-svn
+}
+
package_mingw-w64-x86_64-llvm-svn(){
package_llvm-svn
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment