forked from laamaa/m8c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
47 lines (42 loc) · 1.21 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
# HOWTO keep this package definition up-to-date:
#
# 1. NEW VERSION:
# After the new version is tagged and pushed, update the `version` var to the
# proper value and update the hash. You can use the following command to find
# out the sha256, for example, with version 1.0.3:
# `nix-prefetch-github --rev v1.0.3 laamaa m8c`
#
# 2. NEW DEPENDENCIES:
# Make sure new dependencies are added. Runtime deps go to buildInputs and
# compile-time deps go to nativeBuildInputs. Use the nixpkgs manual for help
#
let m8c-package =
{ stdenv
, gnumake
, pkg-config
, SDL2
, libserialport
, fetchFromGitHub
}:
let
pname = "m8c";
version = "1.5.4";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchFromGitHub {
owner = "laamaa";
repo = pname;
rev = "v${version}";
hash = "sha256:x9d2sr8omNH9cwtgs/fxxAfj812dASOmQVJpmT8B/Pc=";
};
installFlags = [ "PREFIX=$(out)" ];
nativeBuildInputs = [ gnumake pkg-config ];
buildInputs = [ SDL2 libserialport ];
};
in {
m8c-stable = pkgs.callPackage m8c-package {};
m8c-dev = (pkgs.callPackage m8c-package {}).overrideAttrs (oldAttrs: {src = ./.;});
}