diff --git a/pkgs/development/libraries/unicorn-emu/default.nix b/pkgs/development/libraries/unicorn-emu/default.nix deleted file mode 100644 index 3e10f492eb9..00000000000 --- a/pkgs/development/libraries/unicorn-emu/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ stdenv, fetchurl, pkgconfig, python, cmocka, hexdump, writeScriptBin, binutils-unwrapped }: - -stdenv.mkDerivation rec { - pname = "unicorn-emulator"; - version = "1.0.2-rc4"; - - src = fetchurl { - url = "https://github.com/unicorn-engine/unicorn/archive/${version}.tar.gz"; - sha256 = "05w43jq3r97l3c8ggc745ai8m5l93p1b6q6cfp1zwzz6hl5kifiv"; - }; - - PREFIX = placeholder "out"; - MACOS_UNIVERSAL = stdenv.lib.optionalString stdenv.isDarwin "no"; - NIX_CFLAGS_COMPILE = "-Wno-error"; - - doCheck = !stdenv.isDarwin; - - checkInputs = [ - cmocka - hexdump - python.pkgs.setuptools - ]; - - nativeBuildInputs = [ pkgconfig python ]; - enableParallelBuilding = true; - - meta = { - description = "Lightweight multi-platform CPU emulator library"; - homepage = "http://www.unicorn-engine.org"; - license = stdenv.lib.licenses.bsd3; - platforms = stdenv.lib.platforms.unix; - maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; - }; -} diff --git a/pkgs/development/libraries/unicorn/default.nix b/pkgs/development/libraries/unicorn/default.nix new file mode 100644 index 00000000000..cea35519ad8 --- /dev/null +++ b/pkgs/development/libraries/unicorn/default.nix @@ -0,0 +1,27 @@ +{ stdenv +, fetchFromGitHub +, pkgconfig +, cmake +}: + +stdenv.mkDerivation rec { + pname = "unicorn"; + version = "1.0.2"; + + src = fetchFromGitHub { + owner = "unicorn-engine"; + repo = pname; + rev = version; + sha256 = "0jgnyaq6ykpbg5hrwc0p3pargmr9hpzqfsj6ymp4k07pxnqal76j"; + }; + + nativeBuildInputs = [ pkgconfig cmake ]; + + meta = with stdenv.lib; { + description = "Lightweight multi-platform CPU emulator library"; + homepage = "http://www.unicorn-engine.org"; + license = licenses.gpl2Only; + platforms = platforms.unix; + maintainers = with maintainers; [ thoughtpolice luc65r ]; + }; +} diff --git a/pkgs/development/python-modules/unicorn/default.nix b/pkgs/development/python-modules/unicorn/default.nix index e8f4b05916e..8bd6507bb5b 100644 --- a/pkgs/development/python-modules/unicorn/default.nix +++ b/pkgs/development/python-modules/unicorn/default.nix @@ -5,7 +5,7 @@ buildPythonPackage rec { version = stdenv.lib.getVersion unicorn-emu; src = unicorn-emu.src; - sourceRoot = "unicorn-${version}/bindings/python"; + sourceRoot = "source/bindings/python"; prePatch = '' ln -s ${unicorn-emu}/lib/libunicorn${stdenv.targetPlatform.extensions.sharedLibrary} prebuilt/ diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 3538ac56ecf..25e7eb515ff 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -624,6 +624,7 @@ mapAliases ({ ubootBeagleboneBlack = ubootAmx335xEVM; # added 2020-01-21 ucsFonts = ucs-fonts; # added 2016-07-15 ultrastardx-beta = ultrastardx; # added 2017-08-12 + unicorn-emu = unicorn; # added 2020-10-29 usb_modeswitch = usb-modeswitch; # added 2016-05-10 usbguard-nox = usbguard; # added 2019-09-04 uzbl = throw "uzbl has been removed from nixpkgs, as it's unmaintained and uses insecure libraries"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a37fab7ec3d..3108974b7cb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1649,7 +1649,6 @@ in candle = libsForQt5.callPackage ../applications/misc/candle { }; capstone = callPackage ../development/libraries/capstone { }; - unicorn-emu = callPackage ../development/libraries/unicorn-emu { }; casync = callPackage ../applications/networking/sync/casync { sphinx = python3Packages.sphinx; @@ -8072,6 +8071,8 @@ in unbound = callPackage ../tools/networking/unbound { }; + unicorn = callPackage ../development/libraries/unicorn { }; + units = callPackage ../tools/misc/units { enableCurrenciesUpdater = true; pythonPackages = python3Packages; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c93931fe0ab..4691e2b6bd5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7360,7 +7360,9 @@ in { unicode-slugify = callPackage ../development/python-modules/unicode-slugify { }; - unicorn = callPackage ../development/python-modules/unicorn { }; + unicorn = callPackage ../development/python-modules/unicorn { + unicorn-emu = pkgs.unicorn; + }; unidecode = callPackage ../development/python-modules/unidecode { };