diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/blockchains/monero-gui/default.nix')
-rw-r--r-- | nixpkgs/pkgs/applications/blockchains/monero-gui/default.nix | 88 |
1 files changed, 54 insertions, 34 deletions
diff --git a/nixpkgs/pkgs/applications/blockchains/monero-gui/default.nix b/nixpkgs/pkgs/applications/blockchains/monero-gui/default.nix index 6ea075e2a369..cffbdde8f003 100644 --- a/nixpkgs/pkgs/applications/blockchains/monero-gui/default.nix +++ b/nixpkgs/pkgs/applications/blockchains/monero-gui/default.nix @@ -1,63 +1,84 @@ { stdenv, wrapQtAppsHook, makeDesktopItem -, fetchFromGitHub, qmake, qttools, pkgconfig +, fetchFromGitHub +, cmake, qttools, pkgconfig , qtbase, qtdeclarative, qtgraphicaleffects , qtmultimedia, qtxmlpatterns , qtquickcontrols, qtquickcontrols2 -, monero, unbound, readline, boost, libunwind -, libsodium, pcsclite, zeromq, libgcrypt, libgpgerror -, hidapi, libusb-compat-0_1, protobuf, randomx +, qtmacextras +, monero, miniupnpc, unbound, readline +, boost, libunwind, libsodium, pcsclite +, randomx, zeromq, libgcrypt, libgpgerror +, hidapi, rapidjson +, trezorSupport ? true +, libusb1 ? null +, protobuf ? null +, python3 ? null }: with stdenv.lib; +assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ]; + +let + arch = if stdenv.isx86_64 then "x86-64" + else if stdenv.isi686 then "i686" + else if stdenv.isAarch64 then "armv8-a" + else throw "unsupported architecture"; +in + stdenv.mkDerivation rec { pname = "monero-gui"; - version = "0.16.0.3"; + version = "0.17.1.8"; src = fetchFromGitHub { owner = "monero-project"; repo = "monero-gui"; rev = "v${version}"; - sha256 = "0iwjp8x5swy8i8pzrlm5v55awhm54cf48pm1vz98lcq361lhfzk6"; + sha256 = "13cjrfdkr7c2ff8j2rg8hvhlc00af38vcs67wlx2109i2baq4pp3"; }; - nativeBuildInputs = [ qmake pkgconfig wrapQtAppsHook ]; + nativeBuildInputs = [ + cmake pkgconfig wrapQtAppsHook + (getDev qttools) + ]; buildInputs = [ qtbase qtdeclarative qtgraphicaleffects qtmultimedia qtquickcontrols qtquickcontrols2 qtxmlpatterns - monero unbound readline libgcrypt libgpgerror - boost libunwind libsodium pcsclite zeromq - hidapi libusb-compat-0_1 protobuf randomx - ]; + monero miniupnpc unbound readline + randomx libgcrypt libgpgerror + boost libunwind libsodium pcsclite + zeromq hidapi rapidjson + ] ++ optionals trezorSupport [ libusb1 protobuf python3 ] + ++ optionals stdenv.isDarwin [ qtmacextras ]; - NIX_CFLAGS_COMPILE = [ "-Wno-error=format-security" ]; + postUnpack = '' + # copy monero sources here + # (needs to be writable) + cp -r ${monero.source}/* source/monero + chmod -R +w source/monero + ''; patches = [ ./move-log-file.patch ]; postPatch = '' - echo ' - var GUI_VERSION = "${version}"; - var GUI_MONERO_VERSION = "${getVersion monero}"; - ' > version.js - substituteInPlace monero-wallet-gui.pro \ - --replace '$$[QT_INSTALL_BINS]/lrelease' '${getDev qttools}/bin/lrelease' + # set monero-gui version + substituteInPlace src/version.js.in \ + --replace '@VERSION_TAG_GUI@' '${version}' + + # use monerod from the monero package substituteInPlace src/daemon/DaemonManager.cpp \ --replace 'QApplication::applicationDirPath() + "' '"${monero}/bin' - ''; - - makeFlags = [ "INSTALL_ROOT=$(out)" ]; - preBuild = '' - sed -i s#/opt/monero-wallet-gui##g Makefile - make -C src/zxcvbn-c - - # use nixpkgs monero sources - rmdir monero - ln -s "${monero.src}" monero + # only build external deps, *not* the full monero + substituteInPlace CMakeLists.txt \ + --replace 'add_subdirectory(monero)' \ + 'add_subdirectory(monero EXCLUDE_FROM_ALL)' ''; + cmakeFlags = [ "-DARCH=${arch}" ]; + desktopItem = makeDesktopItem { name = "monero-wallet-gui"; exec = "monero-wallet-gui"; @@ -69,15 +90,15 @@ stdenv.mkDerivation rec { postInstall = '' # install desktop entry - mkdir -p $out/share/applications - cp ${desktopItem}/share/applications/* $out/share/applications + install -Dm644 -t $out/share/applications \ + ${desktopItem}/share/applications/* # install icons for n in 16 24 32 48 64 96 128 256; do size=$n"x"$n - mkdir -p $out/share/icons/hicolor/$size/apps - cp $src/images/appicons/$size.png \ - $out/share/icons/hicolor/$size/apps/monero.png + install -Dm644 \ + -t $out/share/icons/hicolor/$size/apps/monero.png \ + $src/images/appicons/$size.png done; ''; @@ -86,7 +107,6 @@ stdenv.mkDerivation rec { homepage = "https://getmonero.org/"; license = licenses.bsd3; platforms = platforms.all; - badPlatforms = platforms.darwin; maintainers = with maintainers; [ rnhmjoj ]; }; } |