Skip to content

Commit

Permalink
Nix packaging.
Browse files Browse the repository at this point in the history
  • Loading branch information
vifino committed Nov 3, 2022
1 parent cc8b76f commit 357a44a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ CFLAGS ?= -Os
CPPLAGS += -pedantic -Wall
LDFLAGS += -lm

DESTDIR ?= /usr/local
PREFIX ?= /usr/local
DESTDIR ?= /

BINS=ff-glitch ff-glitch2

Expand All @@ -13,7 +14,8 @@ all: $(BINS)
$(CC) -o $@ $(CPPFLAGS) $(CFLAGS) $< $(LDFLAGS)

install: $(BINS)
install $(BINS) $(DESTDIR)/bin
install -d $(DESTDIR)/$(PREFIX)/bin
install $(BINS) $(DESTDIR)/$(PREFIX)/bin

clean:
rm -f $(BINS)
10 changes: 10 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
src = ./.;
name = "ff-glitch";
enableParallelBuilding = true;

installPhase = ''
make install PREFIX=$out
'';
}

0 comments on commit 357a44a

Please sign in to comment.