8 stdenv.mkDerivation rec {
12 src = fetchFromGitHub {
16 hash = "sha256-Cl4+WvjKbq5IPqf7ivVYwBYwDDWWHGNeq4nWXPxsUHw=";
17 fetchSubmodules = true;
20 nativeBuildInputs = [ gcc cmake ];
25 substituteInPlace tools/816-opt/Makefile \
26 --replace-fail 'LDFLAGS := -lpthread' 'LDFLAGS :=' \
27 --replace-fail 'LDFLAGS := -pthread' 'LDFLAGS += -pthread' \
28 --replace-fail 'LDFLAGS += -lpthread -static' '# LDFLAGS += -lpthread -static'
30 substituteInPlace tools/bin2txt/Makefile \
31 tools/gfx2snes/Makefile \
32 tools/gfx4snes/Makefile \
33 tools/snestools/Makefile \
34 tools/816-opt/Makefile \
35 tools/tmx2snes/Makefile \
36 --replace-fail '$(CFLAGS) $(OBJS)' '$(LDFLAGS) $(OBJS)'
38 substituteInPlace tools/smconv/Makefile \
39 --replace-fail '$(CFLAGS) $(LDFLAGS)' '$(LDFLAGS)'
41 substituteInPlace tools/constify/Makefile \
42 --replace-fail '$(CFLAGS) $(DEFINES) $(OBJS)' '$(LDFLAGS) $(DEFINES) $(OBJS)'
44 substituteInPlace tools/snestools/Makefile \
45 --replace-fail '-Wno-format' ' '
47 substituteInPlace tools/snesbrr/brr/Makefile \
48 --replace-fail 'LDFLAGS ' 'LDFLAGS :=
51 substituteInPlace compiler/wla-dx/wlalink/write.c \
52 --replace-fail 'sort_anonymous_labels()' 'sort_anonymous_labels(void)'
56 export PVSNESLIB_HOME=$(pwd)
66 description = "Free and open source development kit for the Nintendo SNES";
67 homepage = "https://github.com/alekmaul/pvsneslib";
68 changelog = "https://github.com/alekmaul/pvsneslib/releases/tag/${src.rev}";
69 license = lib.licenses.mit;
70 maintainers = with lib.maintainers; [ soyouzpanda ];
71 mainProgram = "pvsneslib";
72 platforms = lib.platforms.all;