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

feat(build): add support for building on NixOS #3

Open
wants to merge 1 commit into
base: main
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.DS_Store
*.cache
*.ebf
.direnv
2 changes: 1 addition & 1 deletion scripts/deps.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Check if we are on Debian or Fedora, and call either deps.debian.sh or deps.fedora.sh

Expand Down
14 changes: 14 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
SDL2
SDL2_ttf
SDL2_gfx
SDL2_image
libffi
zlib
python3
];
}
4 changes: 2 additions & 2 deletions src/base/eve/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Compiler and linker options
CC := gcc
CFLAGS := -Wall -Werror -fPIC -MMD $(shell sdl2-config --cflags)
LDFLAGS := -lm -shared $(shell sdl2-config --libs)
CFLAGS := -Wall -Werror -fPIC -MMD $(shell pkg-config --cflags sdl2 SDL2_ttf SDL2_gfx SDL2_image)
LDFLAGS := -lm -shared $(shell pkg-config --libs sdl2 SDL2_ttf SDL2_gfx SDL2_image)
LIBS := -lSDL2 -lSDL2_ttf -lSDL2_image -lSDL2_gfx

# Source files and object files
Expand Down