-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
57 lines (56 loc) · 1.71 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
48
49
50
51
52
53
54
55
56
57
# _Packaging_ instructions for libejovo
#
# This file encodes the build/installation instructions scattered throughout the
# README.md into a single nix expression.
#
#
# We start off my making a simple derivation
{pkgs ? import <nixpkgs> {}}: let
stdenv = pkgs.stdenv;
in
stdenv.mkDerivation {
name = "libejovo";
src = ./.;
buildInputs = [pkgs.cmake pkgs.ffmpeg pkgs.pcg_c pkgs.pkg-config];
# Manual override of different phases:
#
# Note:
# There is a "configurePhase" that get's called by a genericBuild which -
# at a bare minimum - calls `cmake` to configure the project.
#
# Additional note:
#
# The "stdenv.mkDerivation" default phases are much more robust and
# properly set the cmakeflags to use and include files and what not.
# The below instructions don't actually work that well (buildPhase works if we don't touch configurePhase though...)
#
# #
# configurePhase = ''
# echo "Configuring some stuff I guess.."
# echo "Running in: $(pwd)"
# mkdir build
# cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=Relase -B build/ -DCMAKE_INSTALL_PREFIX=$out
# env
# '';
# #
# buildPhase = ''
# echo "Wait a minute what da fuck???"
# echo "Current directory: $(pwd)"
# cd build
# cmake --build . -j $NIX_BUILD_CORES
# echo "HUH?? =============="
# '';
#
# installPhase = ''
# # cmake --install ./
# # pwd
# # cd ../
# # mkdir -p $out
# # echo "hello" > "$out/file.txt"
# # pwd >> $out/file.txt
# mkdir -p $out
# ls > $out/files_in_build.txt
# # cmake --install .
# # cp -r $out/
# '';
}