pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Lyx Clang support for testing
Hi all,
with the attached patch, Lyx finally builds again with Clang. It also
fixes a bug for !Clang use, so please give it a test.
Joerg
Index: editors/lyx/Makefile
==================================================================
--- editors/lyx/Makefile
+++ editors/lyx/Makefile
@@ -72,11 +72,12 @@
CONFIGURE_ARGS+= --without-included-mythes
CONFIGURE_ARGS+= --with-extra-prefix=${BUILDLINK_PREFIX.qt4-libs} \
--with-qt4-dir=${QTDIR:Q} \
--with-qt4-includes=${BUILDLINK_PREFIX.qt4-libs}/qt4/include \
-
--with-qt4-libraries=${BUILDLINK_PREFIX.qt4-libs}/qt4/lib
+
--with-qt4-libraries=${BUILDLINK_PREFIX.qt4-libs}/qt4/lib \
+ --without-included-boost
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Darwin"
GNU_CONFIGURE_PREFIX= ${PREFIX}/Applications/LyX.app
@@ -88,10 +89,16 @@
PLIST_SUBST+= BIN_DIR=bin \
LYX=lyx \
MAN_DIR="${PKGMANDIR}" \
SHARE_DIR=share/lyx
.endif
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+CXXFLAGS+= -std=c++11
+ALL_ENV+= CXXFLAGS_TEXT_CPP=-O0
+.endif
REPLACE_PYTHON= development/cmake/doc/ReplaceValues.py \
development/cmake/po/cat.py \
development/tools/convert_kmap.py \
development/tools/gen_lfuns.py \
@@ -143,9 +150,9 @@
.include "../../lang/python/application.mk"
.include "../../textproc/aspell/buildlink3.mk"
.include "../../x11/qt4-libs/buildlink3.mk"
.include "../../x11/qt4-tools/buildlink3.mk"
.include "../../textproc/mythes/buildlink3.mk"
-.include "../../devel/boost-headers/buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
Index: editors/lyx/distinfo
==================================================================
--- editors/lyx/distinfo
+++ editors/lyx/distinfo
@@ -4,11 +4,21 @@
RMD160 (lyx-2.0.7.tar.xz) = 01b8989b68f10f37b5eb799fc01ba0a4f739b9f6
Size (lyx-2.0.7.tar.xz) = 10449908 bytes
SHA1 (patch-boost_boost_detail_container__fwd.hpp) =
ff95034c4e2c03c894b3aa4b9222b34b8495fba7
SHA1 (patch-boost_libs_signals_src_named__slot__map.cpp) =
3d73f93911eb2a9b51b0be34e3a26e85ec5b54f4
SHA1 (patch-development_MacOSX_Makefile.in) =
ae9e51e3458f8986ae392b146f8684305b7fe25b
+SHA1 (patch-src_ParagraphMetrics.cpp) =
3f36f5bc39be043b98b009f9e8c85faae89d4610
SHA1 (patch-src_WordList.cpp) = d747efcd6ca4d7015a5c6860a8844ac79a65672a
+SHA1 (patch-src_frontends_qt4_GuiFontMetrics.cpp) =
492d419eab0c544b2a1ad62d42886c71bd63a333
+SHA1 (patch-src_insets_InsetGraphics.cpp) =
5f17caca5fe4405295171128b0d3832176a0c9f1
+SHA1 (patch-src_insets_InsetListings.cpp) =
ebe0726e7f0a0629f1591cb01cd3365972120f44
SHA1 (patch-src_mathed_InsetMath.h) = c178b1436c7a969e29b328dde1a800e9ccb7af0e
SHA1 (patch-src_mathed_MathData.h) = fcd51f36aa2aae29f75e041d7adb1d88baa370a5
+SHA1 (patch-src_mathed_MathExtern.cpp) =
1d4d04e3a8d0963d54d3bde0ac04988691e36454
+SHA1 (patch-src_support_Messages.cpp) =
77ab5c7cb56a83e42436026439c817bdad2a8554
+SHA1 (patch-src_support_bind.h) = 0011c42d3548d188c80e17badda228a25616f9a0
SHA1 (patch-src_support_debug.h) = 749ab17184fe2fc059384785c426afe444c0b2a7
+SHA1 (patch-src_support_functional.h) =
03131388ffada1b28381eded6653619f794c8a26
+SHA1 (patch-src_support_shared__ptr.h) =
b286e11e77b5be244591a4ee52fa802f10862386
SHA1 (patch-src_support_strfwd.h) = 4ef82f8703fd68f8b953447f05ab1fd71958c379
SHA1 (patch-src_support_unicode.cpp) = 71bdc1b929a3c90bed84d6de5aa0734e548c67de
+SHA1 (patch-src_tex2lyx_Makefile.in) = 8c1bebcd33007b1265173aa13d474dbd9fd18568
ADDED editors/lyx/patches/patch-src_ParagraphMetrics.cpp
Index: editors/lyx/patches/patch-src_ParagraphMetrics.cpp
==================================================================
--- editors/lyx/patches/patch-src_ParagraphMetrics.cpp
+++ editors/lyx/patches/patch-src_ParagraphMetrics.cpp
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/ParagraphMetrics.cpp.orig 2014-02-11 15:11:44.000000000 +0000
++++ src/ParagraphMetrics.cpp
+@@ -94,14 +94,14 @@ size_t ParagraphMetrics::computeRowSigna
+ crc.process_bytes(b, sizeof(char_type));
+ if (bparams.trackChanges) {
+ Change change = par_->lookupChange(i);
+- char_type const b[] = { change.type };
++ char_type const b[] = {
static_cast<char_type>(change.type) };
+ // 1 byte is enough to encode Change::Type
+ crc.process_bytes(b, 1);
+ }
+ }
+
+ Dimension const & d = row.dimension();
+- char_type const b[] = { row.sel_beg, row.sel_end,
++ char_type const b[] = { static_cast<char_type>(row.sel_beg),
static_cast<char_type>(row.sel_end),
+ row.begin_margin_sel, row.end_margin_sel, d.wid, d.asc, d.des};
+ // Each of the variable to process is 4 bytes: 4x7 = 28
+ crc.process_bytes(b, 28);
ADDED editors/lyx/patches/patch-src_frontends_qt4_GuiFontMetrics.cpp
Index: editors/lyx/patches/patch-src_frontends_qt4_GuiFontMetrics.cpp
==================================================================
--- editors/lyx/patches/patch-src_frontends_qt4_GuiFontMetrics.cpp
+++ editors/lyx/patches/patch-src_frontends_qt4_GuiFontMetrics.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/frontends/qt4/GuiFontMetrics.cpp.orig 2014-02-11 15:08:29.000000000
+0000
++++ src/frontends/qt4/GuiFontMetrics.cpp
+@@ -219,7 +219,7 @@ GuiFontMetrics::AscendDescend const GuiF
+ else
+ r = metrics_.boundingRect(toqstr(docstring(1, c)));
+
+- AscendDescend ad = { -r.top(), r.bottom() + 1};
++ AscendDescend ad = { static_cast<short>(-r.top()),
static_cast<short>(r.bottom() + 1)};
+ // We could as well compute the width but this is not really
+ // needed for now as it is done directly in width() below.
+ metrics_cache_.insert(c, ad);
ADDED editors/lyx/patches/patch-src_insets_InsetGraphics.cpp
Index: editors/lyx/patches/patch-src_insets_InsetGraphics.cpp
==================================================================
--- editors/lyx/patches/patch-src_insets_InsetGraphics.cpp
+++ editors/lyx/patches/patch-src_insets_InsetGraphics.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/insets/InsetGraphics.cpp.orig 2014-02-11 15:15:20.000000000 +0000
++++ src/insets/InsetGraphics.cpp
+@@ -487,7 +487,7 @@ copyToDirIfNeeded(DocFileName const & fi
+ string const file_in = file.absFileName();
+ string const only_path = onlyPath(file_in);
+ if (rtrim(onlyPath(file_in) , "/") == rtrim(dir, "/"))
+- return make_pair(IDENTICAL_PATHS, file_in);
++ return make_pair(IDENTICAL_PATHS, FileName(file_in));
+
+ string mangled = file.mangledFileName();
+ if (file.isZipped()) {
ADDED editors/lyx/patches/patch-src_insets_InsetListings.cpp
Index: editors/lyx/patches/patch-src_insets_InsetListings.cpp
==================================================================
--- editors/lyx/patches/patch-src_insets_InsetListings.cpp
+++ editors/lyx/patches/patch-src_insets_InsetListings.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/insets/InsetListings.cpp.orig 2014-02-11 15:16:43.000000000 +0000
++++ src/insets/InsetListings.cpp
+@@ -203,7 +203,7 @@ void InsetListings::latex(otexstream & o
+ }
+ if (isInline) {
+ char const * delimiter = lstinline_delimiters;
+- for (; delimiter != '\0'; ++delimiter)
++ for (; delimiter[0] != '\0'; ++delimiter)
+ if (!contains(code, *delimiter))
+ break;
+ // This code piece contains all possible special character? !!!
ADDED editors/lyx/patches/patch-src_mathed_MathExtern.cpp
Index: editors/lyx/patches/patch-src_mathed_MathExtern.cpp
==================================================================
--- editors/lyx/patches/patch-src_mathed_MathExtern.cpp
+++ editors/lyx/patches/patch-src_mathed_MathExtern.cpp
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- src/mathed/MathExtern.cpp.orig 2014-02-11 15:14:01.000000000 +0000
++++ src/mathed/MathExtern.cpp
+@@ -1452,7 +1452,7 @@ bool extractNumber(MathData const & ar,
+ {
+ idocstringstream is(charSequence(ar.begin(), ar.end()));
+ is >> i;
+- return is;
++ return bool(is);
+ }
+
+
+@@ -1460,7 +1460,7 @@ bool extractNumber(MathData const & ar,
+ {
+ idocstringstream is(charSequence(ar.begin(), ar.end()));
+ is >> d;
+- return is;
++ return bool(is);
+ }
+
+
ADDED editors/lyx/patches/patch-src_support_Messages.cpp
Index: editors/lyx/patches/patch-src_support_Messages.cpp
==================================================================
--- editors/lyx/patches/patch-src_support_Messages.cpp
+++ editors/lyx/patches/patch-src_support_Messages.cpp
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- src/support/Messages.cpp.orig 2014-02-11 14:58:26.000000000 +0000
++++ src/support/Messages.cpp
+@@ -122,7 +122,7 @@ bool Messages::available(string const &
+ // this loops at most twice
+ while (true) {
+ string const filen = locale_dir + "/" + code
+- + "/LC_MESSAGES/"PACKAGE".mo";
++ + "/LC_MESSAGES/" PACKAGE ".mo";
+ if (FileName(filen).isReadableFile())
+ return true;
+ if (contains(code, '_'))
ADDED editors/lyx/patches/patch-src_support_bind.h
Index: editors/lyx/patches/patch-src_support_bind.h
==================================================================
--- editors/lyx/patches/patch-src_support_bind.h
+++ editors/lyx/patches/patch-src_support_bind.h
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- src/support/bind.h.orig 2014-02-11 14:43:33.000000000 +0000
++++ src/support/bind.h
+@@ -14,7 +14,17 @@
+
+ #include "support/functional.h"
+
+-#ifdef LYX_USE_TR1
++#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
++
++namespace lyx
++{
++ using std::bind;
++ using std::placeholders::_1;
++ using std::placeholders::_2;
++ using std::ref;
++}
++
++#elif defined(LYX_USE_TR1)
+
+ namespace lyx
+ {
ADDED editors/lyx/patches/patch-src_support_functional.h
Index: editors/lyx/patches/patch-src_support_functional.h
==================================================================
--- editors/lyx/patches/patch-src_support_functional.h
+++ editors/lyx/patches/patch-src_support_functional.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/support/functional.h.orig 2014-02-11 14:40:33.000000000 +0000
++++ src/support/functional.h
+@@ -12,8 +12,15 @@
+ #ifndef LYX_FUNCTIONAL_H
+ #define LYX_FUNCTIONAL_H
+
+-#ifdef LYX_USE_TR1
++#include <cstddef>
++#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
++#include <functional>
+
++namespace lyx
++{
++ using std::function;
++}
++#elif defined(LYX_USE_TR1)
+ #include <functional>
+
+ #ifdef __GNUC__
ADDED editors/lyx/patches/patch-src_support_shared__ptr.h
Index: editors/lyx/patches/patch-src_support_shared__ptr.h
==================================================================
--- editors/lyx/patches/patch-src_support_shared__ptr.h
+++ editors/lyx/patches/patch-src_support_shared__ptr.h
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/support/shared_ptr.h.orig 2014-02-11 14:41:01.000000000 +0000
++++ src/support/shared_ptr.h
+@@ -12,7 +12,15 @@
+ #ifndef LYX_SHARED_PTR_H
+ #define LYX_SHARED_PTR_H
+
+-#ifdef LYX_USE_TR1
++#include <cstddef>
++#if __cplusplus >= 201103L || defined(_LIBCPP_VERSION)
++#include <memory>
++
++namespace lyx
++{
++ using std::shared_ptr;
++}
++#elif defined(LYX_USE_TR1)
+
+ #include <memory>
+
ADDED editors/lyx/patches/patch-src_tex2lyx_Makefile.in
Index: editors/lyx/patches/patch-src_tex2lyx_Makefile.in
==================================================================
--- editors/lyx/patches/patch-src_tex2lyx_Makefile.in
+++ editors/lyx/patches/patch-src_tex2lyx_Makefile.in
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- src/tex2lyx/Makefile.in.orig 2014-02-17 22:49:01.000000000 +0000
++++ src/tex2lyx/Makefile.in
+@@ -206,7 +206,8 @@ CPPFLAGS = @CPPFLAGS@
+ CXX = @CXX@
+ CXXCPP = @CXXCPP@
+ CXXDEPMODE = @CXXDEPMODE@
+-CXXFLAGS = @CXXFLAGS@
++CXXFLAGS.text.o= ${CXXFLAGS_TEXT_CPP}
++CXXFLAGS = @CXXFLAGS@ ${CXXFLAGS.$@}
+ CYGPATH_W = @CYGPATH_W@
+ DATADIRNAME = @DATADIRNAME@
+ DEFS = @DEFS@
Home |
Main Index |
Thread Index |
Old Index