diff options
Diffstat (limited to 'pkgs/os-specific/linux')
30 files changed, 410 insertions, 66 deletions
diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix index c4fd46b3c7da..d2637f99119c 100644 --- a/pkgs/os-specific/linux/alsa-lib/default.nix +++ b/pkgs/os-specific/linux/alsa-lib/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { sed -i -e 's/u_int\([0-9]*\)_t/uint\1_t/g' include/pcm.h ''; + outputs = [ "dev" "out" ]; + crossAttrs = { patchPhase = '' sed -i s/extern/static/g include/iatomic.h diff --git a/pkgs/os-specific/linux/apparmor/2.9/default.nix b/pkgs/os-specific/linux/apparmor/2.9/default.nix new file mode 100644 index 000000000000..5e8ccc756918 --- /dev/null +++ b/pkgs/os-specific/linux/apparmor/2.9/default.nix @@ -0,0 +1,183 @@ +{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, perl, which +, glibc, flex, bison, python27, swig, dbus, pam +}: + +let + apparmor-series = "2.9"; + apparmor-patchver = "2"; + apparmor-version = "${apparmor-series}.${apparmor-patchver}"; + + apparmor-meta = component: with stdenv.lib; { + homepage = http://apparmor.net/; + description = "Linux application security system - ${component}"; + license = licenses.gpl2; + maintainers = with maintainers; [ phreedom thoughtpolice joachifm ]; + platforms = platforms.linux; + }; + + apparmor-sources = fetchurl { + url = "https://launchpad.net/apparmor/${apparmor-series}/${apparmor-version}/+download/apparmor-${apparmor-version}.tar.gz"; + sha256 = "1mayly7d7w959fya7z8q6kab2x3jcwhqhkpx36jsvpjhxkhmc4fh"; + }; + + prePatchCommon = '' + substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man" + substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html" + substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${glibc.dev}/include/linux/capability.h" + substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man" + ''; + + libapparmor = stdenv.mkDerivation { + name = "libapparmor-${apparmor-version}"; + src = apparmor-sources; + + buildInputs = [ + autoconf + automake + bison + flex + dbus # requires patch to dbus ... + glibc + libtool + perl + pkgconfig + python27 + swig + which + ]; + + prePatch = prePatchCommon + '' + substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${glibc.dev}/include/netinet/in.h" + substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${glibc.dev}/include/netinet/in.h" + ''; + + buildPhase = '' + cd ./libraries/libapparmor + ./autogen.sh + ./configure --prefix="$out" --with-python --with-perl + make + ''; + + installPhase = '' + make install + ''; + + meta = apparmor-meta "library"; + }; + + apparmor-utils = stdenv.mkDerivation { + name = "apparmor-utils-${apparmor-version}"; + src = apparmor-sources; + + buildInputs = [ + python27 + libapparmor + which + ]; + + prePatch = prePatchCommon; + + buildPhase = '' + cd ./utils + make LANGS="" + ''; + + installPhase = '' + make install LANGS="" DESTDIR="$out" BINDIR="$out/bin" VIM_INSTALL_PATH="$out/share" PYPREFIX="" + ''; + + meta = apparmor-meta "user-land utilities"; + }; + + apparmor-parser = stdenv.mkDerivation { + name = "apparmor-parser-${apparmor-version}"; + src = apparmor-sources; + + buildInputs = [ + libapparmor + bison + flex + which + ]; + + prePatch = prePatchCommon + '' + substituteInPlace ./parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison" + substituteInPlace ./parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex" + substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc.dev}/include/linux/capability.h" + ## techdoc.pdf still doesn't build ... + substituteInPlace ./parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages" + ''; + + buildPhase = '' + cd ./parser + make LANGS="" USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include + ''; + + installPhase = '' + make install LANGS="" USE_SYSTEM=1 INCLUDEDIR=${libapparmor}/include DESTDIR="$out" DISTRO="unknown" + ''; + + meta = apparmor-meta "rule parser"; + }; + + apparmor-pam = stdenv.mkDerivation { + name = "apparmor-pam-${apparmor-version}"; + src = apparmor-sources; + + buildInputs = [ + libapparmor + pam + pkgconfig + which + ]; + + buildPhase = '' + cd ./changehat/pam_apparmor + make USE_SYSTEM=1 + ''; + + installPhase = '' + make install DESTDIR="$out" + ''; + + meta = apparmor-meta "PAM service"; + }; + + apparmor-profiles = stdenv.mkDerivation { + name = "apparmor-profiles-${apparmor-version}"; + src = apparmor-sources; + + buildInputs = [ which ]; + + buildPhase = '' + cd ./profiles + make + ''; + + installPhase = '' + make install DESTDIR="$out" EXTRAS_DEST="$out/share/apparmor/extra-profiles" + ''; + + meta = apparmor-meta "profiles"; + }; + + apparmor-kernel-patches = stdenv.mkDerivation { + name = "apparmor-kernel-patches-${apparmor-version}"; + src = apparmor-sources; + + phases = ''unpackPhase installPhase''; + + installPhase = '' + mkdir "$out" + cp -R ./kernel-patches "$out" + ''; + + meta = apparmor-meta "kernel patches"; + }; + +in + +{ + inherit libapparmor apparmor-utils apparmor-parser apparmor-pam + apparmor-profiles apparmor-kernel-patches; +} diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 64c6f66575b6..49fdbab24caa 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -22,7 +22,7 @@ let prePatchCommon = '' substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man" substituteInPlace ./common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html" - substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h" + substituteInPlace ./common/Make.rules --replace "/usr/include/linux/capability.h" "${glibc.dev}/include/linux/capability.h" substituteInPlace ./common/Make.rules --replace "/usr/share/man" "share/man" ''; @@ -49,8 +49,8 @@ let dontDisableStatic = true; prePatch = prePatchCommon + '' - substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h" - substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${glibc}/include/netinet/in.h" + substituteInPlace ./libraries/libapparmor/src/Makefile.am --replace "/usr/include/netinet/in.h" "${glibc.dev}/include/netinet/in.h" + substituteInPlace ./libraries/libapparmor/src/Makefile.in --replace "/usr/include/netinet/in.h" "${glibc.dev}/include/netinet/in.h" ''; postPatch = "cd ./libraries/libapparmor"; @@ -104,7 +104,7 @@ let prePatch = prePatchCommon + '' substituteInPlace ./parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison" substituteInPlace ./parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex" - substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h" + substituteInPlace ./parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc.dev}/include/linux/capability.h" ## techdoc.pdf still doesn't build ... substituteInPlace ./parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages" ''; diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix index 377297feaf75..78903da1f1a1 100644 --- a/pkgs/os-specific/linux/ati-drivers/default.nix +++ b/pkgs/os-specific/linux/ati-drivers/default.nix @@ -85,15 +85,17 @@ stdenv.mkDerivation { inherit glibc /* glibc only used for setting interpreter */; + # outputs TODO: probably many fixes are needed; + # this in particular would be much better by lib.makeLibraryPath LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":" - [ "${xorg.libXrandr}/lib/" - "${xorg.libXrender}/lib/" - "${xorg.libXext}/lib/" - "${xorg.libX11}/lib/" - "${xorg.libXinerama}/lib/" - "${xorg.libSM}/lib/" - "${xorg.libICE}/lib/" - "${stdenv.cc.cc}/lib/" + [ "${xorg.libXrandr.out}/lib/" + "${xorg.libXrender.out}/lib/" + "${xorg.libXext.out}/lib/" + "${xorg.libX11.out}/lib/" + "${xorg.libXinerama.out}/lib/" + "${xorg.libSM.out}/lib/" + "${xorg.libICE.out}/lib/" + "${stdenv.cc.cc.out}/lib/" ]; # without this some applications like blender don't start, but they start diff --git a/pkgs/os-specific/linux/bluez/bluez5.nix b/pkgs/os-specific/linux/bluez/bluez5.nix index 2b73dc798c3f..9750a2a76499 100644 --- a/pkgs/os-specific/linux/bluez/bluez5.nix +++ b/pkgs/os-specific/linux/bluez/bluez5.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { [ pythonDBus pygobject pygobject3 recursivePthLoader ]; buildInputs = - [ pkgconfig dbus.libs glib alsaLib python pythonPackages.wrapPython + [ pkgconfig dbus glib alsaLib python pythonPackages.wrapPython readline libsndfile udev libical # Disables GStreamer; not clear what it gains us other than a # zillion extra dependencies. diff --git a/pkgs/os-specific/linux/bluez/bluez5_28.nix b/pkgs/os-specific/linux/bluez/bluez5_28.nix index 80adc0fd56b8..68db9345bd0e 100644 --- a/pkgs/os-specific/linux/bluez/bluez5_28.nix +++ b/pkgs/os-specific/linux/bluez/bluez5_28.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { [ pythonDBus pygobject pygobject3 recursivePthLoader ]; buildInputs = - [ pkgconfig dbus.libs glib alsaLib python pythonPackages.wrapPython + [ pkgconfig dbus glib alsaLib python pythonPackages.wrapPython readline libsndfile udev libical # Disables GStreamer; not clear what it gains us other than a # zillion extra dependencies. diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix index 23e5171d1780..4f30bc19caf8 100644 --- a/pkgs/os-specific/linux/bluez/default.nix +++ b/pkgs/os-specific/linux/bluez/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { }; buildInputs = - [ pkgconfig dbus.libs glib libusb alsaLib python makeWrapper + [ pkgconfig dbus glib libusb alsaLib python makeWrapper readline libsndfile # Disables GStreamer; not clear what it gains us other than a # zillion extra dependencies. diff --git a/pkgs/os-specific/linux/checksec/default.nix b/pkgs/os-specific/linux/checksec/default.nix index b423dc3a0862..60468538be24 100644 --- a/pkgs/os-specific/linux/checksec/default.nix +++ b/pkgs/os-specific/linux/checksec/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { cp checksec.sh $out/bin/checksec chmod +x $out/bin/checksec substituteInPlace $out/bin/checksec --replace /bin/bash ${stdenv.shell} - substituteInPlace $out/bin/checksec --replace /lib/libc.so.6 ${glibc}/lib/libc.so.6 + substituteInPlace $out/bin/checksec --replace /lib/libc.so.6 ${glibc.out}/lib/libc.so.6 substituteInPlace $out/bin/checksec --replace find ${findutils}/bin/find substituteInPlace $out/bin/checksec --replace "file $" "${file}/bin/file $" substituteInPlace $out/bin/checksec --replace "xargs file" "xargs ${file}/bin/file" diff --git a/pkgs/os-specific/linux/drbd/default.nix b/pkgs/os-specific/linux/drbd/default.nix index d90d6faac396..60615fb1e5be 100644 --- a/pkgs/os-specific/linux/drbd/default.nix +++ b/pkgs/os-specific/linux/drbd/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, flex, udev, perl }: +{ stdenv, fetchurl, flex, systemd, perl }: assert stdenv.isLinux; @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { preConfigure = '' - export PATH=${udev}/sbin:$PATH + export PATH=${systemd.udev.bin}/sbin:$PATH substituteInPlace user/Makefile.in --replace /sbin/ $out/sbin/ substituteInPlace user/legacy/Makefile.in \ --replace /sbin/ $out/sbin/ \ diff --git a/pkgs/os-specific/linux/fusionio/util.nix b/pkgs/os-specific/linux/fusionio/util.nix index e2f8d423a61d..e77d596dc6f8 100644 --- a/pkgs/os-specific/linux/fusionio/util.nix +++ b/pkgs/os-specific/linux/fusionio/util.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { cp -r $TMPDIR/{etc,usr/{bin,lib,share}} $out for BIN in $(find $out/bin -type f); do echo Patching $BIN - patchelf --set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" --set-rpath "${glibc}/lib:${gcc.cc}/lib:${libuuid}/lib:$out/lib" $BIN + patchelf --set-interpreter "${glibc.out}/lib/ld-linux-x86-64.so.2" --set-rpath "${glibc.out}/lib:${gcc.cc}/lib:${libuuid}/lib:$out/lib" $BIN # Test our binary to see if it was correctly patched set +e diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index bb2915958f7c..fddaa84a8240 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { # Fix the path to gzip/bzip2. substituteInPlace src/libkeymap/findfile.c \ --replace gzip ${gzip}/bin/gzip \ - --replace bzip2 ${bzip2}/bin/bzip2 \ + --replace bzip2 ${bzip2.bin}/bin/bzip2 \ # We get a warning in armv5tel-linux and the fuloong2f, so we # disable -Werror in it. diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 238b7ecd242c..cc98430a843f 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -74,7 +74,7 @@ let installsFirmware = (config.isEnabled "FW_LOADER") && (isModular || (config.isDisabled "FIRMWARE_IN_KERNEL")); - in (optionalAttrs isModular { outputs = [ "out" "dev" ]; }) // { + in (optionalAttrs isModular { outputs = [ "out" "dev" ]; propagatedBuildOutputs = ""; }) // { passthru = { inherit version modDirVersion config kernelPatches configfile; }; diff --git a/pkgs/os-specific/linux/klibc/shrunk.nix b/pkgs/os-specific/linux/klibc/shrunk.nix index 066b4fcb4e06..2ce833d104fd 100644 --- a/pkgs/os-specific/linux/klibc/shrunk.nix +++ b/pkgs/os-specific/linux/klibc/shrunk.nix @@ -8,10 +8,10 @@ stdenv.mkDerivation { name = "${klibc.name}"; buildCommand = '' mkdir -p $out/lib - cp -prd ${klibc}/lib/klibc/bin $out/ - cp -p ${klibc}/lib/*.so $out/lib/ + cp -prd ${klibc.out}/lib/klibc/bin $out/ + cp -p ${klibc.out}/lib/*.so $out/lib/ chmod +w $out/* - old=$(echo ${klibc}/lib/klibc-*.so) + old=$(echo ${klibc.out}/lib/klibc-*.so) new=$(echo $out/lib/klibc-*.so) for i in $out/bin/*; do echo $i diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index 8157270d67d7..c8484babcdf8 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -3,12 +3,14 @@ stdenv.mkDerivation rec { name = "libcap-${version}"; version = "2.24"; - + src = fetchurl { url = "mirror://kernel/linux/libs/security/linux-privs/libcap2/${name}.tar.xz"; sha256 = "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"; }; - + + outputs = [ "dev" "out" ]; + nativeBuildInputs = [ perl ]; propagatedBuildInputs = [ attr ]; @@ -16,14 +18,11 @@ stdenv.mkDerivation rec { makeFlags = "lib=lib prefix=$(out)"; - passthru = { - postinst = n : '' - mkdir -p $out/share/doc/${n} - cp ../License $out/share/doc/${n}/License - ''; - }; - - postInstall = passthru.postinst name; + postInstall = '' + rm "$out"/lib/*.a + mkdir -p "$dev/share/doc/${name}" + cp ../License "$dev/share/doc/${name}/License" + ''; meta = { description = "Library for working with POSIX capabilities"; diff --git a/pkgs/os-specific/linux/libcap/man.nix b/pkgs/os-specific/linux/libcap/man.nix index 9aac3c4e1f5a..eeb780f095bd 100644 --- a/pkgs/os-specific/linux/libcap/man.nix +++ b/pkgs/os-specific/linux/libcap/man.nix @@ -10,6 +10,4 @@ stdenv.mkDerivation rec { makeFlags = "MANDIR=$(out)/share/man"; preConfigure = "cd doc"; - - postInstall = libcap.postinst name; } diff --git a/pkgs/os-specific/linux/libcap/pam.nix b/pkgs/os-specific/linux/libcap/pam.nix index b78f32dccbb4..3dd7cd947af2 100644 --- a/pkgs/os-specific/linux/libcap/pam.nix +++ b/pkgs/os-specific/linux/libcap/pam.nix @@ -12,6 +12,4 @@ stdenv.mkDerivation rec { preConfigure = "cd pam_cap"; makeFlags = "${libcap.makeFlags} PAM_CAP=yes"; - - postInstall = libcap.postinst name; } diff --git a/pkgs/os-specific/linux/libcap/progs.nix b/pkgs/os-specific/linux/libcap/progs.nix index ae4446c82e6c..e3871f15f885 100644 --- a/pkgs/os-specific/linux/libcap/progs.nix +++ b/pkgs/os-specific/linux/libcap/progs.nix @@ -21,5 +21,8 @@ stdenv.mkDerivation rec { installFlags = "RAISE_SETFCAP=no"; - postInstall = libcap.postinst name; + postInstall = '' + mkdir -p "$out/share/doc/${name}" + cp ../License "$out/share/doc/${name}/" + ''; } diff --git a/pkgs/os-specific/linux/libnl/default.nix b/pkgs/os-specific/linux/libnl/default.nix index afd9695420e3..1e1ed0a6112c 100644 --- a/pkgs/os-specific/linux/libnl/default.nix +++ b/pkgs/os-specific/linux/libnl/default.nix @@ -11,6 +11,8 @@ stdenv.mkDerivation { owner = "thom311"; }; + outputs = [ "dev" "bin" "out" "man" ]; + nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ]; meta = { diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix index 351c2f609814..9147cb813714 100644 --- a/pkgs/os-specific/linux/lvm2/default.nix +++ b/pkgs/os-specific/linux/lvm2/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils, enable_dmeventd ? false }: +{ stdenv, fetchurl, pkgconfig, systemd, libudev, utillinux, coreutils, enable_dmeventd ? false }: let version = "2.02.140"; @@ -22,7 +22,7 @@ stdenv.mkDerivation { ] ++ stdenv.lib.optional enable_dmeventd " --enable-dmeventd"; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ udev ]; + buildInputs = [ libudev ]; preConfigure = '' @@ -30,7 +30,7 @@ stdenv.mkDerivation { --replace /usr/bin/tr ${coreutils}/bin/tr substituteInPlace scripts/lvm2_activation_generator_systemd_red_hat.c \ --replace /usr/sbin/lvm $out/sbin/lvm \ - --replace /usr/bin/udevadm ${udev}/bin/udevadm + --replace /usr/bin/udevadm ${systemd.udev.bin}/bin/udevadm sed -i /DEFAULT_SYS_DIR/d Makefile.in sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index 465dc58199ed..3fe9d462412c 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { # This is to avoid self-references, which causes the initrd to explode # in size and in turn prevents mdraid systems from booting. - allowedReferences = [ stdenv.glibc ]; + allowedReferences = [ stdenv.glibc.out ]; patches = [ ./no-self-references.patch ]; diff --git a/pkgs/os-specific/linux/module-init-tools/default.nix b/pkgs/os-specific/linux/module-init-tools/default.nix index 1302d7b1fef0..ded6e77e43b4 100644 --- a/pkgs/os-specific/linux/module-init-tools/default.nix +++ b/pkgs/os-specific/linux/module-init-tools/default.nix @@ -1,5 +1,7 @@ { stdenv, fetchurl, docbook2x, docbook_sgml_dtd_41 }: +assert (stdenv.lib.elem stdenv.system stdenv.lib.platforms.linux); + stdenv.mkDerivation { name = "module-init-tools-3.16"; @@ -20,6 +22,8 @@ stdenv.mkDerivation { }) ]; + buildInputs = [ stdenv.glibc.dev stdenv.glibc.static ]; + SGML_CATALOG_FILES = "${docbook_sgml_dtd_41}/sgml/dtd/docbook-4.1/docbook.cat"; patches = [ ./module-dir.patch ./docbook2man.patch ]; @@ -29,5 +33,6 @@ stdenv.mkDerivation { meta = { homepage = http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/; description = "Tools for loading and managing Linux kernel modules"; + platforms = stdenv.lib.platforms.linux; }; } diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index 0dde3bca4e47..504d3790d868 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { "--with-statedir=/var/lib/nfs" "--with-tirpcinclude=${libtirpc}/include/tirpc" ] - ++ stdenv.lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc}/bin/rpcgen"; + ++ stdenv.lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc.bin}/bin/rpcgen"; patchPhase = '' diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index f7cadd469d70..d84c6224eebe 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -9,10 +9,14 @@ stdenv.mkDerivation rec { sha256 = "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"; }; + outputs = [ "out" "doc" "man" /* "modules" */ ]; + nativeBuildInputs = [ flex ]; buildInputs = [ cracklib ]; + enableParallelBuilding = true; + crossAttrs = { propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ]; preConfigure = preConfigure + '' @@ -31,7 +35,14 @@ stdenv.mkDerivation rec { postInstall = '' mv -v $out/sbin/unix_chkpwd{,.orig} ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd - ''; + ''; /* + rm -rf $out/etc + mkdir -p $modules/lib + mv $out/lib/security $modules/lib/ + '';*/ + # don't move modules, because libpam needs to (be able to) find them, + # which is done by dlopening $out/lib/security/pam_foo.so + # $out/etc was also missed: pam_env(login:session): Unable to open config file preConfigure = '' configureFlags="$configureFlags --includedir=$out/include/security" diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index f928dc8e657c..321e94e3aaf4 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { preBuild = assert glibc != null; '' - substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc}/sbin/nscd + substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd ''; postInstall = diff --git a/pkgs/os-specific/linux/sysstat/default.nix b/pkgs/os-specific/linux/sysstat/default.nix index 6544210b2067..16431c465c16 100644 --- a/pkgs/os-specific/linux/sysstat/default.nix +++ b/pkgs/os-specific/linux/sysstat/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { preConfigure = '' export PATH_CP=$(type -tp cp) export PATH_CHKCONFIG=/no-such-program - export BZIP=${bzip2}/bin/bzip2 + export BZIP=${bzip2.bin}/bin/bzip2 export SYSTEMCTL=systemctl ''; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index cb1521a4005e..0f066e380c1b 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchFromGitHub, pkgconfig, intltool, gperf, libcap, dbus, kmod -, xz, pam, acl, cryptsetup, libuuid, m4, utillinuxMinimal +{ stdenv, fetchFromGitHub, pkgconfig, intltool, gperf, libcap, kmod +, zlib, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, libffi , glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libapparmor, audit, lz4 , kexectools, libmicrohttpd, linuxHeaders, libseccomp , autoreconfHook, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45 @@ -19,18 +19,27 @@ stdenv.mkDerivation rec { sha256 = "1q0pyrljmq73qcan9rfqsiw66l1g159m5in5qgb8zwlwhl928670"; }; - outputs = [ "out" "man" "doc" ]; + patches = [ ./hwdb-location.diff ]; + + /* gave up for now! + outputs = [ "out" "libudev" "doc" ]; # maybe: "dev" + # note: there are many references to ${systemd}/... + outputDev = "out"; + propagatedBuildOutputs = "libudev"; + */ + outputs = [ "out" "man" ]; buildInputs = [ linuxHeaders pkgconfig intltool gperf libcap kmod xz pam acl /* cryptsetup */ libuuid m4 glib libxslt libgcrypt libgpgerror - libmicrohttpd kexectools libseccomp audit lz4 libapparmor + libmicrohttpd kexectools libseccomp libffi audit lz4 libapparmor /* FIXME: we may be able to prevent the following dependencies by generating an autoconf'd tarball, but that's probably not worth it. */ autoreconfHook gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45 ]; + configureFlags = [ "--localstatedir=/var" "--sysconfdir=/etc" @@ -74,14 +83,15 @@ stdenv.mkDerivation rec { for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.in src/journal/cat.c src/core/shutdown.c src/nspawn/nspawn.c src/shared/generator.c; do test -e $i substituteInPlace $i \ - --replace /usr/bin/getent ${stdenv.glibc}/bin/getent \ - --replace /bin/mount ${utillinuxMinimal}/bin/mount \ - --replace /bin/umount ${utillinuxMinimal}/bin/umount \ - --replace /sbin/swapon ${utillinuxMinimal}/sbin/swapon \ - --replace /sbin/swapoff ${utillinuxMinimal}/sbin/swapoff \ + --replace /usr/bin/getent ${stdenv.glibc.bin}/bin/getent \ + --replace /bin/mount ${utillinux.bin}/bin/mount \ + --replace /bin/umount ${utillinux.bin}/bin/umount \ + --replace /sbin/swapon ${utillinux.bin}/sbin/swapon \ + --replace /sbin/swapoff ${utillinux.bin}/sbin/swapoff \ + --replace /sbin/fsck ${utillinux.bin}/sbin/fsck \ --replace /bin/echo ${coreutils}/bin/echo \ --replace /bin/cat ${coreutils}/bin/cat \ - --replace /sbin/sulogin ${utillinuxMinimal}/sbin/sulogin \ + --replace /sbin/sulogin ${utillinux.bin}/sbin/sulogin \ --replace /usr/lib/systemd/systemd-fsck $out/lib/systemd/systemd-fsck done @@ -89,12 +99,24 @@ stdenv.mkDerivation rec { --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/ configureFlagsArray+=("--with-ntp-servers=0.nixos.pool.ntp.org 1.nixos.pool.ntp.org 2.nixos.pool.ntp.org 3.nixos.pool.ntp.org") + + #export NIX_CFLAGS_LINK+=" -Wl,-rpath,$libudev/lib" ''; + /* + makeFlags = [ + "udevlibexecdir=$(libudev)/lib/udev" + # udev rules refer to $out, and anything but libs should probably go to $out + "udevrulesdir=$(out)/lib/udev/rules.d" + "udevhwdbdir=$(out)/lib/udev/hwdb.d" + ]; + */ + + PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python NIX_CFLAGS_COMPILE = - [ # Can't say ${polkit}/bin/pkttyagent here because that would + [ # Can't say ${polkit.bin}/bin/pkttyagent here because that would # lead to a cyclic dependency. "-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\"" "-fno-stack-protector" @@ -147,8 +169,30 @@ stdenv.mkDerivation rec { # "kernel-install" shouldn't be used on NixOS. find $out -name "*kernel-install*" -exec rm {} \; ''; # */ + /* + # Move lib(g)udev to a separate output. TODO: maybe split them up + # to avoid libudev pulling glib + mkdir -p "$libudev/lib" + mv "$out"/lib/lib{,g}udev* "$libudev/lib/" + + for i in "$libudev"/lib/*.la; do + substituteInPlace $i --replace "$out" "$libudev" + done + for i in "$out"/lib/pkgconfig/{libudev,gudev-1.0}.pc; do + substituteInPlace $i --replace "libdir=$out" "libdir=$libudev" + done + */ enableParallelBuilding = true; + /* + # some libs fail to link to liblzma and/or libffi + postFixup = let extraLibs = stdenv.lib.makeLibraryPath [ xz.out libffi.out zlib.out ]; + in '' + for f in "$out"/lib/*.so.0.*; do + patchelf --set-rpath `patchelf --print-rpath "$f"`':${extraLibs}' "$f" + done + ''; + */ # The interface version prevents NixOS from switching to an # incompatible systemd at runtime. (Switching across reboots is @@ -165,3 +209,4 @@ stdenv.mkDerivation rec { maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.simons ]; }; } + diff --git a/pkgs/os-specific/linux/systemd/hwdb-location.diff b/pkgs/os-specific/linux/systemd/hwdb-location.diff new file mode 100644 index 000000000000..31e7a027f50d --- /dev/null +++ b/pkgs/os-specific/linux/systemd/hwdb-location.diff @@ -0,0 +1,19 @@ +diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c +index 06c9831..e74825c 100644 +--- a/src/libsystemd/sd-hwdb/sd-hwdb.c ++++ b/src/libsystemd/sd-hwdb/sd-hwdb.c +@@ -268,13 +268,8 @@ static int trie_search_f(sd_hwdb *hwdb, const char *search) { + } + + static const char hwdb_bin_paths[] = +- "/etc/systemd/hwdb/hwdb.bin\0" + "/etc/udev/hwdb.bin\0" +- "/usr/lib/systemd/hwdb/hwdb.bin\0" +-#ifdef HAVE_SPLIT_USR +- "/lib/systemd/hwdb/hwdb.bin\0" +-#endif +- UDEVLIBEXECDIR "/hwdb.bin\0"; ++ ; + + _public_ int sd_hwdb_new(sd_hwdb **ret) { + _cleanup_hwdb_unref_ sd_hwdb *hwdb = NULL; diff --git a/pkgs/os-specific/linux/systemd/libudev.nix b/pkgs/os-specific/linux/systemd/libudev.nix new file mode 100644 index 000000000000..0fe45aee9164 --- /dev/null +++ b/pkgs/os-specific/linux/systemd/libudev.nix @@ -0,0 +1,19 @@ +{ stdenv, systemd }: + +stdenv.mkDerivation { + name = "libudev-${systemd.version}"; + + unpackPhase = ":"; + outputs = [ "dev" "out" ]; + installPhase = '' + mkdir -p "$out/lib" "$dev/lib/pkgconfig" "$dev/include" + cp -P "${systemd}"/lib/libudev.* "$out/lib/" + cp -P "${systemd}"/lib/pkgconfig/libudev.pc "$dev/lib/pkgconfig/" + cp -P "${systemd}"/include/libudev.h "$dev/include/" + + substituteInPlace "$dev"/lib/pkgconfig/*.pc \ + --replace "${systemd}" "$out" + sed "/^includedir=/cincludedir=$dev/include" -i "$dev"/lib/pkgconfig/*.pc + ''; +} + diff --git a/pkgs/os-specific/linux/udev/145.nix b/pkgs/os-specific/linux/udev/145.nix new file mode 100644 index 000000000000..6dd551e1ce13 --- /dev/null +++ b/pkgs/os-specific/linux/udev/145.nix @@ -0,0 +1,53 @@ +{ stdenv, fetchurl, gperf, pkgconfig, glib, acl, libusb, usbutils, pciutils }: + +assert stdenv ? glibc; + +stdenv.mkDerivation rec { + name = "udev-145"; + + src = fetchurl { + url = "mirror://kernel/linux/utils/kernel/hotplug/${name}.tar.bz2"; + sha256 = "1zmibp6n7d582fqx8vmg9vb2a1435hghfpz36056bc25ccwf7yiv"; + }; + + buildInputs = [gperf pkgconfig glib acl libusb usbutils]; + + configureFlags = "--with-pci-ids-path=${pciutils}/share/pci.ids"; + + preConfigure = + '' + substituteInPlace extras/keymap/Makefile.in \ + --replace /usr/include ${stdenv.glibc.dev}/include + ''; + + postInstall = + '' + # Install some rules that really should be installed by default. + for i in 40-alsa.rules 40-infiniband.rules 40-isdn.rules 40-pilot-links.rules 64-device-mapper.rules 64-md-raid.rules; do + cp rules/packages/$i $out/libexec/rules.d/ + done + + # The path to rule_generator.functions in write_cd_rules and + # write_net_rules is broken. Also, don't store the mutable + # persistant rules in /etc/udev/rules.d but in + # /var/lib/udev/rules.d. + for i in $out/libexec/write_cd_rules $out/libexec/write_net_rules; do + substituteInPlace $i \ + --replace /lib/udev $out/libexec \ + --replace /etc/udev/rules.d /var/lib/udev/rules.d + done + + # Don't set PATH to /bin:/sbin; won't work in NixOS. + substituteInPlace $out/libexec/rule_generator.functions \ + --replace 'PATH=' '#PATH=' + + # Don't hardcore the FIRMWARE_DIRS variable; obtain it from the + # environment of the caller. + sed '3,4d' -i $out/libexec/firmware.sh + ''; + + meta = { + homepage = http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html; + description = "Udev manages the /dev filesystem"; + }; +} diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index a84740b1a30b..263fa4490dc8 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -1,6 +1,4 @@ -{ stdenv, fetchurl, zlib, ncurses ? null, perl ? null, pam, systemd ? null -, pkgconfig -}: +{ stdenv, fetchurl, pkgconfig, zlib, ncurses ? null, perl ? null, pam, systemd }: stdenv.mkDerivation rec { name = "util-linux-2.27.1"; @@ -10,12 +8,15 @@ stdenv.mkDerivation rec { sha256 = "1452hz5zx56a3mad8yrg5wb0vy5zi19mpjp6zx1yr6p9xp6qz08a"; }; - outputs = [ "out" "man" ]; - patches = [ ./rtcwake-search-PATH-for-shutdown.patch ]; + outputs = [ "bin" "out" "man" ]; # TODO: $bin is kept the first for now + # due to lots of ${utillinux}/bin occurences and headers being rather small + outputDev = "bin"; + + #FIXME: make it also work on non-nixos? postPatch = '' # Substituting store paths would create a circular dependency on systemd @@ -46,6 +47,9 @@ stdenv.mkDerivation rec { ''} ''; + makeFlags = "usrbin_execdir=$(bin)/bin usrsbin_execdir=$(bin)/sbin"; + + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ zlib pam ] ++ stdenv.lib.optional (ncurses != null) ncurses @@ -53,15 +57,16 @@ stdenv.mkDerivation rec { ++ stdenv.lib.optional (perl != null) perl; postInstall = '' - rm $out/bin/su # su should be supplied by the su package (shadow) + rm "$bin/bin/su" # su should be supplied by the su package (shadow) ''; enableParallelBuilding = true; - meta = { + meta = with stdenv.lib; { homepage = http://www.kernel.org/pub/linux/utils/util-linux/; description = "A set of system utilities for Linux"; - platforms = stdenv.lib.platforms.linux; + license = licenses.gpl2; # also contains parts under more permissive licenses + platforms = platforms.linux; priority = 6; # lower priority than coreutils ("kill") and shadow ("login" etc.) packages }; } |