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
This commit is contained in:
Matthew Bauer 2018-11-11 20:52:07 -06:00
parent 1ba9fd335d
commit bfbfe941ab
28 changed files with 149 additions and 260 deletions

View File

@ -17,12 +17,8 @@ stdenv.mkDerivation rec {
jack jack
]; ];
buildPhase = ''
scons
'';
installPhase = '' installPhase = ''
mkdir -p $out/bin install -D jackmix/jackmix $out/bin/jackmix
cp jackmix/jackmix $out/bin
''; '';
meta = { meta = {

View File

@ -12,15 +12,9 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ scons libsamplerate libsndfile liblo libjack2 boost ]; buildInputs = [ scons libsamplerate libsndfile liblo libjack2 boost ];
prefixKey = "PREFIX=";
NIX_CFLAGS_COMPILE = "-fpermissive"; NIX_CFLAGS_COMPILE = "-fpermissive";
buildPhase = ''
mkdir -p $out
scons PREFIX=$out
'';
installPhase = "scons install";
meta = { meta = {
homepage = http://das.nasophon.de/klick/; homepage = http://das.nasophon.de/klick/;
description = "Advanced command-line metronome for JACK"; description = "Advanced command-line metronome for JACK";
@ -28,4 +22,3 @@ stdenv.mkDerivation rec {
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
}; };
} }

View File

@ -32,26 +32,11 @@ stdenv.mkDerivation rec {
"opus=1" "opus=1"
]; ];
buildPhase = ''
runHook preBuild
mkdir -p "$out"
scons \
-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
$sconsFlags "prefix=$out"
runHook postBuild
'';
installPhase = ''
runHook preInstall
scons $sconsFlags "prefix=$out" install
runHook postInstall
'';
fixupPhase = '' fixupPhase = ''
wrapProgram $out/bin/mixxx \ wrapProgram $out/bin/mixxx \
--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive; --set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive;
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = https://mixxx.org; homepage = https://mixxx.org;
description = "Digital DJ mixing software"; description = "Digital DJ mixing software";

View File

