Loading pkgs/by-name/op/opensupaplex/darwin.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line diff --git a/src/sdl_common/audio.c b/src/sdl_common/audio.c index 797c678..ebb9eda 100644 --- a/src/sdl_common/audio.c +++ b/src/sdl_common/audio.c @@ -25,11 +25,7 @@ #if HAVE_SDL2 #include <SDL2/SDL.h> -#if TARGET_OS_MAC -#include <SDL2_mixer/SDL_mixer.h> -#else #include <SDL2/SDL_mixer.h> -#endif #elif HAVE_SDL #include <SDL/SDL.h> #include <SDL/SDL_mixer.h> pkgs/by-name/op/opensupaplex/package.nix +14 −1 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ opensupaplex, SDL2, SDL2_mixer, desktopToDarwinBundle, }: let Loading @@ -29,10 +30,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-hP8dJlLXE5J/oxPhRkrrBl1Y5e9MYbJKi8OApFM3+GU="; }; patches = [ ./reproducible-build.patch ./darwin.patch ]; nativeBuildInputs = [ SDL2 # For "sdl2-config" copyDesktopItems ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ SDL2_mixer ]; enableParallelBuilding = true; Loading Loading @@ -82,13 +92,16 @@ stdenv.mkDerivation (finalAttrs: { }) ]; # Strip only the main binary, not the data files which would corrupt them. stripExclude = [ "lib/opensupaplex/*" ]; meta = { description = "Decompilation of Supaplex in C and SDL"; homepage = "https://github.com/sergiou87/open-supaplex"; changelog = "https://github.com/sergiou87/open-supaplex/blob/master/changelog/v${finalAttrs.version}.txt"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ matteopacini ]; platforms = lib.platforms.linux; # Many more are supported upstream, but only linux is tested. platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "opensupaplex"; }; }) pkgs/by-name/op/opensupaplex/reproducible-build.patch 0 → 100644 +17 −0 Original line number Diff line number Diff line diff --git a/linux/Makefile b/linux/Makefile index 6041a89..588341c 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -5,6 +5,12 @@ LDFLAGS += -lSDL2_mixer -lvorbis -logg `sdl2-config --libs` -lm CFLAGS += `sdl2-config --cflags` -DHAVE_SDL2 +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) +# Darwin-specific reproducible build flags +LDFLAGS += -Wl,-no_uuid +endif + opensupaplex: $(obj) $(CC) -o $@ $^ $(LDFLAGS) Loading
pkgs/by-name/op/opensupaplex/darwin.patch 0 → 100644 +16 −0 Original line number Diff line number Diff line diff --git a/src/sdl_common/audio.c b/src/sdl_common/audio.c index 797c678..ebb9eda 100644 --- a/src/sdl_common/audio.c +++ b/src/sdl_common/audio.c @@ -25,11 +25,7 @@ #if HAVE_SDL2 #include <SDL2/SDL.h> -#if TARGET_OS_MAC -#include <SDL2_mixer/SDL_mixer.h> -#else #include <SDL2/SDL_mixer.h> -#endif #elif HAVE_SDL #include <SDL/SDL.h> #include <SDL/SDL_mixer.h>
pkgs/by-name/op/opensupaplex/package.nix +14 −1 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ opensupaplex, SDL2, SDL2_mixer, desktopToDarwinBundle, }: let Loading @@ -29,10 +30,19 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-hP8dJlLXE5J/oxPhRkrrBl1Y5e9MYbJKi8OApFM3+GU="; }; patches = [ ./reproducible-build.patch ./darwin.patch ]; nativeBuildInputs = [ SDL2 # For "sdl2-config" copyDesktopItems ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ]; buildInputs = [ SDL2_mixer ]; enableParallelBuilding = true; Loading Loading @@ -82,13 +92,16 @@ stdenv.mkDerivation (finalAttrs: { }) ]; # Strip only the main binary, not the data files which would corrupt them. stripExclude = [ "lib/opensupaplex/*" ]; meta = { description = "Decompilation of Supaplex in C and SDL"; homepage = "https://github.com/sergiou87/open-supaplex"; changelog = "https://github.com/sergiou87/open-supaplex/blob/master/changelog/v${finalAttrs.version}.txt"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ matteopacini ]; platforms = lib.platforms.linux; # Many more are supported upstream, but only linux is tested. platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "opensupaplex"; }; })
pkgs/by-name/op/opensupaplex/reproducible-build.patch 0 → 100644 +17 −0 Original line number Diff line number Diff line diff --git a/linux/Makefile b/linux/Makefile index 6041a89..588341c 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -5,6 +5,12 @@ LDFLAGS += -lSDL2_mixer -lvorbis -logg `sdl2-config --libs` -lm CFLAGS += `sdl2-config --cflags` -DHAVE_SDL2 +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Darwin) +# Darwin-specific reproducible build flags +LDFLAGS += -Wl,-no_uuid +endif + opensupaplex: $(obj) $(CC) -o $@ $^ $(LDFLAGS)