Here's a shell.nix
you can use:
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "league-displays-${version}";
version = "master";
src = ./.;
doCheck = true;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ gtk2-x11 clang rapidjson ];
preBuild = ''
substituteAllInPlace src/themes_service.h --replace "include/rapidjson/document.h" "rapidjson/document.h"
substituteInPlace Makefile --replace "pkg-config --libs --cflags gtk+-2.0" "pkg-config --libs --cflags gtk+-2.0 RapidJSON"
'';
}
When you enter the shell, instead of make
run buildPhase
. That way the preBuild
step runs and applies some patches.
Even though I've accounted for all known dependencies, the project still doesn't build due to what appears to be some app-specific errors:
build flags: SHELL=/nix/store/mcyvp1s45scjkkhyb1m16aqlsb8wr6hs-bash-interactive-4.4-p23/bin/bash
clang++ -O3 -g -w -I. -I./src/ -Wl,-rpath,. -L./bin/ -std=c++14 -Wall -lX11 -lXt -lcef -pthread -lrt -lz `pkg-config --libs --cflags gtk+-2.0 RapidJSON` -I./thirdparty/ -c src/background_daemon.cc
src/background_daemon.cc:23:9: error: unknown type name 'AppConfig'
AppConfig* cfg = AppConfig::Acquire();
^
src/background_daemon.cc:23:26: error: use of undeclared identifier 'AppConfig'
AppConfig* cfg = AppConfig::Acquire();
^
src/background_daemon.cc:26:9: error: use of undeclared identifier 'AppConfig'
AppConfig::Release();
^
src/background_daemon.cc:71:9: error: unknown type name 'AppConfig'
AppConfig* cfg;
^
src/background_daemon.cc:76:19: error: use of undeclared identifier 'AppConfig'
cfg = AppConfig::Acquire();
^
src/background_daemon.cc:110:37: error: use of undeclared identifier 'fnvHash'
unsigned int hash = fnvHash(wp.c_str());
^
src/background_daemon.cc:133:13: error: use of undeclared identifier 'AppConfig'
AppConfig::Release();
^
7 errors generated.
make: *** [Makefile:37: background_daemon.o] Error 1