Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Netris 2 eval ci test #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions pkgs/by-name/ne/netris/configure-fixes-for-gcc-14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
From 9f82b88e17f5e04929eff96c673dac5810006c87 Mon Sep 17 00:00:00 2001
From: Reno Dakota <[email protected]>
Date: Thu, 5 Dec 2024 09:49:40 +0000
Subject: [PATCH] configure fixes for gcc-14

---
Configure | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Configure b/Configure
index fbc57a8..e8cea16 100755
--- a/Configure
+++ b/Configure
@@ -76,7 +76,7 @@ done
CFLAGS="$COPT $CEXTRA"

echo "Checking for libraries"
-echo 'main(){}' > test.c
+echo 'int main(void){ return 0; }' > test.c
LFLAGS=""
for lib in -lcurses -lncurses; do
if $CC $CFLAGS $LEXTRA test.c $lib > /dev/null 2>&1; then
@@ -91,8 +91,9 @@ done

echo "Checking for on_exit()"
cat << END > test.c
+#include <stdlib.h>
void handler(void) {}
-main() { on_exit(handler, (void *)0); }
+int main(void) { on_exit(handler, (void *)0); return 0; }
END
if $CC $CFLAGS $LEXTRA test.c > /dev/null 2>&1; then
HAS_ON_EXIT=true
@@ -103,7 +104,7 @@ fi
echo "Checking for sigprocmask()"
cat << END > test.c
#include <signal.h>
-main() { sigset_t set; sigprocmask(SIG_BLOCK, &set, &set); }
+int main(void) { sigset_t set; sigprocmask(SIG_BLOCK, &set, &set); return 0; }
END
if $CC $CFLAGS $LEXTRA test.c > /dev/null 2>&1; then
HAS_SIGPROCMASK=true
@@ -114,7 +115,7 @@ fi
echo "Checking for getopt.h"
cat << END > test.c
#include <getopt.h>
-main(){}
+int main(void){ return 0; }
END

if $CC $CFLAGS $LEXTRA test.c > /dev/null 2>&1; then
@@ -126,7 +127,7 @@ fi
echo "Checking for memory.h"
cat << END > test.c
#include <memory.h>
-main(){}
+int main(void){ return 0; }
END

if $CC $CFLAGS $LEXTRA test.c > /dev/null 2>&1; then
--
2.47.0

12 changes: 11 additions & 1 deletion pkgs/by-name/ne/netris/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,23 @@ stdenv.mkDerivation {
sha256 = "0gmxbpn50pnffidwjchkzph9rh2jm4wfq7hj8msp5vhdq5h0z9hm";
};

patches = [
# https://github.com/naclander/netris/pull/1
./configure-fixes-for-gcc-14.patch
];

buildInputs = [
ncurses
];

configureScript = "./Configure";
dontAddPrefix = true;

configureFlags = [
"--cc" "${stdenv.cc.targetPrefix}cc"
"-O2"
];

installPhase = ''
mkdir -p $out/bin
cp ./netris $out/bin
Expand All @@ -28,6 +38,6 @@ stdenv.mkDerivation {
mainProgram = "netris";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ patryk27 ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
Loading