@ -21,14 +21,6 @@ stdenv.mkDerivation rec {
sed -i "s/= check/= detail::filter_base<internal_type, checked>::check/" nova/source/dsp/filter.hpp sed -i "s/= check/= detail::filter_base<internal_type, checked>::check/" nova/source/dsp/filter.hpp
''; '';
buildPhase = ''
scons
'';
installPhase = ''
scons $sconsFlags "prefix=$out" install
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "LADSPA plugins based on filters of nova"; description = "LADSPA plugins based on filters of nova";
homepage = http://klingt.org/~tim/nova-filters/; homepage = http://klingt.org/~tim/nova-filters/;

View File

@ -1,5 +1,5 @@
{ stdenv, lib, pkgconfig, fetchFromGitHub, scons, python, glibmm, libpulseaudio, libao { stdenv, lib, pkgconfig, fetchFromGitHub, scons
}: , python, glibmm, libpulseaudio, libao }:
let let
version = "unstable-2018-02-10"; version = "unstable-2018-02-10";
@ -30,14 +30,6 @@ in stdenv.mkDerivation rec {
patches = [ ./honor_nix_environment.patch ]; patches = [ ./honor_nix_environment.patch ];
buildPhase = ''
scons prefix=$out
'';
installPhase = ''
scons install
'';
meta = { meta = {
description = "A free and open source speech synthesizer for Russian language and others"; description = "A free and open source speech synthesizer for Russian language and others";
homepage = https://github.com/Olga-Yakovleva/RHVoice/wiki; homepage = https://github.com/Olga-Yakovleva/RHVoice/wiki;

View File

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, gdk_pixbuf, scons, pkgconfig, gtk2, glib, { stdenv, fetchFromGitHub, gdk_pixbuf, scons, pkgconfig, gtk2, glib
pcre, cfitsio, perl, gob2, vala, libtiff, json-glib }: , pcre, cfitsio, perl, gob2, vala, libtiff, json-glib }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "giv-${version}"; name = "giv-${version}";
@ -21,10 +21,6 @@ stdenv.mkDerivation rec {
patches = [ ./build.patch ]; patches = [ ./build.patch ];
buildPhase = "scons";
installPhase = "scons install";
nativeBuildInputs = [ scons pkgconfig vala perl gob2 ]; nativeBuildInputs = [ scons pkgconfig vala perl gob2 ];
buildInputs = [ gdk_pixbuf gtk2 glib pcre cfitsio libtiff json-glib ]; buildInputs = [ gdk_pixbuf gtk2 glib pcre cfitsio libtiff json-glib ];

View File

@ -26,10 +26,7 @@ in stdenv.mkDerivation rec {
propagatedBuildInputs = [ numpy ]; propagatedBuildInputs = [ numpy ];
buildPhase = "scons prefix=$out"; postInstall = ''
installPhase = ''
scons prefix=$out install
sed -i -e 's|/usr/bin/env python2.7|${python}/bin/python|' $out/bin/mypaint sed -i -e 's|/usr/bin/env python2.7|${python}/bin/python|' $out/bin/mypaint
''; '';

View File

@ -3,9 +3,7 @@
, lua, miniupnpc, openssl, qtbase, qtmultimedia, qtsvg, qtwebkit, qtx11extras, zlib , lua, miniupnpc, openssl, qtbase, qtmultimedia, qtsvg, qtwebkit, qtx11extras, zlib
}: }:
let stdenv.mkDerivation rec {
_scons = "scons -j$NIX_BUILD_CORES";
in stdenv.mkDerivation rec {
name = "swift-im-${version}"; name = "swift-im-${version}";
version = "4.0.2"; version = "4.0.2";
@ -30,14 +28,12 @@ in stdenv.mkDerivation rec {
"-I${miniupnpc}/include/miniupnpc" "-I${miniupnpc}/include/miniupnpc"
"-I${qtwebkit.dev}/include/QtWebKit" "-I${qtwebkit.dev}/include/QtWebKit"
"-I${qtwebkit.dev}/include/QtWebKitWidgets" "-I${qtwebkit.dev}/include/QtWebKitWidgets"
"-fpermissive"
]; ];
buildPhase = '' preInstall = ''
${_scons} Swift installTargets="$out"
''; installFlags+=" SWIFT_INSTALLDIR=$out"
installPhase = ''
${_scons} SWIFT_INSTALLDIR=$out $out
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {

View File

@ -35,16 +35,10 @@ stdenv.mkDerivation rec {
libxmlxx ffmpeg enca libxmlxx ffmpeg enca
]; ];
buildPhase = '' prefixKey = "PREFIX=";
scons PREFIX=$out -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
'';
enableParallelBuilding = true; enableParallelBuilding = true;
installPhase = ''
scons install
'';
meta = { meta = {
description = "a DVD authoring program for personal computers"; description = "a DVD authoring program for personal computers";
homepage = "http://www.bombono.org/"; homepage = "http://www.bombono.org/";

View File

@ -29,40 +29,35 @@ stdenv.mkDerivation rec {
postgresql postgresql
]; ];
configurePhase = '' prefixKey = "PREFIX=";
scons configure PREFIX="$out" BOOST_INCLUDES="${boost.dev}/include" \
BOOST_LIBS="${boost.out}/lib" \
CAIRO_INCLUDES="${cairo.dev}/include" \
CAIRO_LIBS="${cairo.out}/lib" \
FREETYPE_INCLUDES="${freetype.dev}/include" \
FREETYPE_LIBS="${freetype.out}/lib" \
GDAL_CONFIG="${gdal}/bin/gdal-config" \
HB_INCLUDES="${harfbuzz.dev}/include" \
HB_LIBS="${harfbuzz.out}/lib" \
ICU_INCLUDES="${icu.dev}/include" \
ICU_LIBS="${icu.out}/lib" \
JPEG_INCLUDES="${libjpeg.dev}/include" \
JPEG_LIBS="${libjpeg.out}/lib" \
PNG_INCLUDES="${libpng.dev}/include" \
PNG_LIBS="${libpng.out}/lib" \
PROJ_INCLUDES="${proj}/include" \
PROJ_LIBS="${proj}/lib" \
SQLITE_INCLUDES="${sqlite.dev}/include" \
SQLITE_LIBS="${sqlite.out}/lib" \
TIFF_INCLUDES="${libtiff.dev}/include" \
TIFF_LIBS="${libtiff.out}/lib" \
WEBP_INCLUDES="${libwebp}/include" \
WEBP_LIBS="${libwebp}/lib" \
XML2_INCLUDES="${libxml2.dev}/include" \
XML2_LIBS="${libxml2.out}/lib"
'';
buildPhase = false; sconsFlags = [
"BOOST_INCLUDES=${boost.dev}/include"
installPhase = '' "BOOST_LIBS=${boost.out}/lib"
mkdir -p "$out" "CAIRO_INCLUDES=${cairo.dev}/include"
scons install "CAIRO_LIBS=${cairo.out}/lib"
''; "FREETYPE_INCLUDES=${freetype.dev}/include"
"FREETYPE_LIBS=${freetype.out}/lib"
"GDAL_CONFIG=${gdal}/bin/gdal-config"
"HB_INCLUDES=${harfbuzz.dev}/include"
"HB_LIBS=${harfbuzz.out}/lib"
"ICU_INCLUDES=${icu.dev}/include"
"ICU_LIBS=${icu.out}/lib"
"JPEG_INCLUDES=${libjpeg.dev}/include"
"JPEG_LIBS=${libjpeg.out}/lib"
"PNG_INCLUDES=${libpng.dev}/include"
"PNG_LIBS=${libpng.out}/lib"
"PROJ_INCLUDES=${proj}/include"
"PROJ_LIBS=${proj}/lib"
"SQLITE_INCLUDES=${sqlite.dev}/include"
"SQLITE_LIBS=${sqlite.out}/lib"
"TIFF_INCLUDES=${libtiff.dev}/include"
"TIFF_LIBS=${libtiff.out}/lib"
"WEBP_INCLUDES=${libwebp}/include"
"WEBP_LIBS=${libwebp}/lib"
"XML2_INCLUDES=${libxml2.dev}/include"
"XML2_LIBS=${libxml2.out}/lib"
];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "An open source toolkit for developing mapping applications"; description = "An open source toolkit for developing mapping applications";

View File

@ -9,28 +9,22 @@ stdenv.mkDerivation rec {
sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l"; sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig scons ];
buildInputs = [ apr scons openssl aprutil zlib libiconv ] buildInputs = [ apr openssl aprutil zlib libiconv ]
++ stdenv.lib.optional (!stdenv.isCygwin) kerberos; ++ stdenv.lib.optional (!stdenv.isCygwin) kerberos;
patches = [ ./scons.patch ]; patches = [ ./scons.patch ];
buildPhase = '' prefixKey = "PREFIX=";
scons \
-j $NIX_BUILD_CORES \
APR="$(echo ${apr.dev}/bin/*-config)" \
APU="$(echo ${aprutil.dev}/bin/*-config)" \
CC=$CC \
OPENSSL=${openssl} \
PREFIX="$out" \
ZLIB=${zlib} \
${
if stdenv.isCygwin then "" else "GSSAPI=${kerberos.dev}"
}
'';
installPhase = '' preConfigure = ''
scons install sconsFlags+=" APR=$(echo ${apr.dev}/bin/*-config)"
sconsFlags+=" APU=$(echo ${aprutil.dev}/bin/*-config)"
sconsFlags+=" CC=$CC"
sconsFlags+=" OPENSSL=${openssl}"
sconsFlags+=" ZLIB=${zlib}"
'' + stdenv.lib.optionalString (!stdenv.isCygwin) ''
sconsFlags+=" GSSAPI=${kerberos.dev}"
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,8 +1,9 @@
{ stdenv, python, fetchurl, openssl, boost }: { stdenv, python, fetchurl, openssl, boost, scons }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "swiften-${version}"; name = "swiften-${version}";
version = "4.0.2"; version = "4.0.2";
nativeBuildInputs = [ scons];
buildInputs = [ python ]; buildInputs = [ python ];
propagatedBuildInputs = [ openssl boost ]; propagatedBuildInputs = [ openssl boost ];
@ -10,16 +11,17 @@ stdenv.mkDerivation rec {
url = "https://swift.im/downloads/releases/swift-${version}/swift-${version}.tar.gz"; url = "https://swift.im/downloads/releases/swift-${version}/swift-${version}.tar.gz";
sha256 = "0w0aiszjd58ynxpacwcgf052zpmbpcym4dhci64vbfgch6wryz0w"; sha256 = "0w0aiszjd58ynxpacwcgf052zpmbpcym4dhci64vbfgch6wryz0w";
}; };
buildPhase = '' sconsFlags = [
patchShebangs ./scons "openssl=${openssl.dev}"
./scons openssl=${openssl.dev} \ "boost_includedir=${boost.dev}/include"
boost_includedir=${boost.dev}/include \ "boost_libdir=${boost.out}/lib"
boost_libdir=${boost.out}/lib \ "boost_bundled_enable=false"
boost_bundled_enable=false \ ];
SWIFTEN_INSTALLDIR=$out $out preInstall = ''
installTargets="$out"
installFlags+=" SWIFT_INSTALLDIR=$out"
''; '';
installPhase = "true";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "An XMPP library for C++, used by the Swift client"; description = "An XMPP library for C++, used by the Swift client";

View File

@ -22,9 +22,8 @@ in buildPythonPackage rec {
sha256 = "01vm8mqhpdrwlxw6rxbg3wz51njq69yn862141mja00mllg3j7pg"; sha256 = "01vm8mqhpdrwlxw6rxbg3wz51njq69yn862141mja00mllg3j7pg";
}; };
buildInputs = stdenv.lib.optionals doCheck [ vmprof pyqt4 ]; checkInputs = [ vmprof pyqt4 ];
nativeBuildInputs = [ scons ];
propagatedBuildInputs = [ scons ];
postPatch = '' postPatch = ''
patchShebangs tests/run-tests patchShebangs tests/run-tests

View File

@ -10,13 +10,12 @@ buildPythonPackage rec {
sha256 = "09r1ga6kj5cnmrldpkqzvdhh7xi7aad9g4fbcr1gawgsd9y13g0a"; sha256 = "09r1ga6kj5cnmrldpkqzvdhh7xi7aad9g4fbcr1gawgsd9y13g0a";
}; };
buildPhase = '' preBuild = ''
sed -i -e "s@env = Environment()@env = Environment( ENV = os.environ )@" src/SConscript sed -i -e "s@env = Environment()@env = Environment( ENV = os.environ )@" src/SConscript
scons
''; '';
installPhase = ''
preInstall = ''
sed -i -e "s@ python_lib_path = get_python_lib(plat_specific=True)@ python_lib_path = \'/lib/python2.7/site-packages\'@" src/SConscript sed -i -e "s@ python_lib_path = get_python_lib(plat_specific=True)@ python_lib_path = \'/lib/python2.7/site-packages\'@" src/SConscript
scons install DESTDIR=$out
''; '';
buildInputs = [ python exiv2 scons boost ]; buildInputs = [ python exiv2 scons boost ];

View File

@ -33,10 +33,9 @@ in stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
buildPhase = '' sconsFlags = "target=release_debug platform=x11";
scons target=release_debug platform=x11 prefix=$out -j $NIX_BUILD_CORES \ preConfigure = ''
${lib.concatStringsSep " " sconsFlags+=" ${lib.concatStringsSep " " (lib.mapAttrsToList (k: v: "${k}=${builtins.toJSON v}") options)}"
(lib.mapAttrsToList (k: v: "${k}=${builtins.toJSON v}") options)}
''; '';
outputs = [ "out" "dev" "man" ]; outputs = [ "out" "dev" "man" ];

View File

@ -12,8 +12,6 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib python scons ]; buildInputs = [ glib python scons ];
buildPhase = "scons prefix=$out";
installPhase = "scons prefix=$out install";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A bit-oriented parser combinator library"; description = "A bit-oriented parser combinator library";
@ -28,5 +26,5 @@ stdenv.mkDerivation rec {
homepage = https://github.com/UpstandingHackers/hammer; homepage = https://github.com/UpstandingHackers/hammer;
license = licenses.gpl2; license = licenses.gpl2;
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View File

@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
sha256 = "0zd55bc8smmgk9j4cf0jpibb03lgsvl0knpwhplxbv93mcdnw7s0"; sha256 = "0zd55bc8smmgk9j4cf0jpibb03lgsvl0knpwhplxbv93mcdnw7s0";
}; };
buildInputs = [ lua scons ]; nativeBuildInputs = [ scons ];
buildInputs = [ lua ];
patches = [ ./environ-and-linux-is-kinda-posix.patch ]; patches = [ ./environ-and-linux-is-kinda-posix.patch ];
@ -20,10 +21,6 @@ stdenv.mkDerivation rec {
--replace /usr/local $out --replace /usr/local $out
''; '';
buildPhase = ''scons'';
installPhase = ''scons install'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A tool to integrate C/Cpp code with Lua"; description = "A tool to integrate C/Cpp code with Lua";
homepage = http://www.codenix.com/~tolua/; homepage = http://www.codenix.com/~tolua/;

View File

@ -14,24 +14,21 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = "-I${SDL_image}/include/SDL"; NIX_CFLAGS_COMPILE = "-I${SDL_image}/include/SDL";
patches = [ (fetchpatch { patches = [
name = "gcc-4.7.patch"; (fetchpatch {
url = "https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/btanks/debian/patches/gcc-4.7.patch?revision=13641&view=co&pathrev=15758"; url = "https://sources.debian.org/data/main/b/btanks/0.9.8083-7/debian/patches/gcc-4.7.patch";
sha256 = "1dxlk1xh69gj10sqcsyckiakb8an3h41206wby4z44mpmvxc7pi4"; sha256 = "1dxlk1xh69gj10sqcsyckiakb8an3h41206wby4z44mpmvxc7pi4";
}) ]; })
(fetchpatch {
url = "https://sources.debian.org/data/main/b/btanks/0.9.8083-7/debian/patches/pow10f.patch";
sha256 = "1h45790v2dpdbccfn6lwfgl8782q54i14cz9gpipkaghcka4y0g9";
})
];
buildPhase = '' meta = with stdenv.lib; {
scons prefix=$out
'';
installPhase = ''
scons install
'';
meta = {
homepage = https://sourceforge.net/projects/btanks/; homepage = https://sourceforge.net/projects/btanks/;
description = "Fast 2d tank arcade game"; description = "Fast 2d tank arcade game";
license = stdenv.lib.licenses.gpl2Plus; license = licenses.gpl2Plus;
broken = true; # 2018-09-13, no successful build since 2018-03-16 platforms = platforms.unix;
}; };
} }

