From 8feed1d21531860d8245266e4c6f2338fab407c7 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 14 May 2022 18:15:05 +0100 Subject: [PATCH] gtkpod: add -fcommon workaround Workaround build failure on -fno-common toolchains like upstream gcc-10. Otherwise build fails as: ld: .libs/autodetection.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: multiple definition of `gtkpod_app'; .libs/gtkpod_app_iface.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: first defined here --- pkgs/applications/audio/gtkpod/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/audio/gtkpod/default.nix b/pkgs/applications/audio/gtkpod/default.nix index e741f6fe298..220d2d38e14 100644 --- a/pkgs/applications/audio/gtkpod/default.nix +++ b/pkgs/applications/audio/gtkpod/default.nix @@ -11,6 +11,9 @@ stdenv.mkDerivation rec { url = "mirror://sourceforge/gtkpod/${pname}-${version}.tar.gz"; sha256 = "0xisrpx069f7bjkyc8vqxb4k0480jmx1wscqxr6cpq1qj6pchzd5"; }; + postPatch = '' + sed -i 's/which/type -P/' scripts/*.sh + ''; nativeBuildInputs = [ pkg-config wrapGAppsHook intltool ]; buildInputs = [ @@ -19,15 +22,17 @@ stdenv.mkDerivation rec { gdl gnome.adwaita-icon-theme gnome.anjuta ] ++ (with perlPackages; [ perl XMLParser ]); - patchPhase = '' - sed -i 's/which/type -P/' scripts/*.sh - ''; + # Workaround build failure on -fno-common toolchains like upstream + # gcc-10. Otherwise build fails as: + # ld: .libs/autodetection.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: multiple definition of + # `gtkpod_app'; .libs/gtkpod_app_iface.o:/build/gtkpod-2.1.5/libgtkpod/gtkpod_app_iface.h:248: first defined here + NIX_CFLAGS_COMPILE = "-fcommon"; enableParallelBuilding = true; meta = with lib; { description = "GTK Manager for an Apple ipod"; - homepage = "http://gtkpod.sourceforge.net"; + homepage = "https://sourceforge.net/projects/gtkpod/"; license = licenses.gpl2Plus; platforms = platforms.linux; maintainers = [ maintainers.skeidel ];