From f31f03925c1affabaa5dd8504ca99d03bda51b8d Mon Sep 17 00:00:00 2001 From: Stijn DW Date: Sun, 18 Apr 2021 19:51:11 +0200 Subject: [PATCH] retroshare: init at 6.6.0 --- .../networking/p2p/retroshare/default.nix | 53 ++++++++++++++++ .../p2p/retroshare/no-submodules.patch | 62 +++++++++++++++++++ pkgs/top-level/aliases.nix | 1 - pkgs/top-level/all-packages.nix | 2 + 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/networking/p2p/retroshare/default.nix create mode 100644 pkgs/applications/networking/p2p/retroshare/no-submodules.patch diff --git a/pkgs/applications/networking/p2p/retroshare/default.nix b/pkgs/applications/networking/p2p/retroshare/default.nix new file mode 100644 index 000000000000..e69155d4c2f4 --- /dev/null +++ b/pkgs/applications/networking/p2p/retroshare/default.nix @@ -0,0 +1,53 @@ +{ lib, mkDerivation, fetchFromGitHub, qmake, cmake, pkg-config, miniupnpc, bzip2 +, speex, libmicrohttpd, libxml2, libxslt, sqlcipher, rapidjson, libXScrnSaver +, qtbase, qtx11extras, qtmultimedia, libgnome-keyring3 +}: + +mkDerivation rec { + pname = "retroshare"; + version = "0.6.6"; + + src = fetchFromGitHub { + owner = "RetroShare"; + repo = "RetroShare"; + rev = "v${version}"; + sha256 = "1hsymbhsfgycj39mdkrdp2hgq8irmvxa4a6jx2gg339m1fgf2xmh"; + fetchSubmodules = true; + }; + + patches = [ + # The build normally tries to get git sub-modules during build + # but we already have them checked out + ./no-submodules.patch + ]; + + nativeBuildInputs = [ pkg-config qmake cmake ]; + buildInputs = [ + speex miniupnpc qtmultimedia qtx11extras qtbase libgnome-keyring3 + bzip2 libXScrnSaver libxml2 libxslt sqlcipher libmicrohttpd rapidjson + ]; + + qmakeFlags = [ + # Upnp library autodetection doesn't work + "RS_UPNP_LIB=miniupnpc" + + # These values are normally found from the .git folder + "RS_MAJOR_VERSION=${lib.versions.major version}" + "RS_MINOR_VERSION=${lib.versions.minor version}" + "RS_MINI_VERSION=${lib.versions.patch version}" + "RS_EXTRA_VERSION=" + ]; + + postInstall = '' + # BT DHT bootstrap + cp libbitdht/src/bitdht/bdboot.txt $out/share/retroshare + ''; + + meta = with lib; { + description = "Decentralized peer to peer chat application."; + homepage = "http://retroshare.sourceforge.net/"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ StijnDW ]; + }; +} diff --git a/pkgs/applications/networking/p2p/retroshare/no-submodules.patch b/pkgs/applications/networking/p2p/retroshare/no-submodules.patch new file mode 100644 index 000000000000..d47268003090 --- /dev/null +++ b/pkgs/applications/networking/p2p/retroshare/no-submodules.patch @@ -0,0 +1,62 @@ +diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro +index 84d18944e..71aeb67d2 100644 +--- a/libretroshare/src/libretroshare.pro ++++ b/libretroshare/src/libretroshare.pro +@@ -870,20 +870,14 @@ rs_jsonapi { + genrestbedlib.variable_out = PRE_TARGETDEPS + win32-g++:isEmpty(QMAKE_SH) { + genrestbedlib.commands = \ +- cd /D $$shell_path($${RS_SRC_PATH}) && git submodule update --init supportlibs/restbed || cd . $$escape_expand(\\n\\t) \ +- cd /D $$shell_path($${RESTBED_SRC_PATH}) && git submodule update --init dependency/asio || cd . $$escape_expand(\\n\\t) \ +- cd /D $$shell_path($${RESTBED_SRC_PATH}) && git submodule update --init dependency/catch || cd . $$escape_expand(\\n\\t )\ +- cd /D $$shell_path($${RESTBED_SRC_PATH}) && git submodule update --init dependency/kashmir || cd . $$escape_expand(\\n\\t) \ ++ cd /D $$shell_path($${RS_SRC_PATH}) && cd . $$escape_expand(\\n\\t) \ ++ cd /D $$shell_path($${RESTBED_SRC_PATH}) && cd . $$escape_expand(\\n\\t) \ ++ cd /D $$shell_path($${RESTBED_SRC_PATH}) && cd . $$escape_expand(\\n\\t )\ ++ cd /D $$shell_path($${RESTBED_SRC_PATH}) && cd . $$escape_expand(\\n\\t) \ + $(CHK_DIR_EXISTS) $$shell_path($$UDP_DISCOVERY_BUILD_PATH) $(MKDIR) $$shell_path($${UDP_DISCOVERY_BUILD_PATH}) $$escape_expand(\\n\\t) + } else { + genrestbedlib.commands = \ +- cd $${RS_SRC_PATH} && ( \ +- git submodule update --init supportlibs/restbed ; \ +- cd $${RESTBED_SRC_PATH} ; \ +- git submodule update --init dependency/asio ; \ +- git submodule update --init dependency/catch ; \ +- git submodule update --init dependency/kashmir ; \ +- true ) && \ ++ cd $${RS_SRC_PATH} && \ + mkdir -p $${RESTBED_BUILD_PATH} && + } + genrestbedlib.commands += \ +@@ -991,14 +985,9 @@ rs_broadcast_discovery { + udpdiscoverycpplib.variable_out = PRE_TARGETDEPS + win32-g++:isEmpty(QMAKE_SH) { + udpdiscoverycpplib.commands = \ +- cd /D $$shell_path($${RS_SRC_PATH}) && git submodule update --init supportlibs/udp-discovery-cpp || cd . $$escape_expand(\\n\\t) \ + $(CHK_DIR_EXISTS) $$shell_path($$UDP_DISCOVERY_BUILD_PATH) $(MKDIR) $$shell_path($${UDP_DISCOVERY_BUILD_PATH}) $$escape_expand(\\n\\t) + } else { +- udpdiscoverycpplib.commands = \ +- cd $${RS_SRC_PATH} && ( \ +- git submodule update --init supportlibs/udp-discovery-cpp || \ +- true ) && \ +- mkdir -p $${UDP_DISCOVERY_BUILD_PATH} && ++ udpdiscoverycpplib.commands = mkdir -p $${UDP_DISCOVERY_BUILD_PATH} && + } + udpdiscoverycpplib.commands += \ + cd $$shell_path($${UDP_DISCOVERY_BUILD_PATH}) && \ +diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro +index 654efd170..06cba9ba3 100644 +--- a/retroshare-gui/src/retroshare-gui.pro ++++ b/retroshare-gui/src/retroshare-gui.pro +@@ -66,10 +66,7 @@ rs_gui_cmark { + gencmarklib.CONFIG += target_predeps combine + gencmarklib.variable_out = PRE_TARGETDEPS + gencmarklib.commands = \ +- cd $${RS_SRC_PATH} && ( \ +- git submodule update --init supportlibs/cmark ; \ +- cd $${CMARK_SRC_PATH} ; \ +- true ) && \ ++ cd $${RS_SRC_PATH} && \ + mkdir -p $${CMARK_BUILD_PATH} && cd $${CMARK_BUILD_PATH} && \ + cmake \ + -DCMAKE_CXX_COMPILER=$$QMAKE_CXX \ diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ba631bb45ec5..1c08a313ab9f 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -648,7 +648,6 @@ mapAliases ({ rdiff_backup = rdiff-backup; # added 2014-11-23 rdmd = dtools; # added 2017-08-19 readline80 = throw "readline-8.0 is no longer supported in nixpkgs, please use 'readline' for main supported version or 'readline81' for most recent version"; # added 2021-04-22 - retroshare = throw "retroshare was removed because it was broken"; # added 2021-05-17 rhc = throw "rhc was deprecated on 2019-04-09: abandoned by upstream."; rng_tools = rng-tools; # added 2018-10-24 robomongo = robo3t; #added 2017-09-28 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2dcf97a211de..adb3d7a45be6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26245,6 +26245,8 @@ in remotebox = callPackage ../applications/virtualization/remotebox { }; + retroshare = libsForQt5.callPackage ../applications/networking/p2p/retroshare { }; + rgp = libsForQt5.callPackage ../development/tools/rgp { }; ricochet = libsForQt5.callPackage ../applications/networking/instant-messengers/ricochet { };