View File

@ -39,18 +39,7 @@ in stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral"; NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
buildPhase = '' postInstall = ''
runHook preBuild
scons prefix=$out
runHook postBuild
'';
installPhase = ''
runHook preInstall
scons prefix=$out install
install -Dm644 ${music} $out/share/games/dxx-rebirth/d2xr-sc55-music.dxa install -Dm644 ${music} $out/share/games/dxx-rebirth/d2xr-sc55-music.dxa
install -Dm644 -t $out/share/doc/dxx-rebirth *.txt install -Dm644 -t $out/share/doc/dxx-rebirth *.txt

View File

@ -22,18 +22,12 @@ stdenv.mkDerivation rec {
SDL2 libpng libjpeg glew openal scons libmad SDL2 libpng libjpeg glew openal scons libmad
]; ];
prefixKey = "PREFIX=";
patches = [ patches = [
./fixes.patch ./fixes.patch
]; ];
buildPhase = ''
scons -j$NIX_BUILD_CORES PREFIX="$out"
'';
installPhase = ''
scons -j$NIX_BUILD_CORES install PREFIX="$out"
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A sandbox-style space exploration game similar to Elite, Escape Velocity, or Star Control"; description = "A sandbox-style space exploration game similar to Elite, Escape Velocity, or Star Control";
homepage = https://endless-sky.github.io/; homepage = https://endless-sky.github.io/;

