From a3eb56c4fc73da93d42c9298cc94aafffca0bd37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 28 May 2019 00:34:01 +0200 Subject: Remove private specificities from pure-ftpd package and lib --- lib/default.nix | 20 +------------------- pkgs/pure-ftpd/default.nix | 9 +++++---- scripts/make-nur | 16 ++++++++-------- 3 files changed, 14 insertions(+), 31 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 1baee1f5..6b3dfdf4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -61,22 +61,4 @@ rec { makeWrapper "$f" "$out" ${toString args} ''; - # This adds header colors to the builds, but it rebuilds the whole - # world from scratch, so only use it to debug! - # add it as postHook in derivations - immaePostHook = '' - header() { - echo -ne "\033[1;36m" - echo -n "$1" - echo -e "\033[0m" - } - - echoCmd() { - printf "\033[1;34m%s:\033[0m" "$1" - shift - printf ' %q' "$@" - echo - } - ''; - -} // (if builtins.pathExists ./lib/private then import ./lib/private else {}) +} // (if builtins.pathExists ./private then callPackage ./private {} else {}) diff --git a/pkgs/pure-ftpd/default.nix b/pkgs/pure-ftpd/default.nix index 37ce6952..32a7a91e 100644 --- a/pkgs/pure-ftpd/default.nix +++ b/pkgs/pure-ftpd/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, openssl, postgresql, openldap }: +{ ldapFtpId ? null +, stdenv, fetchurl, openssl, postgresql, openldap }: stdenv.mkDerivation rec { name = "pure-ftpd-1.0.47"; @@ -8,9 +9,9 @@ stdenv.mkDerivation rec { sha256 = "1b97ixva8m10vln8xrfwwwzi344bkgxqji26d0nrm1yzylbc6h27"; }; - preConfigure = '' - sed -i -e "s#FTPuid#immaeFtpUid#" src/log_ldap.h - sed -i -e "s#FTPgid#immaeFtpGid#" src/log_ldap.h + preConfigure = stdenv.lib.optionalString (!isNull ldapFtpId) '' + sed -i -e "s#FTPuid#${ldapFtpId}Uid#" src/log_ldap.h + sed -i -e "s#FTPgid#${ldapFtpId}Gid#" src/log_ldap.h ''; postConfigure = '' sed -i 's/define MAX_DATA_SIZE (40/define MAX_DATA_SIZE (70/' src/ftpd.h diff --git a/scripts/make-nur b/scripts/make-nur index 6766d95b..1fe5f7a0 100755 --- a/scripts/make-nur +++ b/scripts/make-nur @@ -17,14 +17,14 @@ first_commit="5145061e9b679ea1e5d2709d22d0ee53467fed15" git rebase --onto=$nur_root $first_commit master clean_folder=' - rm -rf config modules/private pkgs/private nixops - for bad in pkgs/crypto/cardano/default.nix; do - if [ -f $bad ]; then - rm -f $bad - cat > $bad <<-EOF - { runCommand, mylibs }: - runCommand "empty" { preferLocalBuild = true; } "mkdir -p \$out" -EOF + rm -rf config lib/private modules/private pkgs/private nixops + for broken in pkgs/crypto/cardano/default.nix; do + if [ -f $broken ]; then + rm -f $broken + cat > $broken <<-EOF + { runCommand, mylibs }: + runCommand "empty" { preferLocalBuild = true; } "mkdir -p \$out" + EOF fi done ' -- cgit v1.2.3