summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-11-11 20:52:07 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2018-11-13 19:14:10 -0600
commitbfbfe941abba2a0d7061c86d78b1e8facdeb17f8 (patch)
tree2f6b86640ce155d6ecf2c5ec79811ad63c2cc703 /pkgs/servers
parent1ba9fd335d90bca03b3868d3bf10c3d9a9de29c6 (diff)
downloadnixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.tar
nixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.tar.gz
nixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.tar.bz2
nixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.tar.lz
nixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.tar.xz
nixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.tar.zst
nixpkgs-bfbfe941abba2a0d7061c86d78b1e8facdeb17f8.zip
treewide: use scons setup hook
Lots of packages can use it. Here is the list:

- jackmix
- klick
- mixx
- nova-filters
- rhvoice
- giv
- mypaint
- swift-im
- bombono
- mapnik
- serf
- nuitka
- pyexiv2
- godot
- hammer
- toluapp
- btanks
- dxx-rebirth
- endless-sky
- globulation
- the-powder-toy
- fceux
- gpsd
- mongodb
- rippled
- mariadb
- lprof
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/gpsd/default.nix28
-rw-r--r--pkgs/servers/nosql/mongodb/default.nix44
-rw-r--r--pkgs/servers/rippled/default.nix8
-rw-r--r--pkgs/servers/sql/mariadb/default.nix8
4 files changed, 40 insertions, 48 deletions
diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix
index 6e270192063..f205b600dd9 100644
--- a/pkgs/servers/gpsd/default.nix
+++ b/pkgs/servers/gpsd/default.nix
@@ -44,30 +44,30 @@ stdenv.mkDerivation rec {
 
   # - leapfetch=no disables going online at build time to fetch leap-seconds
   #   info. See <gpsd-src>/build.txt for more info.
-  buildPhase = ''
+  preBuild = ''
     patchShebangs .
     sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
-    scons \
-      -j $NIX_BUILD_CORES \
-      prefix="$out" \
-      leapfetch=no \
-      gpsd_user=${gpsdUser} \
-      gpsd_group=${gpsdGroup} \
-      systemd=yes \
-      udevdir="$out/lib/udev" \
-      python_libdir="$out/lib/${python2Packages.python.libPrefix}/site-packages"
+
+    sconsFlags+=" udevdir=$out/lib/udev"
+    sconsFlags+=" python_libdir=$out/lib/${python2Packages.python.libPrefix}/site-packages"
   '';
 
-  checkPhase = ''
+  sconsFlags = [
+    "leapfetch=no"
+    "gpsd_user=${gpsdUser}"
+    "gpsd_group=${gpsdGroup}"
+    "systemd=yes"
+  ];
+
+  preCheck = ''
     export LD_LIBRARY_PATH="$PWD"
-    scons check
   '';
 
   # TODO: the udev rules file and the hotplug script need fixes to work on NixOS
-  installPhase = ''
+  preInstall = ''
     mkdir -p "$out/lib/udev/rules.d"
-    scons install udev-install
   '';
+  installTargets = "install udev-install";
 
   postFixup = ''
     wrapPythonProgramsIn $out/bin "$out $pythonPath"
diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix
index c62ade1a20b..55b4b641d15 100644
--- a/pkgs/servers/nosql/mongodb/default.nix
+++ b/pkgs/servers/nosql/mongodb/default.nix
@@ -20,25 +20,6 @@ let version = "3.4.10";
       "yaml"
     ] ++ optionals stdenv.isLinux [ "tcmalloc" ];
 
-    buildInputs = [
-      sasl boost gperftools pcre-cpp snappy
-      zlib libyamlcpp sasl openssl.dev openssl.out libpcap
-    ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security ];
-
-    other-args = concatStringsSep " " ([
-      "--ssl"
-      #"--rocksdb" # Don't have this packaged yet
-      "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
-      "--js-engine=mozjs"
-      "--use-sasl-client"
-      "--disable-warnings-as-errors"
-      "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
-      "CC=$CC"
-      "CXX=$CXX"
-      "CCFLAGS=\"${concatStringsSep " " (map (input: "-I${input}/include") buildInputs)}\""
-      "LINKFLAGS=\"${concatStringsSep " " (map (input: "-L${input}/lib") buildInputs)}\""
-    ] ++ map (lib: "--use-system-${lib}") system-libraries);
-
 in stdenv.mkDerivation rec {
   name = "mongodb-${version}";
 
@@ -48,7 +29,10 @@ in stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ scons ];
-  inherit buildInputs;
+  buildInputs = [
+    sasl boost gperftools pcre-cpp snappy
+    zlib libyamlcpp sasl openssl.dev openssl.out libpcap
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security ];
 
   patches =
     [
@@ -83,14 +67,26 @@ in stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isClang "-Wno-unused-command-line-argument";
 
-  buildPhase = ''
-    scons -j $NIX_BUILD_CORES core --release ${other-args}
+  sconsFlags = [
+    "--release"
+    "--ssl"
+    #"--rocksdb" # Don't have this packaged yet
+    "--wiredtiger=${if stdenv.is64bit then "on" else "off"}"
+    "--js-engine=mozjs"
+    "--use-sasl-client"
+    "--disable-warnings-as-errors"
+    "VARIANT_DIR=nixos" # Needed so we don't produce argument lists that are too long for gcc / ld
+  ] ++ map (lib: "--use-system-${lib}") system-libraries;
+
+  preBuild = ''
+    sconsFlags+=" CC=$CC"
+    sconsFlags+=" CXX=$CXX"
   '';
 
-  installPhase = ''
+  preInstall = ''
     mkdir -p $out/lib
-    scons -j $NIX_BUILD_CORES install --release --prefix=$out ${other-args}
   '';
+  prefixKey = "--prefix=";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/servers/rippled/default.nix b/pkgs/servers/rippled/default.nix
index c1d9655ef23..af25da7ae45 100644
--- a/pkgs/servers/rippled/default.nix
+++ b/pkgs/servers/rippled/default.nix
@@ -15,12 +15,10 @@ stdenv.mkDerivation rec {
     sed -i -e "s@ENV = dict.*@ENV = os.environ@g" SConstruct
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ scons openssl protobuf boost zlib ];
+  nativeBuildInputs = [ pkgconfig scons ];
+  buildInputs = [ openssl protobuf boost zlib ];
 
-  buildPhase = "scons";
-
-  installPhase = ''
+  postInstall = ''
     mkdir -p $out/bin
     cp build/rippled $out/bin/
   '';
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index d2a4406a973..6415fc95437 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -233,7 +233,7 @@ galera = stdenv.mkDerivation rec {
 
   buildInputs = [ asio boost check openssl scons ];
 
-  patchPhase = ''
+  postPatch = ''
     substituteInPlace SConstruct \
       --replace "boost_library_path = '''" "boost_library_path = '${boost}/lib'"
   '';
@@ -243,11 +243,9 @@ galera = stdenv.mkDerivation rec {
     export LIBPATH="${galeraLibs}/lib"
   '';
 
-  buildPhase = ''
-     scons -j$NIX_BUILD_CORES ssl=1 system_asio=1 strict_build_flags=0
-  '';
+  sconsFlags = "ssl=1 system_asio=1 strict_build_flags=0";
 
-  installPhase = ''
+  postInstall = ''
     # copied with modifications from scripts/packages/freebsd.sh
     GALERA_LICENSE_DIR="$share/licenses/${name}"
     install -d $out/{bin,lib/galera,share/doc/galera,$GALERA_LICENSE_DIR}