View File

@ -32,19 +32,15 @@ stdenv.mkDerivation rec {
sed -i -e "s@env = Environment()@env = Environment( ENV = os.environ )@" SConstruct sed -i -e "s@env = Environment()@env = Environment( ENV = os.environ )@" SConstruct
''; '';
buildInputs = [ libGLU_combined SDL scons SDL_ttf SDL_image zlib SDL_net speex libvorbis libogg boost fribidi bsdiff ]; nativeBuildInputs = [ scons ];
buildInputs = [ libGLU_combined SDL SDL_ttf SDL_image zlib SDL_net speex libvorbis libogg boost fribidi bsdiff ];
buildPhase = '' postConfigure = ''
scons sconsFlags+=" BINDIR=$out/bin"
sconsFlags+=" INSTALLDIR=$out/share/globulation2"
sconsFlags+=" DATADIR=$out/share/globulation2/glob2"
''; '';
installPhase = ''
scons install \
BINDIR=$out/bin \
INSTALLDIR=$out/share/globulation2 \
DATADIR=$out/share/globulation2/glob2
'';
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "RTS without micromanagement"; description = "RTS without micromanagement";
maintainers = with maintainers; [ raskin ]; maintainers = with maintainers; [ raskin ];
@ -53,4 +49,3 @@ stdenv.mkDerivation rec {
}; };
passthru.updateInfo.downloadPage = "http://globulation2.org/wiki/Download_and_Install"; passthru.updateInfo.downloadPage = "http://globulation2.org/wiki/Download_and_Install";
} }

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
buildInputs = [ SDL lua fftwFloat zlib bzip2 ]; buildInputs = [ SDL lua fftwFloat zlib bzip2 ];
buildPhase = "scons DESTDIR=$out/bin --tool='' -j$NIX_BUILD_CORES"; sconsFlags = "--tool=";
installPhase = '' installPhase = ''
install -Dm 755 build/powder* "$out/bin/powder" install -Dm 755 build/powder* "$out/bin/powder"

