From b52a3d90fee2f096a8be8cc93abe2cdfe33eab52 Mon Sep 17 00:00:00 2001 From: Emanuele Peruffo Date: Fri, 7 Apr 2017 12:19:19 +0200 Subject: [PATCH 1/2] robomongo: 0.8.4 -> 0.9.0 --- lib/maintainers.nix | 1 + pkgs/applications/misc/robomongo/default.nix | 51 +++++++++++----- .../misc/robomongo/robomongo.patch | 61 ------------------- pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 38 insertions(+), 77 deletions(-) delete mode 100644 pkgs/applications/misc/robomongo/robomongo.patch diff --git a/lib/maintainers.nix b/lib/maintainers.nix index c3ab790e7c7..173aeebe5fe 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -160,6 +160,7 @@ eleanor = "Dejan Lukan "; elitak = "Eric Litak "; ellis = "Ellis Whitehead "; + eperuffo = "Emanuele Peruffo "; epitrochoid = "Mabry Cervin "; ericbmerritt = "Eric Merritt "; ericsagnes = "Eric Sagnes "; diff --git a/pkgs/applications/misc/robomongo/default.nix b/pkgs/applications/misc/robomongo/default.nix index 41de15bca51..cb100fa6fc6 100644 --- a/pkgs/applications/misc/robomongo/default.nix +++ b/pkgs/applications/misc/robomongo/default.nix @@ -1,29 +1,50 @@ -{ stdenv, fetchurl, qtbase, openssl, boost, cmake, scons, python, pcre, bzip2 }: +{ stdenv, fetchurl, zlib, glib, xorg, dbus, fontconfig, freetype, xkeyboard_config, makeWrapper }: stdenv.mkDerivation { - name = "robomongo-0.8.4"; + name = "robomongo-0.9.0"; src = fetchurl { - url = https://github.com/paralect/robomongo/archive/v0.8.4.tar.gz; - sha256 = "199fb08701wrw3ky7gcqyvb3z4027qjcqdnzrx5y7yi3rb4gvkzc"; + url = "https://download.robomongo.org/0.9.0/linux/robomongo-0.9.0-linux-x86_64-0786489.tar.gz"; + sha256 = "1q8ahdz3afcw002p8dl2pybzkq4srk6bnikrz216yx1gswivdcad"; }; - patches = [ ./robomongo.patch ]; + ldLibraryPath = stdenv.lib.makeLibraryPath [ + stdenv.cc.cc + zlib + glib + xorg.libXi + xorg.libxcb + xorg.libXrender + xorg.libX11 + xorg.libSM + xorg.libICE + xorg.libXext + dbus + fontconfig + freetype + ]; - postPatch = '' - rm ./cmake/FindOpenSSL.cmake # remove outdated bundled CMake file + buildInputs = [makeWrapper]; + + installPhase = '' + mkdir -p $out/bin + cp bin/* $out/bin + + mkdir -p $out/lib + cp -r lib/* $out/lib + + patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $out/bin/robomongo + + wrapProgram $out/bin/robomongo \ + --suffix LD_LIBRARY_PATH : $ldLibraryPath \ + --suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb ''; - NIX_CFLAGS_COMPILE = "-fno-stack-protector"; - - buildInputs = [ cmake boost scons qtbase openssl python pcre bzip2 ]; - meta = { - homepage = "http://robomongo.org/"; + homepage = "https://robomongo.org/"; description = "Query GUI for mongodb"; - platforms = stdenv.lib.platforms.linux; + platforms = stdenv.lib.intersectLists stdenv.lib.platforms.linux stdenv.lib.platforms.x86_64; license = stdenv.lib.licenses.gpl3; - maintainers = [ stdenv.lib.maintainers.amorsillo ]; - broken = true; + maintainers = [ stdenv.lib.maintainers.eperuffo ]; }; } diff --git a/pkgs/applications/misc/robomongo/robomongo.patch b/pkgs/applications/misc/robomongo/robomongo.patch deleted file mode 100644 index 3de6e940d9f..00000000000 --- a/pkgs/applications/misc/robomongo/robomongo.patch +++ /dev/null @@ -1,61 +0,0 @@ -Remove check for QT_NO_STYLE_GTK to avoid building with QCleanlooksStyle which results in error due to missing QCleanlooksStyle -Ensure environment is preserved for scons build -- scons clears the env but we want to keep the nix build environment -Fix typo in cmakelists -Add stdint.h include to mongo driver src -diff -rupN robomongo-0.8.3/CMakeLists.txt robomongo-0.8.3-patched/CMakeLists.txt ---- robomongo-0.8.3/CMakeLists.txt 2013-10-01 10:55:00.000000000 -0400 -+++ robomongo-0.8.3-patched/CMakeLists.txt 2013-12-06 12:22:06.070659856 -0500 -@@ -133,7 +133,7 @@ ELSE() - ENDIF() - - ##################################DEFAULT VALUES########################################## --IF(NOT CMAKE_INSTALL_PREFIX}) -+IF(NOT CMAKE_INSTALL_PREFIX) - SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install") - ENDIF() - -diff -rupN robomongo-0.8.3/src/robomongo/gui/AppStyle.h robomongo-0.8.3-patched/src/robomongo/gui/AppStyle.h ---- robomongo-0.8.3/src/robomongo/gui/AppStyle.h 2013-10-01 10:55:00.000000000 -0400 -+++ robomongo-0.8.3-patched/src/robomongo/gui/AppStyle.h 2013-12-06 12:20:57.417297186 -0500 -@@ -8,13 +8,8 @@ - #include - typedef QProxyStyle OsStyle; - #elif defined OS_LINUX -- #if !defined(QT_NO_STYLE_GTK) -- #include -- typedef QProxyStyle OsStyle; -- #else -- #include -- typedef QCleanlooksStyle OsStyle; -- #endif -+ #include -+ typedef QProxyStyle OsStyle; - #endif - - namespace Robomongo - -diff -rupN robomongo-0.8.3/src/third-party/mongodb/SConstruct robomongo-0.8.3-patched/src/third-party/mongodb/SConstruct ---- robomongo-0.8.3/src/third-party/mongodb/SConstruct 2013-10-01 10:55:00.000000000 -0400 -+++ robomongo-0.8.3-patched/src/third-party/mongodb/SConstruct 2013-12-06 12:21:45.705255731 -0500 -@@ -283,7 +283,8 @@ usePCH = has_option( "usePCH" ) - - justClientLib = (COMMAND_LINE_TARGETS == ['mongoclient']) - --env = Environment( BUILD_DIR=variantDir, -+env = Environment( ENV=os.environ, -+ BUILD_DIR=variantDir, - CLIENT_ARCHIVE='${CLIENT_DIST_BASENAME}${DIST_ARCHIVE_SUFFIX}', - CLIENT_DIST_BASENAME=get_option('client-dist-basename'), - CLIENT_LICENSE='#distsrc/client/LICENSE.txt', - -diff -rupN robomongo-0.8.4/src/third-party/mongodb/src/mongo/pch.h robomongo-0.8.4-patched/src/third-party/mongodb/src/mongo/pch.h ---- robomongo-0.8.4/src/third-party/mongodb/src/mongo/pch.h 2013-12-13 12:56:35.000000000 -0500 -+++ robomongo-0.8.4-patched/src/third-party/mongodb/src/mongo/pch.h 2014-08-20 18:16:31.788396489 -0400 -@@ -39,6 +39,7 @@ - #include - #include - #include -+#include - - #include "time.h" - #include "string.h" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 26187bf7e55..4763f4a5f26 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18021,7 +18021,7 @@ with pkgs; redis-desktop-manager = libsForQt56.callPackage ../applications/misc/redis-desktop-manager { }; - robomongo = libsForQt5.callPackage ../applications/misc/robomongo { }; + robomongo = callPackage ../applications/misc/robomongo { }; rucksack = callPackage ../development/tools/rucksack { }; From 668777f01d670a2bbc56a07511664dff58af277d Mon Sep 17 00:00:00 2001 From: Emanuele Peruffo Date: Fri, 7 Apr 2017 13:40:27 +0200 Subject: [PATCH 2/2] robomongo: add desktop entry --- pkgs/applications/misc/robomongo/default.nix | 87 +++++++++++++------- 1 file changed, 55 insertions(+), 32 deletions(-) diff --git a/pkgs/applications/misc/robomongo/default.nix b/pkgs/applications/misc/robomongo/default.nix index cb100fa6fc6..1516e827c5e 100644 --- a/pkgs/applications/misc/robomongo/default.nix +++ b/pkgs/applications/misc/robomongo/default.nix @@ -1,13 +1,7 @@ -{ stdenv, fetchurl, zlib, glib, xorg, dbus, fontconfig, freetype, xkeyboard_config, makeWrapper }: - -stdenv.mkDerivation { - name = "robomongo-0.9.0"; - - src = fetchurl { - url = "https://download.robomongo.org/0.9.0/linux/robomongo-0.9.0-linux-x86_64-0786489.tar.gz"; - sha256 = "1q8ahdz3afcw002p8dl2pybzkq4srk6bnikrz216yx1gswivdcad"; - }; +{ stdenv, fetchurl, zlib, glib, xorg, dbus, fontconfig, + freetype, xkeyboard_config, makeDesktopItem, makeWrapper }: +let ldLibraryPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc zlib @@ -24,27 +18,56 @@ stdenv.mkDerivation { freetype ]; - buildInputs = [makeWrapper]; - - installPhase = '' - mkdir -p $out/bin - cp bin/* $out/bin - - mkdir -p $out/lib - cp -r lib/* $out/lib - - patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $out/bin/robomongo - - wrapProgram $out/bin/robomongo \ - --suffix LD_LIBRARY_PATH : $ldLibraryPath \ - --suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb - ''; - - meta = { - homepage = "https://robomongo.org/"; - description = "Query GUI for mongodb"; - platforms = stdenv.lib.intersectLists stdenv.lib.platforms.linux stdenv.lib.platforms.x86_64; - license = stdenv.lib.licenses.gpl3; - maintainers = [ stdenv.lib.maintainers.eperuffo ]; + icon = fetchurl { + url = "https://github.com/Studio3T/robomongo/raw/v0.9.0/trash/install/linux/robomongo.png"; + sha256 = "15li8536x600kkfkb3h6mw7y0f2ljkv951pc45dpiw036vldibv2"; }; -} +in + stdenv.mkDerivation { + name = "robomongo-0.9.0"; + + src = fetchurl { + url = "https://download.robomongo.org/0.9.0/linux/robomongo-0.9.0-linux-x86_64-0786489.tar.gz"; + sha256 = "1q8ahdz3afcw002p8dl2pybzkq4srk6bnikrz216yx1gswivdcad"; + }; + + desktopItem = makeDesktopItem { + name = "robomongo"; + exec = "robomongo"; + icon = icon; + comment = "Query GUI for mongodb"; + desktopName = "Robomongo"; + genericName = "MongoDB management tool"; + categories = "Development;IDE;mongodb;"; + }; + + buildInputs = [makeWrapper]; + + installPhase = '' + mkdir -p $out/bin + cp bin/* $out/bin + + mkdir -p $out/lib + cp -r lib/* $out/lib + + mkdir -p $out/share/applications + cp $desktopItem/share/applications/* $out/share/applications + + mkdir -p $out/share/icons + cp ${icon} $out/share/icons/robomongo.png + + patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 $out/bin/robomongo + + wrapProgram $out/bin/robomongo \ + --suffix LD_LIBRARY_PATH : ${ldLibraryPath} \ + --suffix QT_XKB_CONFIG_ROOT : ${xkeyboard_config}/share/X11/xkb + ''; + + meta = { + homepage = "https://robomongo.org/"; + description = "Query GUI for mongodb"; + platforms = stdenv.lib.intersectLists stdenv.lib.platforms.linux stdenv.lib.platforms.x86_64; + license = stdenv.lib.licenses.gpl3; + maintainers = [ stdenv.lib.maintainers.eperuffo ]; + }; + }