From 8c402fe7ce55b794f258c60be8a53a673f0a74cd Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 22 Jun 2024 10:34:50 +0100 Subject: [PATCH 1/5] meson.build: fix warning --- meson.build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 1475aa7..d6d81d5 100644 --- a/meson.build +++ b/meson.build @@ -3,10 +3,8 @@ # subdirectories here, and trying to avoid putting any concerns about what the. # host machine is in the subdirectories. -project('MAR1D', 'c') - # make sure we're nice and clean -add_project_arguments('-Werror', language: 'c') +project('MAR1D', 'c', default_options: 'werror=true') # this project makes extensive use of char subscripts, and i'm proud of it. add_project_arguments( '-Wno-char-subscripts', language: 'c') From baf3269e90eca69f154a43c4c1ef14677a6300fd Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 22 Jun 2024 10:34:50 +0100 Subject: [PATCH 2/5] treewide: fix OpenGL dependency handling --- meson.build | 8 +++++++- src/graphics.h | 6 +++++- src/menu.h | 6 +++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index d6d81d5..3a570b9 100644 --- a/meson.build +++ b/meson.build @@ -20,7 +20,13 @@ cc = meson.get_compiler('c') # find dependencies (depending on host) math_lib = cc.find_library('m', required : false) opengl_dep = is_windows ? cc.find_library('opengl32', required : true) : dependency('opengl', static : static_deps) -glu_dep = is_windows ? cc.find_library('glu32', required : true) : dependency('glu', static : static_deps) +if is_windows + glu_dep = cc.find_library('glu32', required : true) +elif is_darwin + glu_dep = opengl_dep +else + glu_dep = dependency('glu', static : static_deps) +endif sdl2_dep = dependency('sdl2', static : static_deps) sdl2_mixer_dep = dependency('SDL2_mixer', static : static_deps) libconfig_dep = dependency('libconfig', static : static_deps) diff --git a/src/graphics.h b/src/graphics.h index c454bf0..0296fc5 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -1,7 +1,11 @@ #ifndef _GRAPHICS_H #define _GRAPHICS_H #include -#include +#ifdef __APPLE__ + #include +#else + #include +#endif #include #include "helpers.h" #include "objects.h" diff --git a/src/menu.h b/src/menu.h index 6a74228..59ded47 100644 --- a/src/menu.h +++ b/src/menu.h @@ -2,7 +2,11 @@ #define _MENU_H #include -#include +#if __APPLE__ + #include +#else + #include +#endif #include #include "helpers.h" #include "graphics.h" From f4f7e0f5584a4a229a1de3d342521da3041ae996 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 22 Jun 2024 10:59:21 +0100 Subject: [PATCH 3/5] nix: fix import paths --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index c9cdfab..0c7fc96 100644 --- a/flake.nix +++ b/flake.nix @@ -24,9 +24,9 @@ defaultPackage = packages.game; packages = { game = import ./nix { inherit nixpkgs system; }; - darwin-app = import ./darwin-app.nix { inherit nixpkgs system; }; - windows = import ./windows.nix { inherit nixpkgs system; }; - flatpak = import ./flatpak.nix { inherit nixpkgs system; }; + darwin-app = import ./nix/darwin-app.nix { inherit nixpkgs system; }; + windows = import ./nix/windows.nix { inherit nixpkgs system; }; + flatpak = import ./nix/flatpak.nix { inherit nixpkgs system; }; appimage = nix-bundle.bundlers.appimage { inherit system; target = (oldGlibcPkgs.callPackage ./package.nix { }).overrideAttrs (old: { From 08d931234242e71b612693b50b572b3f623c6942 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 22 Jun 2024 10:59:21 +0100 Subject: [PATCH 4/5] nix: update package expression --- nix/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nix/package.nix b/nix/package.nix index 2289825..145d021 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -31,6 +31,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "First person Super Mario Bros"; + mainProgram = "MAR1D"; longDescription = '' The original Super Mario Bros as you've never seen it. Step into Mario's shoes in this first person clone of the classic Mario game. True to the @@ -38,7 +39,7 @@ stdenv.mkDerivation rec { You must view the world as mario does, as a one dimensional line. ''; homepage = "https://mar1d.com"; - license = licenses.agpl3; + license = licenses.agpl3Only; maintainers = with maintainers; [ taeer ]; platforms = platforms.unix; }; From d9d57e139d954b18ab694c6cc798e74961050c1e Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 22 Jun 2024 10:59:21 +0100 Subject: [PATCH 5/5] nix: update flake.lock --- flake.lock | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index df11d80..7e06612 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1614513358, - "narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "5466c5bbece17adaab2d82fae80b46e807611bf3", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -21,11 +24,11 @@ "nixpkgs-appimagekit": "nixpkgs-appimagekit" }, "locked": { - "lastModified": 1619188375, - "narHash": "sha256-oQW+9bxdQcdartan+0pe1+bBnxDqzugLEtuP6KA2sBQ=", + "lastModified": 1627593882, + "narHash": "sha256-3KfL6nGZlXL8vdHWS3NOzswR3Ji56osRMUrQw12/XiE=", "owner": "radvendii", "repo": "nix-bundle", - "rev": "e743fb2ed8b85abd1a6d2aff7cafa9b27d613077", + "rev": "5e1e68dab10013871481d922038c6be57da92dc7", "type": "github" }, "original": { @@ -66,11 +69,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1619788849, - "narHash": "sha256-0t5lEUEmY9Tss1PvET6Wq7VyRCdlDHCQ9NWZmxtAaY8=", + "lastModified": 1719049198, + "narHash": "sha256-LcT3+nCqPXs0wwiF8Ue9s1tjKl+qT7MwrCHFIpb5JZQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "dc68eb58bb8d4dc3cfb8896932e6146c45579932", + "rev": "f399afc5ef2305bba871adc253a3549f4eb603c1", "type": "github" }, "original": { @@ -85,6 +88,21 @@ "nix-bundle": "nix-bundle", "nixpkgs": "nixpkgs_2" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root",