Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] trouble compiling gsimplecal on gentoo musl
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 555
Location: Ásgarðr

PostPosted: Sat Jan 28, 2023 4:10 am    Post subject: [SOLVED] trouble compiling gsimplecal on gentoo musl Reply with quote

Hi,
I'm trying to build gsimplecal 2.4.1 (not in tree, so added an ebuild to my localrepo) on gentoo musl (with glibc, it compiles fine) but it fails with this error :

Code:
MainWindow.cpp:166:33: error: invalid cast from type 'std::nullptr_t' to type 'GtkAccelFlags'


system is x86-64, musl version 1.2.3, gcc 12.2.1
I reported the bug on the project page but maybe some guru here could help to make a patch (if possible) 8)
Thanks!

Full build log :

Code:
./configure --prefix=/usr --build=x86_64-gentoo-linux-musl --host=x86_64-gentoo-linux-musl --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --disable-silent-rules --docdir=/usr/share/doc/gsimplecal-2.4.1 --htmldir=/usr/share/doc/gsimplecal-2.4.1/html --libdir=/usr/lib
checking for a BSD-compatible install... /usr/lib/portage/python3.10/ebuild-helpers/xattr/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for x86_64-gentoo-linux-musl-g++... x86_64-gentoo-linux-musl-g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether x86_64-gentoo-linux-musl-g++ accepts -g... yes
checking for x86_64-gentoo-linux-musl-g++ option to enable C++11 features... none needed
checking whether make supports the include directive... yes (GNU style)
checking dependency style of x86_64-gentoo-linux-musl-g++... none
checking for x86_64-gentoo-linux-musl-pkg-config... /usr/bin/x86_64-gentoo-linux-musl-pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GTK... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for iostream... yes
checking for string... yes
checking for sstream... yes
checking for fstream... yes
checking for vector... yes
checking for cstdlib... yes
checking for stdlib.h... (cached) yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for sys/ipc.h... yes
checking for sys/sem.h... yes
checking for sys/sysctl.h... no
checking for signal.h... yes
checking for limits.h... yes
checking for atexit... yes
checking for execl... yes
checking for fork... yes
checking for ftok... yes
checking for getexecname... no
checking for gettimeofday... yes
checking for kill... yes
checking for readlink... yes
checking for semctl... yes
checking for semget... yes
checking for setenv... yes
checking for signal... yes
checking for strlcpy... yes
checking for sysctl... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating src/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
>>> Source configured.
>>> Compiling source in /var/tmp/portage/x11-misc/gsimplecal-2.4.1/work/gsimplecal-2.4.1 ...
make -j5
Making all in src
make[1]: Entering directory '/var/tmp/portage/x11-misc/gsimplecal-2.4.1/work/gsimplecal-2.4.1/src'
make  all-am
make[2]: Entering directory '/var/tmp/portage/x11-misc/gsimplecal-2.4.1/work/gsimplecal-2.4.1/src'
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o Boxable.o Boxable.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o Calendar.o Calendar.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o Clock.o Clock.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o Config.o Config.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o gsimplecal.o gsimplecal.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o MainWindow.o MainWindow.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o Timezones.o Timezones.cpp
x86_64-gentoo-linux-musl-g++ -DHAVE_CONFIG_H -I.  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -pthread    -march=core2 -O2 -pipe -c -o Unique.o Unique.cpp
MainWindow.cpp: In constructor 'MainWindow::MainWindow()':
MainWindow.cpp:166:33: error: invalid cast from type 'std::nullptr_t' to type 'GtkAccelFlags'
  166 |                                 (GtkAccelFlags)NULL, closure);
      |                                 ^
make[2]: *** [Makefile:414: MainWindow.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/var/tmp/portage/x11-misc/gsimplecal-2.4.1/work/gsimplecal-2.4.1/src'
make[1]: *** [Makefile:293: all] Error 2
make[1]: Leaving directory '/var/tmp/portage/x11-misc/gsimplecal-2.4.1/work/gsimplecal-2.4.1/src'
make: *** [Makefile:340: all-recursive] Error 1


And the ebuild if you want to try to help,
gsimplecal-2.4.1.ebuild

Code:
# Copyright 1999-2022 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit autotools eutils

DESCRIPTION="Lightweight calendar applet"
HOMEPAGE="https://dmedvinsky.github.io/gsimplecal/"
SRC_URI="https://github.com/dmedvinsky/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

COMMON_DEPEND="x11-libs/gtk+:3"
DEPEND="
  virtual/pkgconfig
  ${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}"

src_prepare() {
  default
  eautoreconf
}


Last edited by sdauth on Sat Jan 28, 2023 8:09 am; edited 1 time in total
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1670

PostPosted: Sat Jan 28, 2023 6:16 am    Post subject: Reply with quote

This broke with a change introduced in musl 1.2.3. Try changing NULL there to 0.
Back to top
View user's profile Send private message
sdauth
Guru
Guru


Joined: 19 Sep 2018
Posts: 555
Location: Ásgarðr

PostPosted: Sat Jan 28, 2023 7:47 am    Post subject: Reply with quote

Neat, now it compiles fine, without error, thanks sam_ !
Code:
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 02eca42..323d5db 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -163,7 +163,7 @@ MainWindow::MainWindow()
         closure = g_cclosure_new(G_CALLBACK(keys[key].func), (gpointer)this, NULL);
         gtk_accel_group_connect(accelerators, keys[key].key,
                                 (GdkModifierType)keys[key].modifier,
-                                (GtkAccelFlags)NULL, closure);
+                                (GtkAccelFlags)0, closure);
         g_closure_unref(closure);
     }
Back to top
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1670

PostPosted: Sat Jan 28, 2023 7:52 am    Post subject: Reply with quote

Excellent! Send that patch upstream if you can.

Happy musling :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum