Saturday, March 30, 2019

Re: OpenBSD: problem with installing XFCE

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/vte3/Makefile,v
retrieving revision 1.93
diff -u -p -r1.93 Makefile
--- Makefile 6 Jan 2019 12:15:50 -0000 1.93
+++ Makefile 31 Mar 2019 03:01:49 -0000
@@ -5,6 +5,7 @@ COMMENT= terminal emulation library
GNOME_PROJECT= vte
GNOME_VERSION= 0.54.3
API_V= 2.91
+REVISION= 0

PKGNAME= vte3-${GNOME_VERSION}

@@ -43,7 +44,8 @@ LIB_DEPENDS= devel/pcre2>=10.22p0 \

MODGNOME_TOOLS= gobject-introspection vala

-CONFIGURE_STYLE= gnu
+CONFIGURE_STYLE= autoconf
+AUTOCONF_VERSION= 2.69

# error: -Bsymbolic-functions requested but not supported by ld
CONFIGURE_ARGS += --disable-Bsymbolic
Index: patches/patch-m4_ax_cxx_compile_stdcxx_m4
===================================================================
RCS file: patches/patch-m4_ax_cxx_compile_stdcxx_m4
diff -N patches/patch-m4_ax_cxx_compile_stdcxx_m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-m4_ax_cxx_compile_stdcxx_m4 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by using -std=gnu++1y without checking
+for C++14. Prevents #error "This is not a C++14 compiler"
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: m4/ax_cxx_compile_stdcxx.m4
+--- m4/ax_cxx_compile_stdcxx.m4.orig
++++ m4/ax_cxx_compile_stdcxx.m4
+@@ -73,6 +73,15 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+ if test x$ac_success = xno; then
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ switch="-std=gnu++${alternative}"
++ if test "x${switch}" = x-std=gnu++1y; then
++ # Pretend that OpenBSD ports-gcc 4.9 can use -std=gnu++1y
++ CXX="$CXX $switch"
++ if test -n "$CXXCPP" ; then
++ CXXCPP="$CXXCPP $switch"
++ fi
++ ac_success=yes
++ break
++ fi
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
Index: patches/patch-src_chunk_hh
===================================================================
RCS file: patches/patch-src_chunk_hh
diff -N patches/patch-src_chunk_hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_chunk_hh 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by removing 'constexpr' where it causes
+errors.
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/chunk.hh
+--- src/chunk.hh.orig
++++ src/chunk.hh
+@@ -63,8 +63,8 @@ class Chunk { (public)
+ len = 0;
+ }
+
+- inline constexpr size_t capacity() const noexcept { return sizeof(data); }
+- inline constexpr size_t remaining_capacity() const noexcept { return capacity() - len; }
++ inline size_t capacity() const noexcept { return sizeof(data); }
++ inline size_t remaining_capacity() const noexcept { return capacity() - len; }
+
+ static unique_type get() noexcept;
+ static void prune(unsigned int max_size = k_max_free_chunks) noexcept;
Index: patches/patch-src_modes_hh
===================================================================
RCS file: patches/patch-src_modes_hh
diff -N patches/patch-src_modes_hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_modes_hh 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,71 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by removing 'constexpr' where it causes
+errors.
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/modes.hh
+--- src/modes.hh.orig
++++ src/modes.hh
+@@ -31,13 +31,13 @@ namespace modes {
+ set(e##name, value); \
+ } \
+ \
+- inline constexpr bool name() const noexcept \
++ inline bool name() const noexcept \
+ { \
+ return get(e##name); \
+ }
+
+ #define MODE_FIXED_ACCESSOR(name,value) \
+- inline constexpr bool name() const noexcept \
++ inline bool name() const noexcept \
+ { \
+ return (value); \
+ }
+@@ -61,7 +61,7 @@ static constexpr inline bool vte_modes_get_bool(T mode
+ }
+
+ template <typename T>
+-static constexpr inline bool vte_modes_unset_bool(T* modes,
++static inline bool vte_modes_unset_bool(T* modes,
+ unsigned int shift)
+ {
+ bool set = vte_modes_get_bool<T>(*modes, shift);
+@@ -76,7 +76,7 @@ class Base (public)
+ using Self = Base<T>;
+ using Storage = T;
+
+- constexpr Base(std::initializer_list<int> modes)
++ Base(std::initializer_list<int> modes)
+ {
+ for (auto i : modes)
+ m_default_modes |= VTE_MODES_MASK(i);
+@@ -170,7 +170,7 @@ class ECMA : public Base<uint8_t> (public)
+ #undef MODE
+ #undef MODE_FIXED
+
+- constexpr ECMA() : Self{eSRM} { }
++ ECMA() : Self{eSRM} { }
+
+ }; // class ECMA
+
+@@ -224,7 +224,7 @@ class Private : public Base<uint32_t> (public)
+ #undef MODE
+ #undef MODE_FIXED
+
+- constexpr Private() : Self{eDEC_AUTOWRAP,
++ Private() : Self{eDEC_AUTOWRAP,
+ eDEC_TEXT_CURSOR,
+ eXTERM_ALTBUF_SCROLL,
+ eXTERM_META_SENDS_ESCAPE} { }
+@@ -234,7 +234,7 @@ class Private : public Base<uint32_t> (public)
+ vte_modes_set_bool<Storage>(&m_saved_modes, mode, get(mode));
+ }
+
+- constexpr inline bool pop_saved(int mode)
++ inline bool pop_saved(int mode)
+ {
+ return vte_modes_unset_bool<Storage>(&m_saved_modes, mode);
+ }
Index: patches/patch-src_parser-arg_hh
===================================================================
RCS file: patches/patch-src_parser-arg_hh
diff -N patches/patch-src_parser-arg_hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_parser-arg_hh 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by removing 'constexpr' where it causes
+errors.
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/parser-arg.hh
+--- src/parser-arg.hh.orig
++++ src/parser-arg.hh
+@@ -63,7 +63,7 @@ typedef int vte_seq_arg_t;
+ *
+ * Returns: a #vte_seq_arg_t for @value, or with default value if @value is -1
+ */
+-static constexpr inline vte_seq_arg_t vte_seq_arg_init(int value)
++static inline vte_seq_arg_t vte_seq_arg_init(int value)
+ {
+ if (value == -1)
+ return VTE_SEQ_ARG_INIT_DEFAULT;
Index: patches/patch-src_parser-glue_hh
===================================================================
RCS file: patches/patch-src_parser-glue_hh
diff -N patches/patch-src_parser-glue_hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_parser-glue_hh 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,55 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by removing 'constexpr' where it causes
+errors.
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/parser-glue.hh
+--- src/parser-glue.hh.orig
++++ src/parser-glue.hh
+@@ -264,7 +264,7 @@ class Sequence { (public)
+ * is out of bounds. The returned value is clamped to the
+ * range @min_v..@max_v.
+ */
+- inline constexpr int param(unsigned int idx,
++ inline int param(unsigned int idx,
+ int default_v,
+ int min_v,
+ int max_v) const noexcept
+@@ -299,7 +299,7 @@ class Sequence { (public)
+ *
+ * Returns: the index of the next parameter block
+ */
+- inline constexpr unsigned int next(unsigned int idx) const noexcept
++ inline unsigned int next(unsigned int idx) const noexcept
+ {
+ /* Find the final parameter */
+ while (param_nonfinal(idx))
+@@ -325,7 +325,7 @@ class Sequence { (public)
+ * Returns: %true if the sequence parameter list begins with
+ * a run of final parameters that were collected.
+ */
+- inline constexpr bool collect(unsigned int start_idx,
++ inline bool collect(unsigned int start_idx,
+ std::initializer_list<int*> params,
+ int default_v = -1) const noexcept
+ {
+@@ -364,7 +364,7 @@ class Sequence { (public)
+ * Returns: the parameter value clamped to the @min_v .. @max_v range,
+ * or @default_v if the parameter has default value or is not a final parameter
+ */
+- inline constexpr int collect1(unsigned int idx,
++ inline int collect1(unsigned int idx,
+ int default_v,
+ int min_v,
+ int max_v) const noexcept
+@@ -380,7 +380,7 @@ class Sequence { (public)
+ * Returns: %true if the sequence parameter list contains enough
+ * subparams at @start_idx
+ */
+- inline constexpr bool collect_subparams(unsigned int start_idx,
++ inline bool collect_subparams(unsigned int start_idx,
+ std::initializer_list<int*> params,
+ int default_v = -1) const noexcept
+ {
Index: patches/patch-src_parser-string_hh
===================================================================
RCS file: patches/patch-src_parser-string_hh
diff -N patches/patch-src_parser-string_hh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_parser-string_hh 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by removing 'constexpr' where it causes
+errors.
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/parser-string.hh
+--- src/parser-string.hh.orig
++++ src/parser-string.hh
+@@ -129,7 +129,7 @@ static inline void vte_seq_string_reset(vte_seq_string
+ *
+ * Returns: the string's buffer as an array of uint32_t code units
+ */
+-static constexpr inline uint32_t* vte_seq_string_get(vte_seq_string_t const* str,
++static inline uint32_t* vte_seq_string_get(vte_seq_string_t const* str,
+ size_t* len) noexcept
+ {
+ assert(len != nullptr);
Index: patches/patch-src_ring_cc
===================================================================
RCS file: patches/patch-src_ring_cc
diff -N patches/patch-src_ring_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_ring_cc 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9 by using a constructor call instead of
+an initializer list to avoid an error:
+ring.cc:67:38: error: cannot convert 'const VteCellAttr' to
+'uint32_t {aka unsigned int}' in initialization
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/ring.cc
+--- src/ring.cc.orig
++++ src/ring.cc
+@@ -64,7 +64,7 @@ Ring::Ring(row_t max_rows,
+ bool has_streams)
+ : m_max{MAX(max_rows, 3)},
+ m_has_streams{has_streams},
+- m_last_attr{basic_cell.attr}
++ m_last_attr(basic_cell.attr)
+ {
+ _vte_debug_print(VTE_DEBUG_RING, "New ring %p.\n", this);
+
Index: patches/patch-src_vterowdata_cc
===================================================================
RCS file: patches/patch-src_vterowdata_cc
diff -N patches/patch-src_vterowdata_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_vterowdata_cc 31 Mar 2019 03:01:49 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+
+Allow build with ports-gcc 4.9. Prevents errors like,
+'is_trivially_copy_constructible' is not a member of 'std'
+
+XXX don't need this after moving to ports-gcc>=8
+
+Index: src/vterowdata.cc
+--- src/vterowdata.cc.orig
++++ src/vterowdata.cc
+@@ -30,11 +30,13 @@
+ /* This will be true now that VteCell is POD, but make sure it'll be true
+ * once that changes.
+ */
++#if 0
+ static_assert(std::is_trivially_copy_constructible<VteCell>::value, "VteCell is not copy constructible");
+ static_assert(std::is_trivially_move_constructible<VteCell>::value, "VteCell is not move constructible");
+ static_assert(std::is_trivially_copyable<VteCell>::value, "VteCell is not trivially copyable");
+ static_assert(std::is_trivially_copy_assignable<VteCell>::value, "VteCell is not copy assignable");
+ static_assert(std::is_trivially_move_assignable<VteCell>::value, "VteCell is not move assignable");
++#endif
+
+ /*
+ * VteCells: A row's cell array
Cc maintainers of devel/vte3. I attach a diff that allows amd64 to
build and package vte3 with COMPILER=ports-gcc.

On Thu, 28 Mar 2019 08:08:12 +0100
Landry Breuil <landry@openbsd.org> wrote:

> vte3 (a dependency of xfce4-terminal) is broken on macppc since a whilei (cf
> http://build-failures.rhaalovely.net/powerpc/2019-02-04/devel/vte3.log)
> and nobody was bothered enough to look. Will probably be the same in
> 6.5.

vte3-0.54.3 in OpenBSD-current requires a C++14 compiler. macppc
doesn't have base-clang and uses ports-gcc 4.9, but 4.9 is too old
and fails the C++14 check.

My macppc machine (a PowerBook G4) is using ports-gcc 8.3 instead of
the default 4.9. This machine built vte3 with gcc 8.3 and now has a
working xfce4-terminal; but gcc 8.3 conflicts with gcc 4.9, and
snapshot packages need 4.9, so you can't build vte3 with 8.3 while
you are using snapshot packages. (I would like OpenBSD to move the
default to ports-gcc>=8, but gcc 8 breaks some packages.)

I now attach a diff to build vte3 with 4.9. This diff is for
OpenBSD-current, not for OpenBSD 6.4. This diff disables the C++14
check and changes some C++ code to prevent errors from gcc. I have
only built this patch in my amd64 vm (using COMPILER=ports-gcc to
switch away from the default base-clang), and I didn't try to run it,
because this vm has packages built with base-clang, and programs tend
to crash when they use libc++ from base-clang and libestdc++ from
ports-gcc at the same time.

--
George Koehler <kernigh@gmail.com>

No comments:

Post a Comment