From d037a21c11318db6beb615fd5334b75b42f5f7e5 Mon Sep 17 00:00:00 2001 From: John Soo Date: Sat, 6 Jul 2019 10:20:22 -0700 Subject: [PATCH 05/11] gnu: Add python-pyside-2-libcxx-headers. * gnu/packages/llvm.scm (python-pyside-2-libcxx-headers): New variable. --- gnu/packages/llvm.scm | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 188d0bb267..3641ad068e 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -702,3 +702,58 @@ using @code{clang-rename}."))) #t))) (license license:ncsa))) +;; See https://bugreports.qt.io/browse/PYSIDE-787 +;; STL headers are not parsed correctly, so only send in some headers +(define-public python-pyside-2-libcxx-headers + (package + (inherit libcxx) + (name "python-pyside-2-libcxx-headers") + (version (package-version llvm-6)) + (source + (origin + (inherit (package-source libcxx)) + (uri (string-append "http://llvm.org/releases/" + version "/libcxx-" version ".src.tar.xz")) + (sha256 + (base32 + "0rzw4qvxp6qx4l4h9amrq02gp7hbg8lw4m0sy3k60f50234gnm3n")))) + (native-inputs + `(("clang" ,clang-6) + ("llvm" ,llvm-6))) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'use-only-required-headers + (lambda* (#:key outputs #:allow-other-keys) + (use-modules ((srfi srfi-1))) + (let ((out (assoc-ref outputs "out")) + (required-headers + '("type_traits" + "__config" + "cstddef" + "__nullptr" + "utility" + "__tuple" + "initializer_list" + "cstring" + "cstdint" + "__debug"))) + (for-each + delete-file + (filter + (lambda (file) + (not + (fold + (lambda (acc header) + (or acc (string-contains file header))) + #f + required-headers))) + (find-files (string-append out "/include/c++/v1")))) + (delete-file-recursively (string-append out "/include/c++/v1/ext")) + (delete-file-recursively (string-append out "/include/c++/v1/support")) + (delete-file-recursively (string-append out "/lib"))) + #t))))) + (synopsis + "Libcxx files specifically used by PySide2") + (description + "Libcxx files specifically used by PySide2."))) -- 2.22.0