@@ -0,0 +1,40 @@
1+{ stdenv, fetchFromGitHub, python3, makeWrapper }:
2+
3+python3.pkgs.buildPythonApplication rec {
4+
5+ pname = "ubidump";
6+ version = "unstable-2019-09-11";
7+
8+ src = fetchFromGitHub {
9+ owner = "nlitsme";
10+ repo = pname;
11+ rev = "0691f1a9a38604c2baf8c9af6b826eb2632af74a";
12+ sha256 = "1hiivlgni4r3nd5n2rzl5qzw6y2wpjpmyls5lybrc8imd6rmj3w2";
13+ };
14+
15+ propagatedBuildInputs = with python3.pkgs; [ crcmod python-lzo ];
16+
17+ phases = [ "unpackPhase" "patchPhase" "installPhase" "installCheckPhase" ];
18+
19+ patchPhase = ''
20+ sed -i '1s;^;#!${python3.interpreter}\n;' ubidump.py
21+ patchShebangs ubidump.py
22+ '';
23+
24+ installPhase = ''
25+ install -D -m755 ubidump.py $out/bin/ubidump
26+ wrapProgram $out/bin/ubidump --set PYTHONPATH $PYTHONPATH
27+ '';
28+
29+ installCheckPhase = ''
30+ $out/bin/ubidump -h > /dev/null
31+ '';
32+
33+ meta = with stdenv.lib; {
34+ description = "View or extract the contents of UBIFS images";
35+ homepage = "https://github.com/nlitsme/ubidump";
36+ license = licenses.mit;
37+ maintainers = with maintainers; [ sgo ];
38+ };
39+}
40+