From d2d7efeb12584f301cc9cc068bfd55eccf093432 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 28 Sep 2018 19:41:03 +0200 Subject: [PATCH] unix: use pkg-config in sconscript file, add shell.nix for nix-shell --- SConscript.unix | 5 +++-- shell.nix | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 shell.nix diff --git a/SConscript.unix b/SConscript.unix index e3d548f7b..fe345c3ba 100644 --- a/SConscript.unix +++ b/SConscript.unix @@ -100,8 +100,6 @@ SOURCE_MOD += [ ] if ARGUMENTS.get('TREZOR_EMULATOR_NOUI', 0): CPPDEFINES_MOD += ['TREZOR_EMULATOR_NOUI'] -else: - LIBS_MOD += ['SDL2', 'SDL2_image'] # modtrezorutils SOURCE_MOD += [ @@ -273,6 +271,9 @@ env.Replace( ] + CPPDEFINES_MOD, ASPPFLAGS='$CFLAGS $CCFLAGS', ) +if not ARGUMENTS.get('TREZOR_EMULATOR_NOUI', 0): + env.ParseConfig('pkg-config --cflags --libs sdl2 SDL2_image') + env.Replace( PYTHON='python', MAKEQSTRDATA='$PYTHON vendor/micropython/py/makeqstrdata.py', diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..15fb521df --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +with import {}; + +let + myPython = python36.withPackages(p: [p.trezor]); +in + stdenv.mkDerivation { + name = "trezor-core-dev"; + buildInputs = [ myPython protobuf scons gnumake gcc pkgconfig SDL2 SDL2_image ]; + }