Created
March 23, 2017 23:07
-
-
Save cleverca22/33b1552fcab3bd9a7f29a3e1c3ab4f10 to your computer and use it in GitHub Desktop.
nix lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { clangStdenv, stdenv, protobuf, libressl, lua, libevent, protos }: | |
| let | |
| lib = stdenv.lib; | |
| filter = name: type: let baseName = baseNameOf (toString name); in ( | |
| lib.hasSuffix ".cpp" baseName || | |
| lib.hasSuffix ".cc" baseName || | |
| lib.hasSuffix ".h" baseName || | |
| baseName == "Makefile" | |
| ); | |
| in stdenv.mkDerivation { | |
| preferLocalBuild = true; | |
| name = "test-driver"; | |
| buildInputs = [ protobuf libressl lua libevent protos ]; | |
| src = builtins.filterSource filter ./.; | |
| enableParallelBuilding = true; | |
| dontStrip = true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test-driver: test-driver.o locking.o funcs.o | |
| ${CXX} $^ -o $@ -g -lssl -lprotobuf -llua -levent_pthreads -levent -levent_openssl -lprotos | |
| %.o: %.cpp | |
| ${CXX} -c -Wall -g -std=c++1z $< -o $@ | |
| %.o: %.cc | |
| ${CXX} -c -Wall -g -std=c++1z $< -o $@ | |
| test-driver.o: test-driver.cpp test-driver.h locking.h funcs.h | |
| funcs.o: funcs.cpp funcs.h | |
| install: test-driver | |
| mkdir -p ${out}/bin | |
| cp test-driver ${out}/bin/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment