From 71e54c6b416facf77bef1aa293c6245e5459bfb8 Mon Sep 17 00:00:00 2001 From: Petr Zahradnik Date: Sun, 8 Jun 2025 17:55:23 +0200 Subject: [PATCH] uae: unbreak --- pkgs/by-name/ua/uae/package.nix | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ua/uae/package.nix b/pkgs/by-name/ua/uae/package.nix index 9ef978a25e7a2..027e9c21f58e6 100644 --- a/pkgs/by-name/ua/uae/package.nix +++ b/pkgs/by-name/ua/uae/package.nix @@ -8,15 +8,20 @@ SDL, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "uae"; version = "0.8.29"; src = fetchurl { - url = "https://web.archive.org/web/20130905032631/http://www.amigaemulator.org/files/sources/develop/uae-${version}.tar.bz2"; + url = "https://web.archive.org/web/20130905032631/http://www.amigaemulator.org/files/sources/develop/uae-${finalAttrs.version}.tar.bz2"; sha256 = "05s3cd1rd5a970s938qf4c2xm3l7f54g5iaqw56v8smk355m4qr4"; }; + # fix configure error: return type defaults to 'int' [-Wimplicit-int] + patchPhase = '' + sed -i 's/^main()/int main()/' ./src/tools/configure + ''; + configureFlags = [ "--with-sdl" "--with-sdl-sound" @@ -32,10 +37,14 @@ stdenv.mkDerivation rec { ]; hardeningDisable = [ "format" ]; - # Workaround build failure on -fno-common toolchains: - # ld: bsdsocket.o:(.bss+0x0): multiple definition of - # `socketbases'; main.o:(.bss+0x2792c0): first defined here - env.NIX_CFLAGS_COMPILE = "-fcommon"; + env.NIX_CFLAGS_COMPILE = toString [ + # Workaround build failure on -fno-common toolchains: + # ld: bsdsocket.o:(.bss+0x0): multiple definition of + # `socketbases'; main.o:(.bss+0x2792c0): first defined here + "-fcommon" + "-Wno-error=implicit-function-declaration" + "-Wno-error=incompatible-pointer-types" + ]; LDFLAGS = [ "-lm" ]; meta = { @@ -46,4 +55,4 @@ stdenv.mkDerivation rec { platforms = lib.platforms.linux; mainProgram = "uae"; }; -} +})