View File

@ -8,23 +8,23 @@ stdenv.mkDerivation {
sha256 = "0gl2i3qdmcm7v9m5kpfz98w05d8m33990jiwka043ya7lflxvrjb"; sha256 = "0gl2i3qdmcm7v9m5kpfz98w05d8m33990jiwka043ya7lflxvrjb";
}; };
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig scons ];
buildInputs = [ buildInputs = [
scons zlib SDL lua5_1 zlib SDL lua5_1
]; ];
phases = "unpackPhase buildPhase"; sconsFlags = "OPENGL=false GTK=false CREATE_AVI=false LOGO=false";
prefixKey = "--prefix=";
# sed allows scons to find libraries in nix. # sed allows scons to find libraries in nix.
# mkdir is a hack to make scons succeed. It still doesn't # mkdir is a hack to make scons succeed. It still doesn't
# actually put the files in there due to a bug in the SConstruct file. # actually put the files in there due to a bug in the SConstruct file.
# OPENGL doesn't work because fceux dlopens the library. # OPENGL doesn't work because fceux dlopens the library.
buildPhase = '' preBuild = ''
sed -e 's/env *= *Environment *.*/&; env['"'"'ENV'"'"']=os.environ;/' -i SConstruct sed -e 's/env *= *Environment *.*/&; env['"'"'ENV'"'"']=os.environ;/' -i SConstruct
export CC="gcc" export CC="gcc"
export CXX="g++" export CXX="g++"
mkdir -p "$out" "$out/share/applications" "$out/share/pixmaps" mkdir -p "$out" "$out/share/applications" "$out/share/pixmaps"
scons --prefix="$out" OPENGL=false GTK=false CREATE_AVI=false LOGO=false install
''; '';
meta = { meta = {

View File

@ -44,30 +44,30 @@ stdenv.mkDerivation rec {
# - leapfetch=no disables going online at build time to fetch leap-seconds # - leapfetch=no disables going online at build time to fetch leap-seconds
# info. See <gpsd-src>/build.txt for more info. # info. See <gpsd-src>/build.txt for more info.
buildPhase = '' preBuild = ''
patchShebangs . patchShebangs .
sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
scons \
-j $NIX_BUILD_CORES \ sconsFlags+=" udevdir=$out/lib/udev"
prefix="$out" \ sconsFlags+=" python_libdir=$out/lib/${python2Packages.python.libPrefix}/site-packages"
leapfetch=no \
gpsd_user=${gpsdUser} \
gpsd_group=${gpsdGroup} \
systemd=yes \
udevdir="$out/lib/udev" \
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" export LD_LIBRARY_PATH="$PWD"
scons check
''; '';
# TODO: the udev rules file and the hotplug script need fixes to work on NixOS # TODO: the udev rules file and the hotplug script need fixes to work on NixOS
installPhase = '' preInstall = ''
mkdir -p "$out/lib/udev/rules.d" mkdir -p "$out/lib/udev/rules.d"
scons install udev-install
''; '';
installTargets = "install udev-install";
postFixup = '' postFixup = ''
wrapPythonProgramsIn $out/bin "$out $pythonPath" wrapPythonProgramsIn $out/bin "$out $pythonPath"

View File

@ -20,25 +20,6 @@ let version = "3.4.10";
"yaml" "yaml"
] ++ optionals stdenv.isLinux [ "tcmalloc" ]; ] ++ 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 { in stdenv.mkDerivation rec {
name = "mongodb-${version}"; name = "mongodb-${version}";
@ -48,7 +29,10 @@ in stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ scons ]; 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 = patches =
[ [
@ -83,14 +67,26 @@ in stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isClang "-Wno-unused-command-line-argument"; NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isClang "-Wno-unused-command-line-argument";
buildPhase = '' sconsFlags = [
scons -j $NIX_BUILD_CORES core --release ${other-args} "--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 mkdir -p $out/lib
scons -j $NIX_BUILD_CORES install --release --prefix=$out ${other-args}
''; '';
prefixKey = "--prefix=";
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -15,12 +15,10 @@ stdenv.mkDerivation rec {
sed -i -e "s@ENV = dict.*@ENV = os.environ@g" SConstruct sed -i -e "s@ENV = dict.*@ENV = os.environ@g" SConstruct
''; '';
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig scons ];
buildInputs = [ scons openssl protobuf boost zlib ]; buildInputs = [ openssl protobuf boost zlib ];
buildPhase = "scons"; postInstall = ''
installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp build/rippled $out/bin/ cp build/rippled $out/bin/
''; '';

View File

@ -233,7 +233,7 @@ galera = stdenv.mkDerivation rec {
buildInputs = [ asio boost check openssl scons ]; buildInputs = [ asio boost check openssl scons ];
patchPhase = '' postPatch = ''
substituteInPlace SConstruct \ substituteInPlace SConstruct \
--replace "boost_library_path = '''" "boost_library_path = '${boost}/lib'" --replace "boost_library_path = '''" "boost_library_path = '${boost}/lib'"
''; '';
@ -243,11 +243,9 @@ galera = stdenv.mkDerivation rec {
export LIBPATH="${galeraLibs}/lib" export LIBPATH="${galeraLibs}/lib"
''; '';
buildPhase = '' sconsFlags = "ssl=1 system_asio=1 strict_build_flags=0";
scons -j$NIX_BUILD_CORES ssl=1 system_asio=1 strict_build_flags=0
'';
installPhase = '' postInstall = ''
# copied with modifications from scripts/packages/freebsd.sh # copied with modifications from scripts/packages/freebsd.sh
GALERA_LICENSE_DIR="$share/licenses/${name}" GALERA_LICENSE_DIR="$share/licenses/${name}"
install -d $out/{bin,lib/galera,share/doc/galera,$GALERA_LICENSE_DIR} install -d $out/{bin,lib/galera,share/doc/galera,$GALERA_LICENSE_DIR}

View File

@ -5,7 +5,8 @@
*/ */
stdenv.mkDerivation { stdenv.mkDerivation {
name = "lprof-1.11.4.1"; name = "lprof-1.11.4.1";
buildInputs = [ scons qt3 lcms1 libtiff vigra ]; nativeBuildInputs = [ scons ];
buildInputs = [ qt3 lcms1 libtiff vigra ];
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
@ -19,14 +20,11 @@ stdenv.mkDerivation {
sha256 = "0q8x24fm5yyvm151xrl3l03p7hvvciqnkbviprfnvlr0lyg9wsrn"; sha256 = "0q8x24fm5yyvm151xrl3l03p7hvvciqnkbviprfnvlr0lyg9wsrn";
}; };
buildPhase = '' sconsFlags = "SYSLIBS=1";
mkdir -p $out preBuild = ''
export CXX=g++ export CXX=g++
scons PREFIX=$out SYSLIBS=1 install
''; '';
prefixKey = "PREFIX=";
installPhase = ":";
patches = [ ./lcms-1.17.patch ./keep-environment.patch ]; patches = [ ./lcms-1.17.patch ./keep-environment.patch ];