forked from feelfreelinux/cspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
37 lines (33 loc) · 1019 Bytes
/
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
{ nixpkgs ? import <nixpkgs> { }, lib ? import <nixpkgs/lib> }:
let pkgs = with nixpkgs; [ cmake portaudio protobuf go openssl avahi-compat ];
in nixpkgs.stdenv.mkDerivation {
name = "cspotcli";
src = lib.cleanSourceWith {
filter = lib.cleanSourceFilter;
src = lib.cleanSourceWith {
filter = name: type:
let baseName = baseNameOf (toString name);
in !(
# Filter out version control software files/directories
baseName == ".github" || baseName == ".vscode" || baseName == "docker"
|| baseName == "README.md" || baseName == ".editorconfig"
|| lib.strings.hasInfix "targets/cli/build" name
);
src = ./.;
};
};
buildInputs = pkgs;
configurePhase = ''
ls -lah
mkdir -p targets/cli/build
cd targets/cli/build
cmake ..
'';
buildPhase = ''
make -j`nproc` # build with multiple threads, so that all CPU cores are working
'';
installPhase = ''
mkdir -p $out/bin
mv cspotcli $out/bin
'';
}