diff options
author | Peter Simons <simons@cryp.to> | 2014-09-02 12:31:03 +0200 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2014-09-02 12:31:03 +0200 |
commit | 1c0d15b90ef67363f798d67d12dd31ed5fccb411 (patch) | |
tree | 3693dd49b591dbbba261e95fc4b78650f1675578 /pkgs/servers | |
parent | bb61b45d92bad2435e80dcac855a78bda57ec7e8 (diff) | |
parent | 2fc76ea05417671306d27f9ba83ef1b8d4049f3d (diff) | |
download | nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.tar nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.tar.gz nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.tar.bz2 nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.tar.lz nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.tar.xz nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.tar.zst nixlib-1c0d15b90ef67363f798d67d12dd31ed5fccb411.zip |
Merge branch 'origin/master' into staging.
Conflicts: pkgs/development/libraries/ffmpeg/2.x.nix pkgs/development/libraries/serf/default.nix
Diffstat (limited to 'pkgs/servers')
-rw-r--r-- | pkgs/servers/http/tomcat/6.0.nix | 27 | ||||
-rw-r--r-- | pkgs/servers/http/tomcat/7.0.nix | 6 | ||||
-rw-r--r-- | pkgs/servers/http/tomcat/8.0.nix | 6 | ||||
-rw-r--r-- | pkgs/servers/http/tomcat/recent.nix | 24 | ||||
-rw-r--r-- | pkgs/servers/monitoring/munin/default.nix | 2 | ||||
-rw-r--r-- | pkgs/servers/nosql/mongodb/default.nix | 15 | ||||
-rw-r--r-- | pkgs/servers/sql/mariadb/default.nix | 17 | ||||
-rw-r--r-- | pkgs/servers/sql/mariadb/my_context_asm.patch | 18 | ||||
-rw-r--r-- | pkgs/servers/uhub/default.nix | 43 | ||||
-rw-r--r-- | pkgs/servers/uhub/plugin-dir.patch | 23 | ||||
-rw-r--r-- | pkgs/servers/uhub/systemd.patch | 164 |
11 files changed, 313 insertions, 32 deletions
diff --git a/pkgs/servers/http/tomcat/6.0.nix b/pkgs/servers/http/tomcat/6.0.nix index ee0049ce08f6..19f20cc8823c 100644 --- a/pkgs/servers/http/tomcat/6.0.nix +++ b/pkgs/servers/http/tomcat/6.0.nix @@ -1,23 +1,6 @@ -{ stdenv, fetchurl }: - -let version = "6.0.39"; in - -stdenv.mkDerivation rec { - name = "apache-tomcat-${version}"; - - src = fetchurl { - url = "mirror://apache/tomcat/tomcat-6/v${version}/bin/${name}.tar.gz"; +import ./recent.nix + { + versionMajor = "6"; + versionMinor = "0.39"; sha256 = "19qix6affhc252n03smjf482drg3nxd27shni1gvhphgj3zfmgfy"; - }; - - installPhase = - '' - mkdir $out - mv * $out - ''; - - meta = { - homepage = http://tomcat.apache.org/; - description = "An implementation of the Java Servlet and JavaServer Pages technologies"; - }; -} + } diff --git a/pkgs/servers/http/tomcat/7.0.nix b/pkgs/servers/http/tomcat/7.0.nix new file mode 100644 index 000000000000..87bc57eb2b65 --- /dev/null +++ b/pkgs/servers/http/tomcat/7.0.nix @@ -0,0 +1,6 @@ +import ./recent.nix + { + versionMajor = "7"; + versionMinor = "0.55"; + sha256 = "c20934fda63bc7311e2d8e067d67f886890c8be72280425c5f6f8fdd7a376c15"; + } diff --git a/pkgs/servers/http/tomcat/8.0.nix b/pkgs/servers/http/tomcat/8.0.nix new file mode 100644 index 000000000000..63b8d2bbc94e --- /dev/null +++ b/pkgs/servers/http/tomcat/8.0.nix @@ -0,0 +1,6 @@ +import ./recent.nix + { + versionMajor = "8"; + versionMinor = "0.9"; + sha256 = "5ea3c8260088ee4fd223a532a4b0c23a10e549c34705e2f190279a1a7f1f83d9"; + } diff --git a/pkgs/servers/http/tomcat/recent.nix b/pkgs/servers/http/tomcat/recent.nix new file mode 100644 index 000000000000..0d11ba7a1046 --- /dev/null +++ b/pkgs/servers/http/tomcat/recent.nix @@ -0,0 +1,24 @@ +{ versionMajor, versionMinor, sha256 }: +{ stdenv, fetchurl }: + +let version = "${versionMajor}.${versionMinor}"; in + +stdenv.mkDerivation rec { + name = "apache-tomcat-${version}"; + + src = fetchurl { + url = "mirror://apache/tomcat/tomcat-${versionMajor}/v${version}/bin/${name}.tar.gz"; + inherit sha256; + }; + + installPhase = + '' + mkdir $out + mv * $out + ''; + + meta = { + homepage = http://tomcat.apache.org/; + description = "An implementation of the Java Servlet and JavaServer Pages technologies"; + }; +} diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix index 245c838607f3..0ce58e640158 100644 --- a/pkgs/servers/monitoring/munin/default.nix +++ b/pkgs/servers/monitoring/munin/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation rec { *.jar) continue;; esac wrapProgram "$file" \ - --set PERL5LIB "$out/lib/perl5/site_perl:${with perlPackages; stdenv.lib.makePerlPath [ + --set PERL5LIB "$out/lib/perl5/site_perl:${rrdtool}/lib/perl:${with perlPackages; stdenv.lib.makePerlPath [ Log4Perl IOSocketInet6 Socket6 URI DBFile DateManip HTMLTemplate FileCopyRecursive FCGI NetSNMP NetServer ListMoreUtils TimeHiRes DBDPg LWPUserAgent diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix index f51a2b8fe3f8..40c255d59214 100644 --- a/pkgs/servers/nosql/mongodb/default.nix +++ b/pkgs/servers/nosql/mongodb/default.nix @@ -1,17 +1,18 @@ { stdenv, fetchurl, scons, boost, gperftools, pcre, snappy }: +with stdenv.lib; + let version = "2.6.4"; system-libraries = [ - "tcmalloc" "pcre" "boost" "snappy" # "v8" -- mongo still bundles 3.12 and does not work with 3.15+ # "stemmer" -- not nice to package yet (no versioning, no makefile, no shared libs) # "yaml" -- it seems nixpkgs' yamlcpp (0.5.1) is problematic for mongo - ]; - system-lib-args = stdenv.lib.concatStringsSep " " - (map (lib: "--use-system-${lib}") system-libraries); + ] ++ optionals (!stdenv.isDarwin) [ "tcmalloc" ]; + system-lib-args = concatStringsSep " " + (map (lib: "--use-system-${lib}") system-libraries); in stdenv.mkDerivation rec { name = "mongodb-${version}"; @@ -40,9 +41,9 @@ in stdenv.mkDerivation rec { meta = { description = "a scalable, high-performance, open source NoSQL database"; homepage = http://www.mongodb.org; - license = stdenv.lib.licenses.agpl3; + license = licenses.agpl3; - maintainers = [ stdenv.lib.maintainers.bluescreen303 ]; - platforms = stdenv.lib.platforms.linux; + maintainers = with maintainers; [ bluescreen303 offline ]; + platforms = platforms.unix; }; } diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index bb0c0bc8da86..0efdd542fa4e 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, cmake, ncurses, openssl, bison, boost, libxml2, libaio, judy, libevent, groff }: +{ stdenv, fetchurl, cmake, ncurses, openssl, bison, boost, libxml2, libaio, judy, libevent, groff, perl, fixDarwinDylibNames }: stdenv.mkDerivation rec { name = "mariadb-${version}"; @@ -9,12 +9,25 @@ stdenv.mkDerivation rec { sha256 = "039wz89vs03a27anpshj5xaqknm7cqi7mrypvwingqkq26ns0mhs"; }; - buildInputs = [ cmake ncurses openssl bison boost libxml2 libaio judy libevent groff ]; + buildInputs = [ cmake ncurses openssl bison boost libxml2 judy libevent groff ] + ++ stdenv.lib.optional (!stdenv.isDarwin) libaio + ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames ]; + + patches = stdenv.lib.optional stdenv.isDarwin ./my_context_asm.patch; cmakeFlags = [ "-DWITH_READLINE=yes" "-DWITH_EMBEDDED_SERVER=yes" "-DINSTALL_SCRIPTDIR=bin" ]; enableParallelBuilding = true; + prePatch = '' + substituteInPlace cmake/libutils.cmake \ + --replace /usr/bin/libtool libtool + ''; + postInstall = '' + substituteInPlace $out/bin/mysql_install_db \ + --replace basedir=\"\" basedir=\"$out\" + ''; + passthru.mysqlVersion = "5.5"; meta = { diff --git a/pkgs/servers/sql/mariadb/my_context_asm.patch b/pkgs/servers/sql/mariadb/my_context_asm.patch new file mode 100644 index 000000000000..3a747ed1b03c --- /dev/null +++ b/pkgs/servers/sql/mariadb/my_context_asm.patch @@ -0,0 +1,18 @@ +--- a/mysys/my_context.c ++++ b/mysys/my_context.c +@@ -206,15 +206,6 @@ my_context_spawn(struct my_context *c, void (*f)(void *), void *d) + ( + "movq %%rsp, (%[save])\n\t" + "movq %[stack], %%rsp\n\t" +-#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4 && !defined(__INTEL_COMPILER) +- /* +- This emits a DWARF DW_CFA_undefined directive to make the return address +- undefined. This indicates that this is the top of the stack frame, and +- helps tools that use DWARF stack unwinding to obtain stack traces. +- (I use numeric constant to avoid a dependency on libdwarf includes). +- */ +- ".cfi_escape 0x07, 16\n\t" +-#endif + "movq %%rbp, 8(%[save])\n\t" + "movq %%rbx, 16(%[save])\n\t" + "movq %%r12, 24(%[save])\n\t" diff --git a/pkgs/servers/uhub/default.nix b/pkgs/servers/uhub/default.nix new file mode 100644 index 000000000000..a6e0d474d897 --- /dev/null +++ b/pkgs/servers/uhub/default.nix @@ -0,0 +1,43 @@ +{ stdenv, fetchurl, cmake, openssl, sqlite, pkgconfig, systemd +, tlsSupport ? false }: + +assert tlsSupport -> openssl != null; + +let version = "0.4.1"; in +stdenv.mkDerivation { + name = "uhub-${version}"; + + src = fetchurl { + url = "http://www.extatic.org/downloads/uhub/uhub-${version}-src.tar.bz2"; + sha256 = "1q0n74fb0h5w0k9fhfkznxb4r46qyfb8g2ss3wflivx4l0m1f9x2"; + }; + + buildInputs = [ cmake sqlite pkgconfig systemd ] ++ stdenv.lib.optional tlsSupport openssl; + + outputs = [ "out" + "mod_example" + "mod_welcome" + "mod_logging" + "mod_auth_simple" + "mod_auth_sqlite" + "mod_chat_history" + "mod_chat_only" + "mod_topic" + "mod_no_guest_downloads" + ]; + + patches = [ ./plugin-dir.patch ./systemd.patch ]; + + cmakeFlags = '' + -DSYSTEMD_SUPPORT=ON + ${if tlsSupport then "-DSSL_SUPPORT=ON" else "-DSSL_SUPPORT=OFF"} + ''; + + meta = with stdenv.lib; { + description = "High performance peer-to-peer hub for the ADC network"; + homepage = https://www.uhub.org/; + license = licenses.gpl3; + maintainers = [ maintainers.emery ]; + platforms = platforms.unix; + }; +} \ No newline at end of file diff --git a/pkgs/servers/uhub/plugin-dir.patch b/pkgs/servers/uhub/plugin-dir.patch new file mode 100644 index 000000000000..95ebfd6706ff --- /dev/null +++ b/pkgs/servers/uhub/plugin-dir.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40e996e..d3b7e6d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -185,10 +185,16 @@ else() + # add_definitions(-DDEBUG) + endif() + ++set( PLUGINS mod_example mod_welcome mod_logging mod_auth_simple mod_auth_sqlite mod_chat_history mod_chat_only mod_topic mod_no_guest_downloads ) ++ + if (UNIX) + install( TARGETS uhub RUNTIME DESTINATION bin ) +- install( TARGETS mod_example mod_welcome mod_logging mod_auth_simple mod_auth_sqlite mod_chat_history mod_chat_only mod_topic mod_no_guest_downloads DESTINATION /usr/lib/uhub/ OPTIONAL ) +- install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/doc/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION /etc/uhub OPTIONAL ) ++ ++ foreach( PLUGIN ${PLUGINS} ) ++ install( TARGETS ${PLUGIN} DESTINATION $ENV{${PLUGIN}} OPTIONAL ) ++ endforeach( PLUGIN ) ++ ++ install( FILES ${CMAKE_SOURCE_DIR}/doc/uhub.conf ${CMAKE_SOURCE_DIR}/doc/plugins.conf ${CMAKE_SOURCE_DIR}/doc/rules.txt ${CMAKE_SOURCE_DIR}/doc/motd.txt DESTINATION doc/ OPTIONAL ) + + if (SQLITE_SUPPORT) + install( TARGETS uhub-passwd RUNTIME DESTINATION bin ) diff --git a/pkgs/servers/uhub/systemd.patch b/pkgs/servers/uhub/systemd.patch new file mode 100644 index 000000000000..05e7571d18d5 --- /dev/null +++ b/pkgs/servers/uhub/systemd.patch @@ -0,0 +1,164 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 40e996e..fc4fb01 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,6 +19,7 @@ option(LINK_SUPPORT "Allow hub linking" OFF) + option(SSL_SUPPORT "Enable SSL support" ON) + option(USE_OPENSSL "Use OpenSSL's SSL support" ON ) + option(SQLITE_SUPPORT "Enable SQLite support" ON) ++option(SYSTEMD_SUPPORT "Enable systemd notify and journal logging" OFF) + option(ADC_STRESS "Enable the stress tester client" OFF) + + find_package(Git) +@@ -34,6 +35,12 @@ if (SSL_SUPPORT) + endif() + endif() + ++if (SYSTEMD_SUPPORT) ++ INCLUDE(FindPkgConfig) ++ pkg_search_module(SD_DAEMON REQUIRED libsystemd-daemon) ++ pkg_search_module(SD_JOURNAL REQUIRED libsystemd-journal) ++endif() ++ + if (MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + endif() +@@ -175,6 +182,18 @@ if(SSL_SUPPORT) + endif() + endif() + ++if (SYSTEMD_SUPPORT) ++ target_link_libraries(uhub ${SD_DAEMON_LIBRARIES}) ++ target_link_libraries(uhub ${SD_JOURNAL_LIBRARIES}) ++ target_link_libraries(test ${SD_DAEMON_LIBRARIES}) ++ target_link_libraries(test ${SD_JOURNAL_LIBRARIES}) ++ target_link_libraries(uhub-passwd ${SD_JOURNAL_LIBRARIES}) ++ target_link_libraries(uhub-admin ${SD_JOURNAL_LIBRARIES}) ++ include_directories(${SD_DAEMON_INCLUDE_DIRS}) ++ include_directories(${SD_JOURNAL_INCLUDE_DIRS}) ++ add_definitions(-DSYSTEMD) ++endif() ++ + configure_file ("${PROJECT_SOURCE_DIR}/version.h.in" "${PROJECT_SOURCE_DIR}/version.h") + + mark_as_advanced(FORCE CMAKE_BUILD_TYPE) +diff --git a/src/core/main.c b/src/core/main.c +index bb78672..ac2d2a8 100644 +--- a/src/core/main.c ++++ b/src/core/main.c +@@ -19,6 +19,10 @@ + + #include "uhub.h" + ++#ifdef SYSTEMD ++#include <systemd/sd-daemon.h> ++#endif ++ + static int arg_verbose = 5; + static int arg_fork = 0; + static int arg_check_config = 0; +@@ -145,7 +149,16 @@ int main_loop() + } + #if !defined(WIN32) + setup_signal_handlers(hub); +-#endif ++#ifdef SYSTEMD ++ /* Notify the service manager that this daemon has ++ * been successfully initalized and shall enter the ++ * main loop. ++ */ ++ sd_notifyf(0, "READY=1\n" ++ "MAINPID=%lu", (unsigned long) getpid()); ++#endif /* SYSTEMD */ ++ ++#endif /* ! WIN32 */ + } + + hub_set_variables(hub, &acl); +@@ -216,13 +229,17 @@ void print_usage(char* program) + " -q Quiet mode - no output\n" + " -f Fork to background\n" + " -l <file> Log messages to given file (default: stderr)\n" +- " -L Log messages to syslog\n" + " -c <file> Specify configuration file (default: " SERVER_CONFIG ")\n" + " -C Check configuration and return\n" + " -s Show configuration parameters\n" + " -S Show configuration parameters, but ignore defaults\n" + " -h This message\n" + #ifndef WIN32 ++#ifdef SYSTEMD ++ " -L Log messages to journal\n" ++#else ++ " -L Log messages to syslog\n" ++#endif + " -u <user> Run as given user\n" + " -g <group> Run with given group permissions\n" + " -p <file> Store pid in file (process id)\n" +diff --git a/src/util/log.c b/src/util/log.c +index 42badb3..2d97528 100644 +--- a/src/util/log.c ++++ b/src/util/log.c +@@ -21,7 +21,15 @@ + #include <locale.h> + + #ifndef WIN32 ++ ++#ifdef SYSTEMD ++#define SD_JOURNAL_SUPPRESS_LOCATION ++#include <systemd/sd-journal.h> ++ ++#else + #include <syslog.h> ++#endif ++ + static int use_syslog = 0; + #endif + +@@ -83,7 +91,9 @@ void hub_log_initialize(const char* file, int syslog) + if (syslog) + { + use_syslog = 1; ++ #ifndef SYSTEMD + openlog("uhub", LOG_PID, LOG_USER); ++ #endif + } + #endif + +@@ -132,7 +142,9 @@ void hub_log_shutdown() + if (use_syslog) + { + use_syslog = 0; ++ #ifndef SYSTEMD + closelog(); ++ #endif + } + #endif + } +@@ -212,7 +224,12 @@ void hub_log(int log_verbosity, const char *format, ...) + case log_fatal: level = LOG_CRIT; break; + case log_error: level = LOG_ERR; break; + case log_warning: level = LOG_WARNING; break; +- case log_user: level = LOG_INFO | LOG_AUTH; break; ++ #ifdef SYSTEMD ++ case log_user: level = LOG_INFO; break; ++ ++ #else ++ case log_user: level = LOG_INFO | LOG_AUTH; break; ++ #endif + case log_info: level = LOG_INFO; break; + case log_debug: level = LOG_DEBUG; break; + +@@ -224,8 +241,13 @@ void hub_log(int log_verbosity, const char *format, ...) + if (level == 0) + return; + ++ #ifdef SYSTEMD ++ sd_journal_print(level, "%s", logmsg); ++ ++ #else + level |= (LOG_USER | LOG_DAEMON); + syslog(level, "%s", logmsg); ++ #endif + } + #endif + |