mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-21 19:44:09 +00:00
monero-gui: use the cmake build system
This commit is contained in:
parent
59fe3e87c3
commit
059292cc64
@ -1,15 +1,23 @@
|
|||||||
{ stdenv, wrapQtAppsHook, makeDesktopItem
|
{ stdenv, wrapQtAppsHook, makeDesktopItem
|
||||||
, fetchFromGitHub, qmake, qttools, pkgconfig
|
, fetchFromGitHub
|
||||||
|
, cmake, qttools, pkgconfig
|
||||||
, qtbase, qtdeclarative, qtgraphicaleffects
|
, qtbase, qtdeclarative, qtgraphicaleffects
|
||||||
, qtmultimedia, qtxmlpatterns
|
, qtmultimedia, qtxmlpatterns
|
||||||
, qtquickcontrols, qtquickcontrols2
|
, qtquickcontrols, qtquickcontrols2
|
||||||
, monero, unbound, readline, boost, libunwind
|
, monero, miniupnpc, unbound, readline
|
||||||
, libsodium, pcsclite, zeromq, libgcrypt, libgpgerror
|
, boost, libunwind, libsodium, pcsclite
|
||||||
, hidapi, libusb-compat-0_1, protobuf, randomx
|
, randomx, zeromq, libgcrypt, libgpgerror
|
||||||
|
, hidapi, rapidjson
|
||||||
|
, trezorSupport ? true
|
||||||
|
, libusb1 ? null
|
||||||
|
, protobuf ? null
|
||||||
|
, python3 ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
|
assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "monero-gui";
|
pname = "monero-gui";
|
||||||
version = "0.17.0.1";
|
version = "0.17.0.1";
|
||||||
@ -21,42 +29,48 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "1i9a3ampppyzsl4sllbqlr3w43sjpb3fdfxhb1j4n49p8g0jzmf3";
|
sha256 = "1i9a3ampppyzsl4sllbqlr3w43sjpb3fdfxhb1j4n49p8g0jzmf3";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ qmake pkgconfig wrapQtAppsHook ];
|
nativeBuildInputs = [
|
||||||
|
cmake pkgconfig wrapQtAppsHook
|
||||||
|
(getDev qttools)
|
||||||
|
];
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
qtbase qtdeclarative qtgraphicaleffects
|
qtbase qtdeclarative qtgraphicaleffects
|
||||||
qtmultimedia qtquickcontrols qtquickcontrols2
|
qtmultimedia qtquickcontrols qtquickcontrols2
|
||||||
qtxmlpatterns
|
qtxmlpatterns
|
||||||
monero unbound readline libgcrypt libgpgerror
|
monero miniupnpc unbound readline
|
||||||
boost libunwind libsodium pcsclite zeromq
|
randomx libgcrypt libgpgerror
|
||||||
hidapi libusb-compat-0_1 protobuf randomx
|
boost libunwind libsodium pcsclite
|
||||||
];
|
zeromq hidapi rapidjson
|
||||||
|
] ++ optionals trezorSupport [ libusb1 protobuf python3 ];
|
||||||
|
|
||||||
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 ];
|
patches = [ ./move-log-file.patch ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
echo '
|
# set monero-gui version
|
||||||
var GUI_VERSION = "${version}";
|
substituteInPlace src/version.js.in \
|
||||||
var GUI_MONERO_VERSION = "${getVersion monero}";
|
--replace '@VERSION_TAG_GUI@' '${version}'
|
||||||
' > version.js
|
substituteInPlace monero/src/version.cpp.in \
|
||||||
substituteInPlace monero-wallet-gui.pro \
|
--replace '@VERSION_IS_RELEASE@' 'true'
|
||||||
--replace '$$[QT_INSTALL_BINS]/lrelease' '${getDev qttools}/bin/lrelease'
|
|
||||||
|
# use monerod from the monero package
|
||||||
substituteInPlace src/daemon/DaemonManager.cpp \
|
substituteInPlace src/daemon/DaemonManager.cpp \
|
||||||
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
|
--replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
|
||||||
|
|
||||||
|
# only build external deps, *not* the full monero
|
||||||
|
substituteInPlace CMakeLists.txt \
|
||||||
|
--replace 'add_subdirectory(monero)' \
|
||||||
|
'add_subdirectory(monero EXCLUDE_FROM_ALL)'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
makeFlags = [ "INSTALL_ROOT=$(out)" ];
|
cmakeFlags = [ "-DCMAKE_INSTALL_PREFIX=$out/bin" ];
|
||||||
|
|
||||||
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
|
|
||||||
'';
|
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
name = "monero-wallet-gui";
|
name = "monero-wallet-gui";
|
||||||
@ -69,15 +83,15 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# install desktop entry
|
# install desktop entry
|
||||||
mkdir -p $out/share/applications
|
install -Dm644 -t $out/share/applications \
|
||||||
cp ${desktopItem}/share/applications/* $out/share/applications
|
${desktopItem}/share/applications/*
|
||||||
|
|
||||||
# install icons
|
# install icons
|
||||||
for n in 16 24 32 48 64 96 128 256; do
|
for n in 16 24 32 48 64 96 128 256; do
|
||||||
size=$n"x"$n
|
size=$n"x"$n
|
||||||
mkdir -p $out/share/icons/hicolor/$size/apps
|
install -Dm644 \
|
||||||
cp $src/images/appicons/$size.png \
|
-t $out/share/icons/hicolor/$size/apps/monero.png \
|
||||||
$out/share/icons/hicolor/$size/apps/monero.png
|
$src/images/appicons/$size.png
|
||||||
done;
|
done;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user