mspdebug: optional runtime dependency on TI libmsp430
This commit is contained in:
parent
ceef1d2f27
commit
5ba76e94ec
@ -1,14 +1,18 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, autoPatchelfHook
|
||||
, libusb-compat-0_1
|
||||
, readline ? null
|
||||
, enableReadline ? true
|
||||
, hidapi ? null
|
||||
, pkg-config ? null
|
||||
, mspds ? null
|
||||
, enableMspds ? false
|
||||
}:
|
||||
|
||||
assert stdenv.isDarwin -> hidapi != null && pkg-config != null;
|
||||
assert enableReadline -> readline != null;
|
||||
assert enableMspds -> mspds != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "0.25";
|
||||
@ -21,7 +25,8 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
enableParallelBuilding = true;
|
||||
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin pkg-config;
|
||||
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin pkg-config
|
||||
++ stdenv.lib.optional (enableMspds && stdenv.isLinux) autoPatchelfHook;
|
||||
buildInputs = [ libusb-compat-0_1 ]
|
||||
++ stdenv.lib.optional stdenv.isDarwin hidapi
|
||||
++ stdenv.lib.optional enableReadline readline;
|
||||
@ -34,6 +39,15 @@ stdenv.mkDerivation rec {
|
||||
substituteInPlace Makefile --replace brew true
|
||||
'';
|
||||
|
||||
# TODO: wrap with MSPDEBUG_TILIB_PATH env var instead of these rpath fixups in 0.26+
|
||||
runtimeDependencies = stdenv.lib.optional enableMspds mspds;
|
||||
postFixup = stdenv.lib.optionalString (enableMspds && stdenv.isDarwin) ''
|
||||
# autoPatchelfHook only works on linux so...
|
||||
for dep in $runtimeDependencies; do
|
||||
install_name_tool -add_rpath $dep/lib $out/bin/$pname
|
||||
done
|
||||
'';
|
||||
|
||||
installFlags = [ "PREFIX=$(out)" "INSTALL=install" ];
|
||||
makeFlags = [ "UNAME_S=$(unameS)" ] ++
|
||||
stdenv.lib.optional (!enableReadline) "WITHOUT_READLINE=1";
|
||||
|
Loading…
Reference in New Issue
Block a user