Skip to content

Instantly share code, notes, and snippets.

@expipiplus1
Created June 26, 2016 12:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save expipiplus1/0904c24eeff6f615fb5dcd8195af627d to your computer and use it in GitHub Desktop.
Save expipiplus1/0904c24eeff6f615fb5dcd8195af627d to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl, dpkg, patchelf, libusb1 }:
stdenv.mkDerivation rec {
name = "adept-${version}";
version = "2.16.5";
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://cloud.digilentinc.com/Software/Adept2+Runtime/${version}/digilent.adept.runtime_${version}-amd64.deb";
sha256 = "09kr5sffarq21w0f4z6mz4f8cizxb7l59mznbkv0gsxsc5d6k2zs";
}
else throw "adept is not supported on ${stdenv.system}";
buildInputs = [ dpkg patchelf ];
unpackPhase = ''
dpkg-deb -x ${src} ./
'';
dontBuild = true;
rpath = [ stdenv.cc.cc
libusb1
];
installPhase = ''
mkdir -p "$out/bin"
cp -a usr/* "$out/"
interpreter="$(echo ${stdenv.glibc.out}/lib/ld-linux*)"
patchelf --set-interpreter "$interpreter" "$out/sbin/dftdrvdtch"
patchelf --set-rpath "${stdenv.lib.makeLibraryPath rpath}" "$out/sbin/dftdrvdtch"
'';
meta = with stdenv.lib; {
description = "Tool to allow communication with Digilent boards";
homepage = https://reference.digilentinc.com/digilent_adept_2;
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.expipiplus1 ];
};
}
{ stdenv, fetchurl, dpkg, patchelf, libusb1, adept }:
stdenv.mkDerivation rec {
name = "adept-utilities-${version}";
version = "2.2.1";
src =
if stdenv.system == "x86_64-linux" then
fetchurl {
url = "http://cloud.digilentinc.com/Software/Adept2/digilent.adept.utilities_${version}-amd64.deb";
sha256 = "0g6wp8j67w0iariscwnl3906r9mfzrz5ykqalr0ayl18b9qscw7g";
}
else throw "adept-utilities is not supported on ${stdenv.system}";
buildInputs = [ dpkg patchelf ];
unpackPhase = ''
dpkg-deb -x ${src} ./
'';
dontBuild = true;
rpath = [ stdenv.cc.cc
libusb1
"${adept}/lib/digilent/adept"
];
installPhase = ''
mkdir -p "$out/bin"
cp -a usr/* "$out/"
interpreter="$(echo ${stdenv.glibc.out}/lib/ld-linux*)"
for f in dadutil djtgcfg dsumecfg; do
patchelf --set-interpreter "$interpreter" "$out/bin/$f"
patchelf --set-rpath "${stdenv.lib.makeLibraryPath rpath}" "$out/bin/$f"
done
'';
meta = with stdenv.lib; {
description = "Support utilities for digilent adept";
homepage = https://reference.digilentinc.com/digilent_adept_2;
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = [ maintainers.expipiplus1 ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment