1{ lib, stdenv, buildPythonPackage, fetchPypi, keystone }:
2
3buildPythonPackage rec {
4 pname = "keystone-engine";
5 version = "0.9.2";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "1xahdr6bh3dw5swrc2r8kqa8ljhqlb7k2kxv5mrw5rhcmcnzcyig";
10 };
11
12 setupPyBuildFlags = lib.optionals stdenv.isLinux [ "--plat-name" "linux" ];
13
14 preConfigure = ''
15 substituteInPlace setup.py --replace \
16 "libkeystone" "${keystone}/lib/libkeystone"
17 '';
18
19 # No tests
20 doCheck = false;
21
22 pythonImportsCheck = [ "keystone" ];
23
24 meta = with lib; {
25 description = "Lightweight multi-platform, multi-architecture assembler framework";
26 homepage = "https://www.keystone-engine.org";
27 maintainers = with maintainers; [ dump_stack ];
28 license = licenses.gpl2Only;
29 };
30}