diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/filesystems')
154 files changed, 6406 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/filesystems/9pfs/default.nix b/nixpkgs/pkgs/tools/filesystems/9pfs/default.nix new file mode 100644 index 000000000000..b9c5c55a8e47 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/9pfs/default.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, fuse }: + +stdenv.mkDerivation { + name = "9pfs-20150918"; + + src = fetchFromGitHub { + owner = "mischief"; + repo = "9pfs"; + rev = "7f4ca4cd750d650c1215b92ac3cc2a28041960e4"; + sha256 = "007s2idsn6bspmfxv1qabj39ggkgvn6gwdbhczwn04lb4c6gh3xc"; + }; + + preConfigure = + '' + substituteInPlace Makefile --replace '-g bin' "" + installFlagsArray+=(BIN=$out/bin MAN=$out/share/man/man1) + mkdir -p $out/bin $out/share/man/man1 + ''; + + buildInputs = [ fuse ]; + + enableParallelBuilding = true; + + meta = { + homepage = https://github.com/mischief/9pfs; + description = "FUSE-based client of the 9P network filesystem protocol"; + maintainers = [ lib.maintainers.eelco ]; + platforms = lib.platforms.linux; + license = with lib.licenses; [ lpl-102 bsd2 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/aefs/default.nix b/nixpkgs/pkgs/tools/filesystems/aefs/default.nix new file mode 100644 index 000000000000..1be33e1299d2 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/aefs/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, fuse }: + +stdenv.mkDerivation rec { + name = "aefs-0.4pre259-8843b7c"; + + src = fetchurl { + url = "http://tarballs.nixos.org/${name}.tar.bz2"; + sha256 = "167hp58hmgdavg2mqn5dx1xgq24v08n8d6psf33jhbdabzx6a6zq"; + }; + + buildInputs = [ fuse ]; + + meta = with stdenv.lib; { + homepage = https://github.com/edolstra/aefs; + description = "A cryptographic filesystem implemented in userspace using FUSE"; + platforms = platforms.linux; + maintainers = [ maintainers.eelco ]; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix b/nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix new file mode 100644 index 000000000000..7f8a8c4f931f --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/afpfs-ng/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchFromGitHub, fuse, readline, libgcrypt, gmp }: + +stdenv.mkDerivation { + pname = "afpfs-ng"; + version = "0.8.2"; + + src = fetchFromGitHub { + owner = "simonvetter"; + repo = "afpfs-ng"; + rev = "f6e24eb73c9283732c3b5d9cb101a1e2e4fade3e"; + sha256 = "125jx1rsqkiifcffyjb05b2s36rllckdgjaf1bay15k9gzhwwldz"; + }; + + buildInputs = [ fuse readline libgcrypt gmp ]; + + meta = with stdenv.lib; { + homepage = https://github.com/simonvetter/afpfs-ng; + description = "A client implementation of the Apple Filing Protocol"; + license = licenses.gpl2; + maintainers = with maintainers; [ rnhmjoj ]; + platforms = platforms.linux; + }; + +} diff --git a/nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix b/nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix new file mode 100644 index 000000000000..001e644b7e7d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/android-file-transfer/default.nix @@ -0,0 +1,24 @@ +{ stdenv, mkDerivation, fetchFromGitHub, cmake, fuse, readline, pkgconfig, qtbase }: + +mkDerivation rec { + pname = "android-file-transfer"; + version = "3.9"; + + src = fetchFromGitHub { + owner = "whoozle"; + repo = "android-file-transfer-linux"; + rev = "v${version}"; + sha256 = "1pwayyd5xrmngfrmv2vwr8ns2wi199xkxf7dks8fl9zmlpizg3c3"; + }; + + nativeBuildInputs = [ cmake readline pkgconfig ]; + buildInputs = [ fuse qtbase ]; + + meta = with stdenv.lib; { + description = "Reliable MTP client with minimalistic UI"; + homepage = https://whoozle.github.io/android-file-transfer-linux/; + license = licenses.lgpl21; + maintainers = [ maintainers.xaverdh ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix b/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix new file mode 100644 index 000000000000..2c7b1c271569 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, fuse3, bzip2, zlib, attr, cmake }: + +stdenv.mkDerivation { + pname = "apfs-fuse-unstable"; + version = "2019-07-23"; + + src = fetchFromGitHub { + owner = "sgan81"; + repo = "apfs-fuse"; + rev = "309ecb030f38edac4c10fa741a004c5eb7a23e15"; + sha256 = "0wq6rlqi00m5dp5gbzy65i1plm40j6nsm7938zvfgx5laal4wzr2"; + fetchSubmodules = true; + }; + + buildInputs = [ fuse3 bzip2 zlib attr ]; + nativeBuildInputs = [ cmake ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/sgan81/apfs-fuse"; + description = "FUSE driver for APFS (Apple File System)"; + license = licenses.gpl2; + maintainers = with maintainers; [ ealasu ]; + platforms = platforms.linux; + }; + +} diff --git a/nixpkgs/pkgs/tools/filesystems/archivemount/default.nix b/nixpkgs/pkgs/tools/filesystems/archivemount/default.nix new file mode 100644 index 000000000000..18bde25267d3 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/archivemount/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl, pkgconfig, fuse, libarchive }: + +let + name = "archivemount-0.8.12"; +in +stdenv.mkDerivation { + inherit name; + + src = fetchurl { + url = "https://www.cybernoia.de/software/archivemount/${name}.tar.gz"; + sha256 = "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse libarchive ]; + + meta = { + description = "Gateway between FUSE and libarchive: allows mounting of cpio, .tar.gz, .tar.bz2 archives"; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/avfs/default.nix b/nixpkgs/pkgs/tools/filesystems/avfs/default.nix new file mode 100644 index 000000000000..b66d67fbc9f2 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/avfs/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, pkgconfig, fuse, xz }: + +stdenv.mkDerivation rec { + pname = "avfs"; + version = "1.1.1"; + src = fetchurl { + url = "mirror://sourceforge/avf/${version}/${pname}-${version}.tar.bz2"; + sha256 = "0fxzigpyi08ipqz30ihjcpqmmx8g7r1kqdqq1bnnznvnhrzyygn8"; + }; + + nativeBuildInputs = [ pkgconfig ]; + + buildInputs = [ fuse xz ]; + + configureFlags = [ + "--enable-library" + "--enable-fuse" + ]; + + meta = { + homepage = http://avf.sourceforge.net/; + description = "Virtual filesystem that allows browsing of compressed files"; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/bashmount/default.nix b/nixpkgs/pkgs/tools/filesystems/bashmount/default.nix new file mode 100644 index 000000000000..d449bf1266a0 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bashmount/default.nix @@ -0,0 +1,37 @@ +{stdenv, fetchFromGitHub}: + +stdenv.mkDerivation rec { + pname = "bashmount"; + version = "3.2.0"; + + src = fetchFromGitHub { + owner = "jamielinux"; + repo = "bashmount"; + rev = version; + sha256 = "0rki4s0jgz6vkywc6hcx9qa551r5bnjs7sw0rdh93k64l32kh644"; + }; + + installPhase = '' + mkdir -p $out/bin + cp bashmount $out/bin + + mkdir -p $out/etc + cp bashmount.conf $out/etc + + mkdir -p $out/share/man/man1 + gzip -c -9 bashmount.1 > bashmount.1.gz + cp bashmount.1.gz $out/share/man/man1 + + mkdir -p $out/share/doc/bashmount + cp COPYING $out/share/doc/bashmount + cp NEWS $out/share/doc/bashmount + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/jamielinux/bashmount; + description = "A menu-driven bash script for the management of removable media with udisks"; + maintainers = [ maintainers.koral ]; + license = licenses.gpl2; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch b/nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch new file mode 100644 index 000000000000..c6cf79785b73 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bcache-tools/bcache-udev-modern.patch @@ -0,0 +1,52 @@ +This patch does two things: +1) Drops probe-bcache, so now new util-linux detecting functionality is used. +2) Drops bcache-register, using kmod (built in udev) and moving registering device + into rule using 'sh'. +This reduces things that need to be present in initrd, replacing them with already +existing functionality and reducing overall initrd size. + +diff --git a/69-bcache.rules b/69-bcache.rules +index 5d28e70..6a52893 100644 +--- a/69-bcache.rules ++++ b/69-bcache.rules +@@ -10,15 +10,11 @@ KERNEL=="fd*|sr*", GOTO="bcache_end" + # It recognised bcache (util-linux 2.24+) + ENV{ID_FS_TYPE}=="bcache", GOTO="bcache_backing_found" + # It recognised something else; bail +-ENV{ID_FS_TYPE}=="?*", GOTO="bcache_backing_end" +- +-# Backing devices: scan, symlink, register +-IMPORT{program}="probe-bcache -o udev $tempnode" +-ENV{ID_FS_TYPE}!="bcache", GOTO="bcache_backing_end" +-ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ++GOTO="bcache_backing_end" + + LABEL="bcache_backing_found" +-RUN+="bcache-register $tempnode" ++RUN{builtin}+="kmod load bcache" ++RUN+="/bin/sh -c 'echo $tempnode > /sys/fs/bcache/register_quiet'" + LABEL="bcache_backing_end" + + # Cached devices: symlink +diff --git a/Makefile b/Makefile +index 3f8d87b..15638a7 100644 +--- a/Makefile ++++ b/Makefile +@@ -9,7 +9,7 @@ all: make-bcache probe-bcache bcache-super-show + + install: make-bcache probe-bcache bcache-super-show + $(INSTALL) -m0755 make-bcache bcache-super-show $(DESTDIR)${PREFIX}/sbin/ +- $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ ++# $(INSTALL) -m0755 probe-bcache bcache-register $(DESTDIR)$(UDEVLIBDIR)/ + $(INSTALL) -m0644 69-bcache.rules $(DESTDIR)$(UDEVLIBDIR)/rules.d/ + $(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/ + $(INSTALL) -D -m0755 initramfs/hook $(DESTDIR)/usr/share/initramfs-tools/hooks/bcache +diff --git a/bcache-register b/bcache-register +index 9b592bc..75b4faf 100755 +--- a/bcache-register ++++ b/bcache-register +@@ -1,4 +1,3 @@ + #!/bin/sh +-/sbin/modprobe -qba bcache + test -f /sys/fs/bcache/register_quiet && echo "$1" > /sys/fs/bcache/register_quiet + diff --git a/nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix new file mode 100644 index 000000000000..d3e790a3cf13 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bcache-tools/default.nix @@ -0,0 +1,57 @@ +{ stdenv, fetchurl, pkgconfig, utillinux, bash }: + +stdenv.mkDerivation rec { + pname = "bcache-tools"; + version = "1.0.7"; + + src = fetchurl { + name = "${pname}-${version}.tar.gz"; + url = "https://github.com/g2p/bcache-tools/archive/v${version}.tar.gz"; + sha256 = "1gbsh2qw0a7kgck6w0apydiy37nnz5xvdgipa0yqrfmghl86vmv4"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ utillinux ]; + + # * Remove broken install rules (they ignore $PREFIX) for stuff we don't need + # anyway (it's distro specific stuff). + # * Fixup absolute path to modprobe. + prePatch = '' + sed -e "/INSTALL.*initramfs\/hook/d" \ + -e "/INSTALL.*initcpio\/install/d" \ + -e "/INSTALL.*dracut\/module-setup.sh/d" \ + -i Makefile + ''; + + patches = [ + ./bcache-udev-modern.patch + ./fix-static.patch + ]; + + preBuild = '' + export makeFlags="$makeFlags PREFIX=\"$out\" UDEVLIBDIR=\"$out/lib/udev/\""; + sed -e "s|/bin/sh|${bash}/bin/sh|" -i *.rules + ''; + + preInstall = '' + mkdir -p "$out/sbin" "$out/lib/udev/rules.d" "$out/share/man/man8" + ''; + + meta = with stdenv.lib; { + description = "User-space tools required for bcache (Linux block layer cache)"; + longDescription = '' + Bcache is a Linux kernel block layer cache. It allows one or more fast + disk drives such as flash-based solid state drives (SSDs) to act as a + cache for one or more slower hard disk drives. + + This package contains the required user-space tools. + + User documentation is in Documentation/bcache.txt in the Linux kernel + tree. + ''; + homepage = https://bcache.evilpiepirate.org/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch b/nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch new file mode 100644 index 000000000000..e5dd2df5299d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bcache-tools/fix-static.patch @@ -0,0 +1,22 @@ +diff --git a/bcache.c b/bcache.c +index 8f37445..79806d8 100644 +--- a/bcache.c ++++ b/bcache.c +@@ -26,7 +26,7 @@ + * x^7 + x^4 + x + 1 + */ + +-static const uint64_t crc_table[256] = { ++const uint64_t crc_table[256] = { + 0x0000000000000000ULL, 0x42F0E1EBA9EA3693ULL, 0x85E1C3D753D46D26ULL, + 0xC711223CFA3E5BB5ULL, 0x493366450E42ECDFULL, 0x0BC387AEA7A8DA4CULL, + 0xCCD2A5925D9681F9ULL, 0x8E224479F47CB76AULL, 0x9266CC8A1C85D9BEULL, +@@ -115,7 +115,7 @@ static const uint64_t crc_table[256] = { + 0x9AFCE626CE85B507ULL + }; + +-inline uint64_t crc64(const void *_data, size_t len) ++uint64_t crc64(const void *_data, size_t len) + { + uint64_t crc = 0xFFFFFFFFFFFFFFFFULL; + const unsigned char *data = _data; diff --git a/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix new file mode 100644 index 000000000000..144ed0a38459 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bcachefs-tools/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchgit, pkgconfig, attr, libuuid, libscrypt, libsodium, keyutils +, liburcu, zlib, libaio, zstd, lz4 }: + +stdenv.mkDerivation { + pname = "bcachefs-tools"; + version = "2019-10-12"; + + src = fetchgit { + url = "https://evilpiepirate.org/git/bcachefs-tools.git"; + rev = "6e696ea08703eecd0d1c7b8c520b6f62f06f4f26"; + sha256 = "0m3valm68vc73b4kydlga17fglxa9bldrjaszlladzl5bd0zb967"; + }; + + enableParallelBuilding = true; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ attr libuuid libscrypt libsodium keyutils liburcu zlib libaio zstd lz4 ]; + installFlags = [ "PREFIX=${placeholder "out"}" ]; + + preInstall = '' + substituteInPlace Makefile \ + --replace "INITRAMFS_DIR=/etc/initramfs-tools" \ + "INITRAMFS_DIR=${placeholder "out"}/etc/initramfs-tools" + ''; + + meta = with stdenv.lib; { + description = "Tool for managing bcachefs filesystems"; + homepage = https://bcachefs.org/; + license = licenses.gpl2; + maintainers = with maintainers; [ davidak chiiruno ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper b/nixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper new file mode 100755 index 000000000000..8ef46afc18f5 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bees/bees-service-wrapper @@ -0,0 +1,223 @@ +#!@bash@/bin/bash +PATH=@bash@/bin:@coreutils@/bin:@utillinux@/bin:@btrfsProgs@/bin:$PATH +beesd_bin=@bees@/lib/bees/bees +# PLEASE KEEP NIX-ISMS ABOVE THIS LINE TO EASE UPSTREAM MERGE +#!/usr/bin/env bash + +shopt -s extglob + +# Upstream wrapper requires UUID to be used for configuration. + +# However, when declaratively describing a host, we may not know its UUID, and +# shouldn't need to persist something that will differ between hosts built from +# the same configuration template. + +# Thus, for using bees from NixOS, we have our own wrapper, which supports not +# just UUID but any specification permitted by findmnt + +[[ $bees_debug ]] && { PS4=':${BASH_SOURCE##*/}:$LINENO+'; set -x; } + +usage() { + cat >&2 <<EOF +Usage: ${BASH_SOURCE##*/} run|cleanup config-name|fsSpec [idxSizeMB=...] [verbosity=...] [workDir=...] [-- daemon-options...] + + fsSpec should be in a format recognized by findmnt. Alternately, + "config-name" may refer to a file that exists in ${bees_config_dir:-/etc/bees} + with a .conf extension; if that file does not specify UUID, findmnt will be + used in addition. + + Note that while config files may presently use shell arithmetic, use of this + functionality is not encouraged going forward: Setting ''idxSizeMB=4096'' is + preferred over ''DB_SIZE=$((1024*1024*1024*4))'' or ''DB_SIZE=$(( AL16M * 256 ))'', + although both of these are presently supported. + + If fsSpec contains a /, it assumed to be a mount point to be looked up by + findmnt, not a config file name. + + daemon-options are passed directly through to the daemon on startup, as + documented at https://github.com/Zygo/bees/blob/master/docs/options.md. +EOF + exit 1 +} + +die() { echo "$*" >&2; exit 1; } + +allConfigNames=( blockdev fsSpec home idxSize idxSizeMB mntDir runDir status verbosity workDir ) + +# Alternate names for configuration values; "bees_" will always be prepended +declare -A altConfigNames=( + # from original bees wrapper + [BEESHOME]=home + [BEESSTATUS]=status + [MNT_DIR]=mntDir + [UUID]=uuid + [WORK_DIR]=runDir + [DB_SIZE]=idxSize +) + +# legacy bees config files can be arbitrary shell scripts, so we need to actually evaluate them +sandboxedConfigFileEval() { + bash_exe=$(type -P bash) || exit + PATH=/var/empty ENV='' BASH_ENV='' AL128K="$((128*1024))" AL16M="$((16*1024*1024))" "$bash_exe" -r ${bees_debug+-x} \ + -c 'eval "$(</dev/stdin)" >&2; for var; do [[ ${!var} ]] && printf "%q=%s\\0" "$var" "${!var}"; done' \ + "${!altConfigNames[@]}" "${allConfigNames[@]}" \ + <"$1" +} + +readConfigFileIfExists() { + local line + [[ -s $1 ]] || return 1 + while IFS= read -r -d '' line; do + line=${line%%+([[:space:]])"#"*} + [[ $line ]] || continue + [[ $line = *=* ]] || { + printf 'WARNING: Config file line not recognized: %q\n' "$line" >&2 + continue + } + set_option "$line" + done < <(sandboxedConfigFileEval "$1") +} + +set_option() { + local k v + k="${1%%=*}" v="${1#*=}" + [[ ${altConfigNames[$k]} ]] && k=${altConfigNames[$k]} + printf -v "bees_$k" %s "$v" +} + +uuid_re='^[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$' + +# Shared code for setting configuration used by other operations. +# +# Reads from global associative array "opts" containing options passed in as +# key=value pairs on the command line, looks for config-file overrides, and +# sets individual global variables. +_setup() { + declare fstype + bees_fsSpec=$1; shift + + # Look for file-based configuration, additional to honoring configuration on the command line + bees_config_dir="${bees_config_dir:-/etc/bees}" + if [[ $bees_fsSpec =~ $uuid_re ]]; then + bees_uuid=$bees_fsSpec + # If our spec looks like a bare UUID, and no config file exists in the new + # format, fall back to legacy config file search mechanism (grep; ewww). + if ! readConfigFileIfExists "$bees_config_dir/UUID=$bees_fsSpec.conf"; then + # Legacy approach to finding a config file: Grep for a *.conf file + # containing the UUID within its text. Permitting spaces around the "=" + # appears to be a bug, but is retained for compatibility with the + # original upstream script. + allConfFiles=( "$bees_config_dir"/*.conf ) + if (( ${#allConfFiles[@]} )); then + # in read or readarray with -d '', the NUL terminating the empty string is used as delimiter character. + readarray -d '' -t matchingConfFiles < <(grep -E -l -Z "^[^#]*UUID[[:space:]]*=[[:space:]]*" "${allConfFiles[@]}") + else + matchingConfFiles=( ) + fi + if (( ${#matchingConfFiles[@]} == 1 )); then + # Exactly one configuration file exists in our target directory with a reference to the UUID given. + bees_config_file=${matchingConfFiles[0]} + readConfigFileIfExists "$bees_config_file" + echo "NOTE: Please consider renaming $bees_config_file to $bees_config_dir/UUID=$bees_fsSpec" >&2 + echo " ...and passing UUID=$bees_fsSpec on startup." >&2 + elif (( ${#matchingConfFiles[@]} > 1 )); then + # The legacy wrapper would silently use the first file and ignore + # others, but... no. + echo "ERROR: Passed a bare UUID, but multiple configuration files match it:" >&2 + printf ' - %q\n' "${matchingConfFiles[@]}" >&2 + die "Unable to continue." + fi + fi + else + # For a non-UUID fsSpec that is not a path, look only for a config file + # exactly matching its text. + # + # (Passing a mount point as a fsSpec is only supported with the new + # wrapper; all key=value pairs can be passed on the command line in this + # mode, so config file support is not needed). + [[ $bees_fsSpec = */* ]] || readConfigFileIfExists "$bees_config_dir/$bees_fsSpec.conf" + fi + + [[ $bees_uuid ]] || { + # if bees_uuid is not in our .conf file, look it up with findmnt + read -r bees_uuid fstype < <(findmnt -n -o uuid,fstype "$bees_fsSpec") && [[ $fstype ]] || exit + [[ $fstype = btrfs ]] || die "Device type is $fstype, not btrfs" + } + + [[ $bees_uuid = */* ]] || readConfigFileIfExists "$bees_config_dir/UUID=$bees_uuid.conf" + + # Honor any values read from config files above; otherwise, set defaults. + bees_workDir="${bees_workDir:-.beeshome}" + bees_runDir="${bees_runDir:-/run/bees}" + bees_mntDir="${bees_mntDir:-$bees_runDir/mnt/$bees_uuid}" + bees_home="${bees_home:-$bees_mntDir/$bees_workDir}" + bees_status="${bees_status:-${bees_runDir}/$bees_uuid.status}" + bees_verbosity="${bees_verbosity:-6}" + bees_idxSizeMB="${bees_idxSizeMB:-1024}" + bees_idxSize=${bees_idxSize:-"$(( bees_idxSizeMB * 1024 * 1024 ))"} + bees_blockdev=${bees_blockdev:-"/dev/disk/by-uuid/$bees_uuid"} + + [[ -b $bees_blockdev ]] || die "Block device $bees_blockdev missing" + (( bees_idxSize % (16 * 1024 * 1024) == 0 )) || die "DB size must be divisible by 16MB" +} + +do_run() { + local db old_db_size + + _setup "$1"; shift + mkdir -p -- "$bees_mntDir" || exit + + # subvol id 5 is reserved for the root subvolume of a btrfs filesystem. + mountpoint -q "$bees_mntDir" || mount -osubvolid=5 -- "$bees_blockdev" "$bees_mntDir" || exit + if [[ -d $bees_home ]]; then + btrfs subvolume show "$bees_home" >/dev/null 2>&1 || die "$bees_home exists but is not a subvolume" + else + btrfs subvolume create "$bees_home" || exit + sync # workaround for Zygo/bees#93 + fi + db=$bees_home/beeshash.dat + touch -- "$db" + + old_db_size=$(stat -c %s -- "$db") + new_db_size=$bees_idxSize + + if (( old_db_size != new_db_size )); then + rm -f -- "$bees_home"/beescrawl."$bees_uuid".dat + truncate -s "$new_db_size" -- "$db" || exit + fi + chmod 700 -- "$bees_home" + + # BEESSTATUS and BEESHOME are the only variables handled by the legacy + # wrapper for which getenv() is called in C code. + BEESSTATUS=$bees_status BEESHOME=$bees_home exec "${beesd_bin:-/lib/bees/bees}" \ + --verbose "$bees_verbosity" \ + "$@" "$bees_mntDir" || exit +} + +do_cleanup() { + _setup "$1"; shift + mountpoint -q "$bees_mntDir" && umount -l -- "$bees_mntDir" || exit +} + +(( $# >= 2 )) || usage +declare -f "do_$1" >/dev/null 2>&1 || usage +mode=$1; shift # must be a do_* function; currently "run" or "cleanup" + +declare -a args=( "$1" ); shift # pass first argument (config-name|fsSpec) through literally + +# parse other arguments as key=value pairs, or pass them through literally if they do not match that form. +# similarly, any option after "--" will be passed through literally. +while (( $# )); do + if [[ $1 = *=* ]]; then + set_option "$1" + elif [[ $1 = -- ]]; then + shift + args+=( "$@" ) + break + else + args+=( "$1" ) + fi + shift +done + +"do_$mode" "${args[@]}" diff --git a/nixpkgs/pkgs/tools/filesystems/bees/default.nix b/nixpkgs/pkgs/tools/filesystems/bees/default.nix new file mode 100644 index 000000000000..c6bb07e7b87d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bees/default.nix @@ -0,0 +1,69 @@ +{ stdenv, runCommand, fetchFromGitHub, bash, btrfs-progs, coreutils, pythonPackages, utillinux }: + +let + + version = "0.6.2"; + sha256 = "05niv9rivd3j3cwcx3n3vjr85wr0l5i76giq9n54d2vdwmn8qjib"; + + bees = stdenv.mkDerivation { + pname = "bees"; + inherit version; + + src = fetchFromGitHub { + owner = "Zygo"; + repo = "bees"; + rev = "v${version}"; + inherit sha256; + }; + + buildInputs = [ + btrfs-progs # for btrfs/ioctl.h + utillinux # for uuid.h + ]; + + nativeBuildInputs = [ + pythonPackages.markdown # documentation build + ]; + + preBuild = '' + git() { if [[ $1 = describe ]]; then echo ${version}; else command git "$@"; fi; } + export -f git + ''; + + postBuild = '' + unset -f git + ''; + + buildFlags = [ + "ETC_PREFIX=/var/run/bees/configs" + ]; + + makeFlags = [ + "SHELL=bash" + "PREFIX=$(out)" + "ETC_PREFIX=$(out)/etc" + "BEES_VERSION=${version}" + "SYSTEMD_SYSTEM_UNIT_DIR=$(out)/etc/systemd/system" + ]; + + meta = with stdenv.lib; { + homepage = "https://github.com/Zygo/bees"; + description = "Block-oriented BTRFS deduplication service"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ chaduffy ]; + longDescription = "Best-Effort Extent-Same: bees finds not just identical files, but also identical extents within files that differ"; + }; + }; + +in + +runCommand "bees-service-${version}" { + inherit bash bees coreutils utillinux; + btrfsProgs = btrfs-progs; # needs to be a valid shell variable name +} '' + mkdir -p -- "$out/bin" + substituteAll ${./bees-service-wrapper} "$out"/bin/bees-service-wrapper + chmod +x "$out"/bin/bees-service-wrapper + ln -s ${bees}/bin/beesd "$out"/bin/beesd +'' diff --git a/nixpkgs/pkgs/tools/filesystems/bindfs/default.nix b/nixpkgs/pkgs/tools/filesystems/bindfs/default.nix new file mode 100644 index 000000000000..d0f68fac7ca1 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bindfs/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchurl, fuse, pkgconfig }: + +stdenv.mkDerivation rec { + version = "1.14.2"; + pname = "bindfs"; + + src = fetchurl { + url = "https://bindfs.org/downloads/${pname}-${version}.tar.gz"; + sha256 = "0zn5fjrm9la5w1p66xhy87aasqsdky36dgc447jp2yp7nh18v339"; + }; + + dontStrip = true; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse ]; + postFixup = '' + ln -s $out/bin/bindfs $out/bin/mount.fuse.bindfs + ''; + + meta = { + description = "A FUSE filesystem for mounting a directory to another location"; + homepage = https://bindfs.org; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [ lovek323 ]; + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix new file mode 100644 index 000000000000..3c6f62283293 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/blobfuse/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, cmake, pkgconfig, curl, gnutls, libgcrypt, libuuid, fuse }: + +stdenv.mkDerivation rec { + pname = "blobfuse"; + version = "1.0.2"; + + src = fetchFromGitHub { + owner = "Azure"; + repo = "azure-storage-fuse"; + rev = "v${version}"; + sha256 = "1qh04z1fsj1l6l12sz9yl2sy9hwlrnzac54hwrr7wvsgv90n9gbp"; + }; + + NIX_CFLAGS_COMPILE = "-Wno-error=catch-value"; + + buildInputs = [ curl gnutls libgcrypt libuuid fuse ]; + nativeBuildInputs = [ cmake pkgconfig ]; + + meta = with stdenv.lib; { + description = "Mount an Azure Blob storage as filesystem through FUSE"; + license = licenses.mit; + maintainers = with maintainers; [ jbgi ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/bonnie/default.nix b/nixpkgs/pkgs/tools/filesystems/bonnie/default.nix new file mode 100644 index 000000000000..57dc51e41115 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/bonnie/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, perl }: + +stdenv.mkDerivation rec { + name = "bonnie++-1.98"; + src = fetchurl { + url = "https://www.coker.com.au/bonnie++/${name}.tgz"; + sha256 = "010bmlmi0nrlp3aq7p624sfaj5a65lswnyyxk3cnz1bqig0cn2vf"; + }; + + enableParallelBuilding = true; + + buildInputs = [ perl ]; + + meta = { + homepage = http://www.coker.com.au/bonnie++/; + description = "Hard drive and file system benchmark suite"; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/boxfs/default.nix b/nixpkgs/pkgs/tools/filesystems/boxfs/default.nix new file mode 100644 index 000000000000..3ddc95273972 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/boxfs/default.nix @@ -0,0 +1,60 @@ +{ stdenv, fetchFromGitHub, curl, fuse, libxml2, pkgconfig }: + +let + srcs = { + boxfs2 = fetchFromGitHub { + sha256 = "10af1l3sjnh25shmq5gdnpyqk4vrq7i1zklv4csf1n2nrahln8j8"; + rev = "d7018b0546d2dae956ae3da3fb95d2f63fa6d3ff"; + repo = "boxfs2"; + owner = "drotiro"; + }; + libapp = fetchFromGitHub { + sha256 = "1p2sbxiranan2n2xsfjkp3c6r2vcs57ds6qvjv4crs1yhxr7cp00"; + rev = "febebe2bc0fb88d57bdf4eb4a2a54c9eeda3f3d8"; + repo = "libapp"; + owner = "drotiro"; + }; + libjson = fetchFromGitHub { + sha256 = "1vhss3gq44nl61fbnh1l3qzwvz623gwhfgykf1lf1p31rjr7273w"; + rev = "75a7f50fca2c667bc5f32cdd6dd98f2b673f6657"; + repo = "libjson"; + owner = "vincenthz"; + }; + }; +in stdenv.mkDerivation { + pname = "boxfs"; + version = "2-20150109"; + + src = srcs.boxfs2; + + prePatch = with srcs; '' + substituteInPlace Makefile --replace "git pull" "true" + cp -a --no-preserve=mode ${libapp} libapp + cp -a --no-preserve=mode ${libjson} libjson + ''; + patches = [ ./work-around-API-borkage.patch ]; + + buildInputs = [ curl fuse libxml2 ]; + nativeBuildInputs = [ pkgconfig ]; + + buildFlags = [ "static" ]; + + installPhase = '' + mkdir -p $out/bin + install boxfs boxfs-init $out/bin + ''; + + meta = with stdenv.lib; { + description = "FUSE file system for box.com accounts"; + longDescription = '' + Store files on box.com (an account is required). The first time you run + boxfs, you will need to complete the authentication (oauth2) process and + grant access to your box.com account. Just follow the instructions on + the terminal and in your browser. When you've done using your files, + unmount the file system with `fusermount -u mountpoint`. + ''; + homepage = https://github.com/drotiro/boxfs2; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch b/nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch new file mode 100644 index 000000000000..b74e7f324665 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/boxfs/work-around-API-borkage.patch @@ -0,0 +1,15 @@ +diff --git a/boxapi.c b/boxapi.c +index 4964273..1a32e0d 100644 +--- a/boxapi.c ++++ b/boxapi.c +@@ -38,8 +38,8 @@ + // AUTH + #define API_KEY_VAL "f9ss11y2w0hg5r04jsidxlhk4pil28cf" + #define API_SECRET "r3ZHAIhsOL2FoHjgERI9xf74W5skIM0w" +-#define API_OAUTH_URL "https://app.box.com/api/oauth2/" //"https://www.box.com/api/oauth2/" +-#define API_OAUTH_AUTHORIZE API_OAUTH_URL "authorize?response_type=code&client_id=" API_KEY_VAL /*"&redirect_uri=http%3A//localhost"*/ ++#define API_OAUTH_URL "https://api.box.com/oauth2/" //"https://www.box.com/api/oauth2/" ++#define API_OAUTH_AUTHORIZE "https://app.box.com/api/oauth2/authorize?response_type=code&client_id=" API_KEY_VAL /*"&redirect_uri=http%3A//localhost"*/ + #define API_OAUTH_TOKEN API_OAUTH_URL "token" + // CALLS + #define API_ENDPOINT "https://api.box.com/2.0/" diff --git a/nixpkgs/pkgs/tools/filesystems/btrfs-dedupe/default.nix b/nixpkgs/pkgs/tools/filesystems/btrfs-dedupe/default.nix new file mode 100644 index 000000000000..e2538387d450 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/btrfs-dedupe/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, rustPlatform, lzo, zlib }: + +with rustPlatform; + +buildRustPackage rec { + pname = "btrfs-dedupe"; + version = "1.1.0"; + + + src = fetchurl { + url = "https://gitlab.wellbehavedsoftware.com/well-behaved-software/btrfs-dedupe/repository/archive.tar.bz2?ref=72c6a301d20f935827b994db210bf0a1e121273a"; + sha256 = "0qy1g4crhfgs2f5cmrsjv6qscg3r66gb8n6sxhimm9ksivhjyyjp"; + }; + + cargoSha256 = "1sz3fswb76rnk7x4kpl1rnj2yxbhpx6q8kv8xxiqdr7qyphpi98r"; + + buildInputs = [ lzo zlib ]; + + meta = with stdenv.lib; { + homepage = https://gitlab.wellbehavedsoftware.com/well-behaved-software/btrfs-dedupe; + description = "BTRFS deduplication utility"; + license = licenses.mit; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ ikervagyok ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix b/nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix new file mode 100644 index 000000000000..1da8470280b8 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchurl, pkgconfig, attr, acl, zlib, libuuid, e2fsprogs, lzo +, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3 +}: + +stdenv.mkDerivation rec { + pname = "btrfs-progs"; + version = "5.4"; + + src = fetchurl { + url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz"; + sha256 = "1ykhasv0jc3qi3xrm5841mzkmlbkjw6rm70gl4aww90jj6ak55qg"; + }; + + nativeBuildInputs = [ + pkgconfig asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt + python3 python3.pkgs.setuptools + ]; + + buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd python3 ]; + + # for python cross-compiling + _PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config; + # The i686 case is a quick hack; I don't know what's wrong. + postConfigure = stdenv.lib.optionalString (!stdenv.isi686) '' + export LDSHARED="$LD -shared" + ''; + + # gcc bug with -O1 on ARM with gcc 4.8 + # This should be fine on all platforms so apply universally + postPatch = "sed -i s/-O1/-O2/ configure"; + + postInstall = '' + install -v -m 444 -D btrfs-completion $out/etc/bash_completion.d/btrfs + ''; + + configureFlags = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-backtrace"; + + meta = with stdenv.lib; { + description = "Utilities for the btrfs filesystem"; + homepage = https://btrfs.wiki.kernel.org/; + license = licenses.gpl2; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/buttersink/default.nix b/nixpkgs/pkgs/tools/filesystems/buttersink/default.nix new file mode 100644 index 000000000000..791d59b7ac27 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/buttersink/default.nix @@ -0,0 +1,30 @@ +{ lib, python2 }: + +python2.pkgs.buildPythonApplication rec { + pname = "buttersink"; + version = "0.6.9"; + + src = python2.pkgs.fetchPypi { + inherit pname version; + sha256 = "a797b6e92ad2acdf41e033c1368ab365aa268f4d8458b396a5770fa6c2bc3f54"; + }; + + propagatedBuildInputs = with python2.pkgs; [ boto crcmod psutil ]; + + # No tests implemented + doCheck = false; + + meta = with lib; { + description = "Synchronise btrfs snapshots"; + longDescription = '' + ButterSink is like rsync, but for btrfs subvolumes instead of files, + which makes it much more efficient for things like archiving backup + snapshots. It is built on top of btrfs send and receive capabilities. + Sources and destinations can be local btrfs file systems, remote btrfs + file systems over SSH, or S3 buckets. + ''; + homepage = https://github.com/AmesCornish/buttersink/wiki; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/ceph/0000-dont-check-cherrypy-version.patch b/nixpkgs/pkgs/tools/filesystems/ceph/0000-dont-check-cherrypy-version.patch new file mode 100644 index 000000000000..9604da87fb50 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ceph/0000-dont-check-cherrypy-version.patch @@ -0,0 +1,70 @@ +diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py +index a8a3ec07c1..bcc9b86c37 100644 +--- a/src/pybind/mgr/dashboard/module.py ++++ b/src/pybind/mgr/dashboard/module.py +@@ -25,40 +25,6 @@ except ImportError: + + from .services.sso import load_sso_db + +-# The SSL code in CherryPy 3.5.0 is buggy. It was fixed long ago, +-# but 3.5.0 is still shipping in major linux distributions +-# (Fedora 27, Ubuntu Xenial), so we must monkey patch it to get SSL working. +-if cherrypy is not None: +- v = StrictVersion(cherrypy.__version__) +- # It was fixed in 3.7.0. Exact lower bound version is probably earlier, +- # but 3.5.0 is what this monkey patch is tested on. +- if StrictVersion("3.5.0") <= v < StrictVersion("3.7.0"): +- from cherrypy.wsgiserver.wsgiserver2 import HTTPConnection,\ +- CP_fileobject +- +- def fixed_init(hc_self, server, sock, makefile=CP_fileobject): +- hc_self.server = server +- hc_self.socket = sock +- hc_self.rfile = makefile(sock, "rb", hc_self.rbufsize) +- hc_self.wfile = makefile(sock, "wb", hc_self.wbufsize) +- hc_self.requests_seen = 0 +- +- HTTPConnection.__init__ = fixed_init +- +-# When the CherryPy server in 3.2.2 (and later) starts it attempts to verify +-# that the ports its listening on are in fact bound. When using the any address +-# "::" it tries both ipv4 and ipv6, and in some environments (e.g. kubernetes) +-# ipv6 isn't yet configured / supported and CherryPy throws an uncaught +-# exception. +-if cherrypy is not None: +- v = StrictVersion(cherrypy.__version__) +- # the issue was fixed in 3.2.3. it's present in 3.2.2 (current version on +- # centos:7) and back to at least 3.0.0. +- if StrictVersion("3.1.2") <= v < StrictVersion("3.2.3"): +- # https://github.com/cherrypy/cherrypy/issues/1100 +- from cherrypy.process import servers +- servers.wait_for_occupied_port = lambda host, port: None +- + if 'COVERAGE_ENABLED' in os.environ: + import coverage + __cov = coverage.Coverage(config_file="{}/.coveragerc".format(os.path.dirname(__file__)), +diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py +index b7fecf8d85..dfd4160591 100644 +--- a/src/pybind/mgr/prometheus/module.py ++++ b/src/pybind/mgr/prometheus/module.py +@@ -18,20 +18,6 @@ from rbd import RBD + DEFAULT_ADDR = '::' + DEFAULT_PORT = 9283 + +-# When the CherryPy server in 3.2.2 (and later) starts it attempts to verify +-# that the ports its listening on are in fact bound. When using the any address +-# "::" it tries both ipv4 and ipv6, and in some environments (e.g. kubernetes) +-# ipv6 isn't yet configured / supported and CherryPy throws an uncaught +-# exception. +-if cherrypy is not None: +- v = StrictVersion(cherrypy.__version__) +- # the issue was fixed in 3.2.3. it's present in 3.2.2 (current version on +- # centos:7) and back to at least 3.0.0. +- if StrictVersion("3.1.2") <= v < StrictVersion("3.2.3"): +- # https://github.com/cherrypy/cherrypy/issues/1100 +- from cherrypy.process import servers +- servers.wait_for_occupied_port = lambda host, port: None +- + # cherrypy likes to sys.exit on error. don't let it take us down too! + def os_exit_noop(*args, **kwargs): + pass diff --git a/nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch b/nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch new file mode 100644 index 000000000000..b04082537b53 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ceph/0000-fix-SPDK-build-env.patch @@ -0,0 +1,11 @@ +--- a/cmake/modules/BuildSPDK.cmake 2018-08-09 09:22:34.950684960 +0200 ++++ b/cmake/modules/BuildSPDK.cmake 2018-08-09 09:21:59.986964224 +0200 +@@ -16,7 +16,7 @@ + # unset $CFLAGS, otherwise it will interfere with how SPDK sets + # its include directory. + # unset $LDFLAGS, otherwise SPDK will fail to mock some functions. +- BUILD_COMMAND env -i PATH=$ENV{PATH} CC=${CMAKE_C_COMPILER} $(MAKE) EXTRA_CFLAGS="-fPIC" ++ BUILD_COMMAND env PATH=$ENV{PATH} CC=${CMAKE_C_COMPILER} $(MAKE) EXTRA_CFLAGS="-fPIC" C_OPT="-mssse3" + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "true") + ExternalProject_Get_Property(spdk-ext source_dir) diff --git a/nixpkgs/pkgs/tools/filesystems/ceph/default.nix b/nixpkgs/pkgs/tools/filesystems/ceph/default.nix new file mode 100644 index 000000000000..9c7704410251 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ceph/default.nix @@ -0,0 +1,200 @@ +{ stdenv, runCommand, fetchurl +, ensureNewerSourcesHook +, cmake, pkgconfig +, which, git +, boost, python3Packages +, libxml2, zlib, lz4 +, openldap, lttng-ust +, babeltrace, gperf +, gtest +, cunit, snappy +, rocksdb, makeWrapper +, leveldb, oathToolkit +, libnl, libcap_ng + +# Optional Dependencies +, yasm ? null, fcgi ? null, expat ? null +, curl ? null, fuse ? null +, libedit ? null, libatomic_ops ? null +, libs3 ? null + +# Mallocs +, jemalloc ? null, gperftools ? null + +# Crypto Dependencies +, cryptopp ? null +, nss ? null, nspr ? null + +# Linux Only Dependencies +, linuxHeaders, utillinux, libuuid, udev, keyutils, rdma-core, rabbitmq-c +, libaio ? null, libxfs ? null, zfs ? null +, ... +}: + +# We must have one crypto library +assert cryptopp != null || (nss != null && nspr != null); + +with stdenv; with stdenv.lib; +let + shouldUsePkg = pkg: if pkg != null && pkg.meta.available then pkg else null; + + optYasm = shouldUsePkg yasm; + optFcgi = shouldUsePkg fcgi; + optExpat = shouldUsePkg expat; + optCurl = shouldUsePkg curl; + optFuse = shouldUsePkg fuse; + optLibedit = shouldUsePkg libedit; + optLibatomic_ops = shouldUsePkg libatomic_ops; + optLibs3 = shouldUsePkg libs3; + + optJemalloc = shouldUsePkg jemalloc; + optGperftools = shouldUsePkg gperftools; + + optCryptopp = shouldUsePkg cryptopp; + optNss = shouldUsePkg nss; + optNspr = shouldUsePkg nspr; + + optLibaio = shouldUsePkg libaio; + optLibxfs = shouldUsePkg libxfs; + optZfs = shouldUsePkg zfs; + + hasRadosgw = optFcgi != null && optExpat != null && optCurl != null && optLibedit != null; + + + # Malloc implementation (can be jemalloc, tcmalloc or null) + malloc = if optJemalloc != null then optJemalloc else optGperftools; + + # We prefer nss over cryptopp + cryptoStr = if optNss != null && optNspr != null then "nss" else + if optCryptopp != null then "cryptopp" else "none"; + + cryptoLibsMap = { + nss = [ optNss optNspr ]; + cryptopp = [ optCryptopp ]; + none = [ ]; + }; + + ceph-python-env = python3Packages.python.withPackages (ps: [ + ps.sphinx + ps.flask + ps.cython + ps.setuptools + ps.virtualenv + # Libraries needed by the python tools + ps.Mako + ps.cherrypy + ps.pecan + ps.prettytable + ps.pyjwt + ps.webob + ps.bcrypt + ps.six + ps.pyyaml + ]); + + version = "14.2.5"; +in rec { + ceph = stdenv.mkDerivation { + pname = "ceph"; + inherit version; + + src = fetchurl { + url = "http://download.ceph.com/tarballs/ceph-${version}.tar.gz"; + sha256 = "0wbkdplxs8higmlj57a7rydmx9rq08h0arjrmxmp0s80bn0v5x2c"; + }; + + patches = [ + ./0000-fix-SPDK-build-env.patch + ./0000-dont-check-cherrypy-version.patch + ]; + + nativeBuildInputs = [ + cmake + pkgconfig which git python3Packages.wrapPython makeWrapper + python3Packages.python # for the toPythonPath function + (ensureNewerSourcesHook { year = "1980"; }) + ]; + + buildInputs = cryptoLibsMap.${cryptoStr} ++ [ + boost ceph-python-env libxml2 optYasm optLibatomic_ops optLibs3 + malloc zlib openldap lttng-ust babeltrace gperf gtest cunit + snappy rocksdb lz4 oathToolkit leveldb libnl libcap_ng + ] ++ optionals stdenv.isLinux [ + linuxHeaders utillinux libuuid udev keyutils optLibaio optLibxfs optZfs + # ceph 14 + rdma-core rabbitmq-c + ] ++ optionals hasRadosgw [ + optFcgi optExpat optCurl optFuse optLibedit + ]; + + pythonPath = [ ceph-python-env "${placeholder "out"}/${ceph-python-env.sitePackages}" ]; + + preConfigure ='' + substituteInPlace src/common/module.c --replace "/sbin/modinfo" "modinfo" + substituteInPlace src/common/module.c --replace "/sbin/modprobe" "modprobe" + + # for pybind/rgw to find internal dep + export LD_LIBRARY_PATH="$PWD/build/lib:$LD_LIBRARY_PATH" + # install target needs to be in PYTHONPATH for "*.pth support" check to succeed + + patchShebangs src/script src/spdk src/test src/tools + ''; + + cmakeFlags = [ + "-DWITH_PYTHON3=ON" + "-DWITH_SYSTEM_ROCKSDB=OFF" + "-DCMAKE_INSTALL_DATADIR=${placeholder "lib"}/lib" + + + "-DWITH_SYSTEM_BOOST=ON" + "-DWITH_SYSTEM_ROCKSDB=ON" + "-DWITH_SYSTEM_GTEST=ON" + "-DMGR_PYTHON_VERSION=${ceph-python-env.python.pythonVersion}" + "-DWITH_SYSTEMD=OFF" + "-DWITH_TESTS=OFF" + # TODO breaks with sandbox, tries to download stuff with npm + "-DWITH_MGR_DASHBOARD_FRONTEND=OFF" + ]; + + postFixup = '' + wrapPythonPrograms + wrapProgram $out/bin/ceph-mgr --prefix PYTHONPATH ":" "$(toPythonPath ${placeholder "out"}):$(toPythonPath ${ceph-python-env})" + ''; + + enableParallelBuilding = true; + + outputs = [ "out" "lib" "dev" "doc" "man" ]; + + doCheck = false; # uses pip to install things from the internet + + meta = { + homepage = https://ceph.com/; + description = "Distributed storage system"; + license = with licenses; [ lgpl21 gpl2 bsd3 mit publicDomain ]; + maintainers = with maintainers; [ adev ak krav johanot ]; + platforms = [ "x86_64-linux" ]; + }; + + passthru.version = version; + }; + + ceph-client = runCommand "ceph-client-${version}" { + meta = { + homepage = https://ceph.com/; + description = "Tools needed to mount Ceph's RADOS Block Devices"; + license = with licenses; [ lgpl21 gpl2 bsd3 mit publicDomain ]; + maintainers = with maintainers; [ adev ak johanot krav ]; + platforms = [ "x86_64-linux" ]; + }; + } '' + mkdir -p $out/{bin,etc,lib/python3.7/site-packages} + cp -r ${ceph}/bin/{ceph,.ceph-wrapped,rados,rbd,rbdmap} $out/bin + cp -r ${ceph}/bin/ceph-{authtool,conf,dencoder,rbdnamer,syn} $out/bin + cp -r ${ceph}/bin/rbd-replay* $out/bin + cp -r ${ceph}/lib/python3.7/site-packages $out/lib/python3.7/ + cp -r ${ceph}/etc/bash_completion.d $out/etc + # wrapPythonPrograms modifies .ceph-wrapped, so lets just update its paths + substituteInPlace $out/bin/ceph --replace ${ceph} $out + substituteInPlace $out/bin/.ceph-wrapped --replace ${ceph} $out + ''; +} diff --git a/nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix b/nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix new file mode 100644 index 000000000000..6c0a6c287031 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/chunkfs/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, perl, fuse }: + +stdenv.mkDerivation rec { + version = "0.7"; + pname = "chunkfs"; + + src = fetchurl { + url = "https://chunkfs.florz.de/chunkfs_${version}.tar.gz"; + sha256 = "4c168fc2b265a6ba34afc565707ea738f34375325763c0596f2cfa1c9b8d40f1"; + }; + + buildInputs = [perl fuse]; + + makeFlags = [ + "DESTDIR=$(out)" + "PREFIX=" + ]; + + preInstall = '' + mkdir -p $out/bin + mkdir -p $out/share/man/man1 + ''; + + meta = { + description = "FUSE filesystems for viewing chunksync-style directory trees as a block device and vice versa"; + homepage = http://chunkfs.florz.de/; + license = stdenv.lib.licenses.gpl2; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix b/nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix new file mode 100644 index 000000000000..533bb2322e72 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ciopfs/default.nix @@ -0,0 +1,22 @@ +{ stdenv, fetchurl, pkgconfig, fuse, glib, attr }: + +stdenv.mkDerivation rec { + name = "ciopfs-0.4"; + + src = fetchurl { + url = "http://www.brain-dump.org/projects/ciopfs/${name}.tar.gz"; + sha256 = "0sr9i9b3qfwbfvzvk00yrrg3x2xqk1njadbldkvn7hwwa4z5bm9l"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse glib attr ]; + + makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ]; + + meta = { + homepage = http://www.brain-dump.org/projects/ciopfs/; + description = "A case-insensitive filesystem layered on top of any other filesystem"; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/convoy/default.nix b/nixpkgs/pkgs/tools/filesystems/convoy/default.nix new file mode 100644 index 000000000000..00ef368ad3da --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/convoy/default.nix @@ -0,0 +1,26 @@ +# This file was generated by go2nix. +{ stdenv, buildGoPackage, fetchFromGitHub, lvm2 }: + +buildGoPackage rec { + pname = "convoy"; + version = "0.5.0"; + + goPackagePath = "github.com/rancher/convoy"; + + src = fetchFromGitHub { + rev = "v${version}"; + owner = "rancher"; + repo = "convoy"; + sha256 = "0ihy0cfq7sa2wml904ajwr165hx2mas3jb1bqk3i0m4fg1lx1xw1"; + }; + + buildInputs = [lvm2]; + + meta = with stdenv.lib; { + homepage = https://github.com/rancher/convoy; + description = "A Docker volume plugin, managing persistent container volumes."; + license = licenses.asl20; + maintainers = with maintainers; [ offline ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix b/nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix new file mode 100644 index 000000000000..46635aa67412 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/cpcfs/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, makeWrapper, ncurses, readline, ronn }: + +stdenv.mkDerivation rec { + + pname = "cpcfs"; + version = "0.85.4"; + + src = fetchFromGitHub { + owner = "derikz"; + repo = "cpcfs"; + rev = "v${version}"; + sha256 = "0rfbry0qy8mv746mzk9zdfffkdgq4w7invgb5cszjma2cp83q3i2"; + }; + + sourceRoot = "source/src"; + + nativeBuildInputs = [ makeWrapper ncurses readline ronn ]; + + postPatch = '' + substituteInPlace Makefile \ + --replace '-ltermcap' '-lncurses' \ + --replace '-L /usr/lib/termcap' ' ' + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + mkdir -p $out/man/man1 + cp cpcfs $out/bin + ronn --roff ../template.doc --pipe > $out/man/man1/cpcfs.1 + runHook postInstall + ''; + + meta = with stdenv.lib; { + description = "Manipulating CPC dsk images and files"; + homepage = "https://github.com/derikz/cpcfs/" ; + license = licenses.bsd2; + maintainers = [ maintainers.genesis ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/cryfs/default.nix b/nixpkgs/pkgs/tools/filesystems/cryfs/default.nix new file mode 100644 index 000000000000..93a70f1f0881 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/cryfs/default.nix @@ -0,0 +1,78 @@ +{ stdenv, fetchFromGitHub, fetchpatch +, cmake, pkgconfig, python, gtest +, boost, cryptopp, curl, fuse, openssl +}: + +stdenv.mkDerivation rec { + pname = "cryfs"; + version = "0.10.2"; + + src = fetchFromGitHub { + owner = "cryfs"; + repo = "cryfs"; + rev = version; + sha256 = "1m6rcc82hbaiwcwcvf5xmxma8n0jal9zhcykv9xgwiax4ny0l8kz"; + }; + + patches = [ + (fetchpatch { + name = "cryfs-0.10.2-install-targets.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryfs/files/cryfs-0.10.2-install-targets.patch?id=192ac7421ddd4093125f4997898fb62e8a140a44"; + sha256 = "1jz6gpi1i7dnfm88a6n3mccwfmsmvg0d0bmp3fmqqrkbcg7in00l"; + }) + (fetchpatch { + name = "cryfs-0.10.2-unbundle-libs.patch"; + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/cryfs/files/cryfs-0.10.2-unbundle-libs.patch?id=192ac7421ddd4093125f4997898fb62e8a140a44"; + sha256 = "0hzss5rawcjrh8iqzc40w5yjhxdqya4gbg6dzap70180s50mahzs"; + }) + ]; + + postPatch = '' + patchShebangs src + + # remove tests that require network access: + substituteInPlace test/cpp-utils/CMakeLists.txt \ + --replace "network/CurlHttpClientTest.cpp" "" \ + --replace "network/FakeHttpClientTest.cpp" "" + + # remove CLI test trying to access /dev/fuse + substituteInPlace test/cryfs-cli/CMakeLists.txt \ + --replace "CliTest_IntegrityCheck.cpp" "" + + # downsize large file test as 4.5G is too big for Hydra: + substituteInPlace test/cpp-utils/data/DataTest.cpp \ + --replace "(4.5L*1024*1024*1024)" "(0.5L*1024*1024*1024)" + ''; + + nativeBuildInputs = [ cmake gtest pkgconfig python ]; + + buildInputs = [ boost cryptopp curl fuse openssl ]; + + enableParallelBuilding = true; + + cmakeFlags = [ + "-DCRYFS_UPDATE_CHECKS:BOOL=FALSE" + "-DBoost_USE_STATIC_LIBS:BOOL=FALSE" # this option is case sensitive + "-DUSE_SYSTEM_LIBS:BOOL=TRUE" + "-DBUILD_TESTING:BOOL=TRUE" + ]; + + doCheck = (!stdenv.isDarwin); # Cryfs tests are broken on darwin + + checkPhase = '' + # Skip CMakeFiles directory and tests depending on fuse (does not work well with sandboxing) + SKIP_IMPURE_TESTS="CMakeFiles|fspp|my-gtest-main" + + for t in $(ls -d test/*/ | egrep -v "$SKIP_IMPURE_TESTS"); do + "./$t$(basename $t)-test" + done + ''; + + meta = with stdenv.lib; { + description = "Cryptographic filesystem for the cloud"; + homepage = https://www.cryfs.org; + license = licenses.lgpl3; + maintainers = with maintainers; [ peterhoeg c0bw3b ]; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix new file mode 100644 index 000000000000..5636909093e6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix @@ -0,0 +1,21 @@ +{stdenv, fetchurl, fuse, curl, pkgconfig, glib, zlib}: + +stdenv.mkDerivation { + name = "curlftpfs-0.9.2"; + src = fetchurl { + url = mirror://sourceforge/curlftpfs/curlftpfs-0.9.2.tar.gz; + sha256 = "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f"; + }; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [fuse curl glib zlib]; + + doCheck = false; # fails, doesn't work well too, btw + + meta = with stdenv.lib; { + description = "Filesystem for accessing FTP hosts based on FUSE and libcurl"; + homepage = http://curlftpfs.sourceforge.net; + license = licenses.gpl2; + platforms = platforms.linux; + + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix b/nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix new file mode 100644 index 000000000000..0890db67fe72 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/darling-dmg/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, cmake, fuse, zlib, bzip2, openssl, libxml2, icu } : + +stdenv.mkDerivation rec { + pname = "darling-dmg"; + version = "1.0.4+git20180914"; + + src = fetchFromGitHub { + owner = "darlinghq"; + repo = "darling-dmg"; + rev = "97a92a6930e43cdbc9dedaee62716e3223deb027"; + sha256 = "1bngr4827qnl4s2f7z39wjp13nfm3zzzykjshb43wvjz536bnqdj"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ fuse openssl zlib bzip2 libxml2 icu ]; + + # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554 + CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ]; + + meta = { + homepage = http://www.darlinghq.org/; + description = "Darling lets you open macOS dmgs on Linux"; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl3; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/default.nix b/nixpkgs/pkgs/tools/filesystems/davfs2/default.nix new file mode 100644 index 000000000000..a0d2cfd4ef7d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/davfs2/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchurl, neon, zlib }: + +stdenv.mkDerivation rec { + name = "davfs2-1.5.6"; + + src = fetchurl { + url = "mirror://savannah/davfs2/${name}.tar.gz"; + sha256 = "00fqadhmhi2bmdar5a48nicmjcagnmaj9wgsvjr6cffmrz6pcx21"; + }; + + buildInputs = [ neon zlib ]; + + patches = [ ./isdir.patch ./fix-sysconfdir.patch ]; + + configureFlags = [ "--sysconfdir=/etc" ]; + + makeFlags = ["sbindir=$(out)/sbin" "ssbindir=$(out)/sbin"]; + + meta = { + homepage = https://savannah.nongnu.org/projects/davfs2; + description = "Mount WebDAV shares like a typical filesystem"; + license = stdenv.lib.licenses.gpl3Plus; + + longDescription = '' + Web Distributed Authoring and Versioning (WebDAV), an extension to + the HTTP-protocol, allows authoring of resources on a remote web + server. davfs2 provides the ability to access such resources like + a typical filesystem, allowing for use by standard applications + with no built-in support for WebDAV. + ''; + + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch b/nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch new file mode 100644 index 000000000000..f71248a28f4d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch @@ -0,0 +1,60 @@ +diff -ubr davfs2-1.4.7-orig/etc/Makefile.am davfs2-1.4.7/etc/Makefile.am +--- davfs2-1.4.7-orig/etc/Makefile.am 2013-02-21 11:45:00.185763558 +0100 ++++ davfs2-1.4.7/etc/Makefile.am 2013-02-21 11:53:05.423197775 +0100 +@@ -24,17 +24,17 @@ + + install-data-local: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) +- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir) +- $(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf +- $(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets +- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs +- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private +- chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private ++ $(mkinstalldirs) $(out)$(pkgsysconfdir) ++ $(INSTALL_DATA) -b davfs2.conf $(out)$(pkgsysconfdir)/davfs2.conf ++ $(INSTALL_DATA) -b -m 600 secrets $(out)$(pkgsysconfdir)/secrets ++ $(mkinstalldirs) $(out)$(pkgsysconfdir)/certs ++ $(mkinstalldirs) $(out)$(pkgsysconfdir)/certs/private ++ chmod 700 $(out)$(pkgsysconfdir)/certs/private + + uninstall-local: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ +- echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \ +- rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \ ++ echo " rm -f $(out)$(pkgsysconfdir)/$$f"; \ ++ rm -f $(out)$(pkgsysconfdir)/$$f; \ + done +diff -ubr davfs2-1.4.7-orig/etc/Makefile.in davfs2-1.4.7/etc/Makefile.in +--- davfs2-1.4.7-orig/etc/Makefile.in 2013-02-21 11:45:00.185763558 +0100 ++++ davfs2-1.4.7/etc/Makefile.in 2013-02-21 11:53:27.241207128 +0100 +@@ -408,19 +408,19 @@ + + install-data-local: $(dist_pkgdata_DATA) + @$(NORMAL_INSTALL) +- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir) +- $(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf +- $(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets +- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs +- $(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private +- chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private ++ $(mkinstalldirs) $(out)$(pkgsysconfdir) ++ $(INSTALL_DATA) -b davfs2.conf $(out)$(pkgsysconfdir)/davfs2.conf ++ $(INSTALL_DATA) -b -m 600 secrets $(out)$(pkgsysconfdir)/secrets ++ $(mkinstalldirs) $(out)$(pkgsysconfdir)/certs ++ $(mkinstalldirs) $(out)$(pkgsysconfdir)/certs/private ++ chmod 700 $(out)$(pkgsysconfdir)/certs/private + + uninstall-local: + @$(NORMAL_UNINSTALL) + @list='$(dist_pkgdata_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ +- echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \ +- rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \ ++ echo " rm -f $(out)$(pkgsysconfdir)/$$f"; \ ++ rm -f $(out)$(pkgsysconfdir)/$$f; \ + done + + # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch b/nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch new file mode 100644 index 000000000000..ae69b4460f5a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/davfs2/isdir.patch @@ -0,0 +1,30 @@ +diff -ur davfs2-1.4.5-old/src/dav_coda.c davfs2-1.4.5-new/src/dav_coda.c +--- davfs2-1.4.5-old/src/dav_coda.c 2009-06-04 20:30:32.000000000 +0200 ++++ davfs2-1.4.5-new/src/dav_coda.c 2011-02-09 19:51:22.260530572 +0100 +@@ -52,6 +52,10 @@ + #ifdef HAVE_SYS_TYPES_H + #include <sys/types.h> + #endif ++#ifdef HAVE_SYS_STAT_H ++#include <sys/stat.h> ++#endif ++ + + #include "defaults.h" + #include "mount_davfs.h" +diff -ur davfs2-1.4.5-old/src/dav_fuse.c davfs2-1.4.5-new/src/dav_fuse.c +--- davfs2-1.4.5-old/src/dav_fuse.c 2009-06-30 20:06:44.000000000 +0200 ++++ davfs2-1.4.5-new/src/dav_fuse.c 2011-02-09 19:52:23.938220524 +0100 +@@ -41,6 +41,12 @@ + #ifdef HAVE_UNISTD_H + #include <unistd.h> + #endif ++#ifdef HAVE_SYS_TYPES_H ++#include <sys/types.h> ++#endif ++#ifdef HAVE_SYS_STAT_H ++#include <sys/stat.h> ++#endif + + #include "defaults.h" + #include "mount_davfs.h" diff --git a/nixpkgs/pkgs/tools/filesystems/dislocker/default.nix b/nixpkgs/pkgs/tools/filesystems/dislocker/default.nix new file mode 100644 index 000000000000..cf87f9ca98e0 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/dislocker/default.nix @@ -0,0 +1,30 @@ +{ stdenv +, fetchFromGitHub +, cmake +, mbedtls +, fuse +}: + + +stdenv.mkDerivation rec { + pname = "dislocker"; + version = "0.7.1"; + + src = fetchFromGitHub { + owner = "aorimn"; + repo = "dislocker"; + rev = "v${version}"; + sha256 = "1crh2sg5x1kgqmdrl1nmrqwxjykxa4zwnbggcpdn97mj2gvdw7sb"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ fuse mbedtls ]; + + meta = with stdenv.lib; { + description = "Read BitLocker encrypted partitions in Linux"; + homepage = https://github.com/aorimn/dislocker; + license = licenses.gpl2; + maintainers = with maintainers; [ elitak ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix b/nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix new file mode 100644 index 000000000000..5137719790af --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/disorderfs/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, pkgconfig, fuse, attr, asciidoc }: + +stdenv.mkDerivation rec { + pname = "disorderfs"; + version = "0.5.6"; + + src = fetchurl { + url = "http://http.debian.net/debian/pool/main/d/disorderfs/disorderfs_${version}.orig.tar.bz2"; + sha256 = "0xlsl6cw1p0d92crknrcf4iabgig0185dzp80qxh9iyjy42d27gk"; + }; + + nativeBuildInputs = [ pkgconfig asciidoc ]; + + buildInputs = [ fuse attr ]; + + installFlags = [ "PREFIX=$(out)" ]; + + meta = with stdenv.lib; { + description = "An overlay FUSE filesystem that introduces non-determinism into filesystem metadata"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ pSub ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/djmount/default.nix b/nixpkgs/pkgs/tools/filesystems/djmount/default.nix new file mode 100644 index 000000000000..e3c8c2944fba --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/djmount/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl, pkgconfig, fuse }: + +stdenv.mkDerivation rec { + pname = "djmount"; + version = "0.71"; + src = fetchurl { + url = "mirror://sourceforge/djmount/${version}/${pname}-${version}.tar.gz"; + sha256 = "0kqf0cy3h4cfiy5a2sigmisx0lvvsi1n0fbyb9ll5gacmy1b8nxa"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse]; + + meta = { + homepage = http://djmount.sourceforge.net/; + description = "UPnP AV client, mounts as a Linux filesystem the media content of compatible UPnP AV devices"; + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.jagajaga ]; + license = stdenv.lib.licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix b/nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix new file mode 100644 index 000000000000..369d2e74f301 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/dosfstools/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libiconv }: + +stdenv.mkDerivation rec { + pname = "dosfstools"; + version = "4.1"; + + src = fetchFromGitHub { + owner = "dosfstools"; + repo = "dosfstools"; + rev = "v${version}"; + sha256 = "1a2zn1655d5f1m6jp9vpn3bp8yfxhcmxx3mx23ai9hmxiydiykr1"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ] + ++ stdenv.lib.optional stdenv.isDarwin libiconv; + + configureFlags = [ "--enable-compat-symlinks" ]; + + meta = { + description = "Utilities for creating and checking FAT and VFAT file systems"; + homepage = https://github.com/dosfstools/dosfstools; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; + license = stdenv.lib.licenses.gpl3; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/duff/default.nix b/nixpkgs/pkgs/tools/filesystems/duff/default.nix new file mode 100644 index 000000000000..d68ad10bd0dc --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/duff/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, gettext }: + +stdenv.mkDerivation { + pname = "duff"; + # The last release (0.5.2) is more than 2 years old and lacks features like -D, + # limiting its usefulness. Upstream appears comatose if not dead. + version = "2014-07-03"; + + src = fetchFromGitHub { + sha256 = "1k2dx38pjzc5d624vw1cs5ipj9fprsm5vqv55agksc29m63lswnx"; + rev = "f26d4837768b062a3f98fa075c791d9c8a0bb75c"; + repo = "duff"; + owner = "elmindreda"; + }; + + nativeBuildInputs = [ autoreconfHook gettext ]; + + preAutoreconf = '' + # gettexttize rightly refuses to run non-interactively: + cp ${gettext}/bin/gettextize . + substituteInPlace gettextize \ + --replace "read dummy" "echo '(Automatically acknowledged)' #" + ./gettextize + sed 's@po/Makefile.in\( .*\)po/Makefile.in@po/Makefile.in \1@' \ + -i configure.ac + ''; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "Quickly find duplicate files"; + longDescription = '' + Duff is a Unix command-line utility for quickly finding duplicates in + a given set of files. + ''; + homepage = https://duff.dreda.org/; + license = licenses.zlib; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/duperemove/default.nix b/nixpkgs/pkgs/tools/filesystems/duperemove/default.nix new file mode 100644 index 000000000000..0950445bd3ec --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/duperemove/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, libgcrypt +, pkgconfig, glib, linuxHeaders ? stdenv.cc.libc.linuxHeaders, sqlite }: + +stdenv.mkDerivation rec { + pname = "duperemove"; + version = "0.11.1"; + + src = fetchFromGitHub { + owner = "markfasheh"; + repo = "duperemove"; + rev = "v${version}"; + sha256 = "1scz76pvpljvrpfn176125xwaqwyy4pirlm11sc9spb2hyzknw2z"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ libgcrypt glib linuxHeaders sqlite ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + + meta = with stdenv.lib; { + description = "A simple tool for finding duplicated extents and submitting them for deduplication"; + homepage = https://github.com/markfasheh/duperemove; + license = licenses.gpl2; + maintainers = with maintainers; [ bluescreen303 thoughtpolice ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix new file mode 100644 index 000000000000..0fd7062ac6cd --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/e2fsprogs/default.nix @@ -0,0 +1,73 @@ +{ stdenv, buildPackages, fetchurl, fetchpatch, pkgconfig, libuuid, gettext, texinfo, shared ? true }: + +stdenv.mkDerivation rec { + pname = "e2fsprogs"; + version = "1.45.4"; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz"; + sha256 = "0jsclghxfzj9qmdd3qqk0gdmkrgjv2gakf8qz9dba37qkj1nk776"; + }; + + outputs = [ "bin" "dev" "out" "man" "info" ]; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = [ pkgconfig texinfo ]; + buildInputs = [ libuuid gettext ]; + + # Only use glibc's __GNUC_PREREQ(X,Y) (checks if compiler is gcc version >= X.Y) when using glibc + patches = if stdenv.hostPlatform.libc == "glibc" then null + else [ + (fetchpatch { + url = "https://raw.githubusercontent.com/void-linux/void-packages/9583597eb3e6e6b33f61dbc615d511ce030bc443/srcpkgs/e2fsprogs/patches/fix-glibcism.patch"; + sha256 = "1gfcsr0i3q8q2f0lqza8na0iy4l4p3cbii51ds6zmj0y4hz2dwhb"; + excludes = [ "lib/ext2fs/hashmap.h" ]; + extraPrefix = ""; + }) + ]; + + postPatch = '' + # Remove six failing tests + # https://github.com/NixOS/nixpkgs/issues/65471 + for test in m_image_mmp m_mmp m_mmp_bad_csum m_mmp_bad_magic t_mmp_1on t_mmp_2off; do + rm -r "tests/$test" + done + ''; + + configureFlags = + if stdenv.isLinux then [ + # It seems that the e2fsprogs is one of the few packages that cannot be + # build with shared and static libs. + (if shared then "--enable-elf-shlibs" else "--disable-elf-shlibs") + "--enable-symlink-install" + "--enable-relative-symlinks" + "--with-crond-dir=no" + # fsck, libblkid, libuuid and uuidd are in util-linux-ng (the "libuuid" dependency) + "--disable-fsck" + "--disable-libblkid" + "--disable-libuuid" + "--disable-uuidd" + ] else [ + "--enable-libuuid --disable-e2initrd-helper" + ]; + + checkInputs = [ buildPackages.perl ]; + doCheck = true; + + postInstall = '' + # avoid cycle between outputs + if [ -f $out/lib/${pname}/e2scrub_all_cron ]; then + mv $out/lib/${pname}/e2scrub_all_cron $bin/bin/ + fi + ''; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + homepage = http://e2fsprogs.sourceforge.net/; + description = "Tools for creating and checking ext2/ext3/ext4 filesystems"; + license = licenses.gpl2; + platforms = platforms.unix; + maintainers = [ maintainers.eelco ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/e2tools/default.nix b/nixpkgs/pkgs/tools/filesystems/e2tools/default.nix new file mode 100644 index 000000000000..14f6afa99f0c --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/e2tools/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, pkgconfig, e2fsprogs }: + +stdenv.mkDerivation rec { + pname = "e2tools"; + version = "0.0.16"; + + src = fetchurl { + url = "http://home.earthlink.net/~k_sheff/sw/${pname}/${pname}-${version}.tar.gz"; + sha256 = "16wlc54abqz06dpipjdkw58bncpkxlj5f55lkzy07k3cg0bqwg2f"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ e2fsprogs ]; + + enableParallelBuilding = true; + + meta = { + homepage = http://home.earthlink.net/~k_sheff/sw/e2tools/; + description = "Utilities to read/write/manipulate files in an ext2/ext3 filesystem"; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.leenaars ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/encfs/default.nix b/nixpkgs/pkgs/tools/filesystems/encfs/default.nix new file mode 100644 index 000000000000..19767b7013ae --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/encfs/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchFromGitHub +, cmake, pkgconfig, perl +, gettext, fuse, openssl, tinyxml2 +}: + +stdenv.mkDerivation rec { + pname = "encfs"; + version = "1.9.5"; + + src = fetchFromGitHub { + sha256 = "099rjb02knr6yz7przlnyj62ic0ag5ncs7vvcc36ikyqrmpqsdch"; + rev = "v${version}"; + repo = "encfs"; + owner = "vgough"; + }; + + buildInputs = [ gettext fuse openssl tinyxml2 ]; + nativeBuildInputs = [ cmake pkgconfig perl ]; + + cmakeFlags = + [ "-DUSE_INTERNAL_TINYXML=OFF" + "-DBUILD_SHARED_LIBS=ON" + "-DINSTALL_LIBENCFS=ON" + ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "An encrypted filesystem in user-space via FUSE"; + homepage = https://vgough.github.io/encfs; + license = with licenses; [ gpl3 lgpl3 ]; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/exfat/default.nix b/nixpkgs/pkgs/tools/filesystems/exfat/default.nix new file mode 100644 index 000000000000..24db663aee02 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/exfat/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, fuse }: + +stdenv.mkDerivation rec { + pname = "exfat"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "relan"; + repo = "exfat"; + rev = "v${version}"; + sha256 = "1q29pcysv747y6dis07953dkax8k9x50b5gg99gpz6rr46xwgkgb"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + buildInputs = [ fuse ]; + + meta = with stdenv.lib; { + description = "Free exFAT file system implementation"; + inherit (src.meta) homepage; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ dywedir ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix b/nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix new file mode 100644 index 000000000000..40159b5fb6e6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ext4magic/default.nix @@ -0,0 +1,39 @@ +{ stdenv, fetchurl, fetchpatch, file, libuuid, e2fsprogs, zlib, bzip2 }: + +stdenv.mkDerivation rec { + version = "0.3.2"; + pname = "ext4magic"; + + src = fetchurl { + url = "mirror://sourceforge/ext4magic/${pname}-${version}.tar.gz"; + sha256 = "8d9c6a594f212aecf4eb5410d277caeaea3adc03d35378257dfd017ef20ea115"; + }; + + patches = [ + (fetchpatch { + url = https://sourceforge.net/p/ext4magic/tickets/10/attachment/ext4magic-0.3.2-i_dir_acl.patch; + sha256 = "1accydd8kigid68yir2fbihm3r3x8ws3iyznp25snkx41w6y6x8c"; + }) + ]; + + buildInputs = [ file libuuid e2fsprogs zlib bzip2 ]; + installFlags = [ "PREFIX=$(out)" ]; + + meta = with stdenv.lib; { + description = "Recover / undelete files from ext3 or ext4 partitions"; + longDescription = '' + ext4magic can recover/undelete files from ext3 or ext4 partitions + by retrieving file-information from the filesystem journal. + + If the information in the journal are sufficient, ext4magic can + recover the most file types, with original filename, owner and group, + file mode bits and also the old atime/mtime stamps. + + It's much more effective and works much better than extundelete. + ''; + homepage = http://ext4magic.sourceforge.net/ext4magic_en.html; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.rkoe ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/extundelete/default.nix b/nixpkgs/pkgs/tools/filesystems/extundelete/default.nix new file mode 100644 index 000000000000..b84992e1acbb --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/extundelete/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, e2fsprogs }: + +stdenv.mkDerivation { + version = "0.2.4"; + pname = "extundelete"; + + src = fetchurl { + url = "mirror://sourceforge/extundelete/extundelete-0.2.4.tar.bz2"; + sha256 = "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"; + }; + + buildInputs = [ e2fsprogs ]; + + # inode field i_dir_acl was repurposed as i_size_high in e2fsprogs 1.44, + # breaking the build + patchPhase = '' + substituteInPlace src/insertionops.cc \ + --replace "Directory ACL:" "High 32 bits of size:" \ + --replace "inode.i_dir_acl" "inode.i_size_high" + ''; + + meta = with stdenv.lib; { + description = "Utility that can recover deleted files from an ext3 or ext4 partition"; + homepage = http://extundelete.sourceforge.net/; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = [ maintainers.domenkozar ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix new file mode 100644 index 000000000000..c5ec523e247d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchgit, autoreconfHook, libselinux, libuuid, pkgconfig }: + +stdenv.mkDerivation rec { + pname = "f2fs-tools"; + version = "1.13.0"; + + src = fetchgit { + url = "https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git"; + rev = "refs/tags/v${version}"; + sha256 = "0h6wincsvg6s232ajxblg66r5nx87v00a4w7xkbxgbl1qyny477j"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + buildInputs = [ libselinux libuuid ]; + + patches = [ ./f2fs-tools-cross-fix.patch ]; + + meta = with stdenv.lib; { + homepage = http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/; + description = "Userland tools for the f2fs filesystem"; + license = licenses.gpl2; + platforms = platforms.linux; + maintainers = with maintainers; [ ehmry jagajaga ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch new file mode 100644 index 000000000000..e01a97b0bc3c --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/f2fs-tools/f2fs-tools-cross-fix.patch @@ -0,0 +1,29 @@ +diff --git a/configure.ac b/configure.ac +index 9b0e872..0108219 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -20,14 +20,16 @@ AC_DEFINE([F2FS_MINOR_VERSION], m4_bpatsubst(f2fs_tools_version, + [\([0-9]*\).\([0-9]*\)\(\w\|\W\)*], [\2]), + [Minor version for f2fs-tools]) + +-AS_IF([test -d .git],[ +- AC_DEFINE([F2FS_TOOLS_DATE], +- "m4_bpatsubst(f2fs_tools_gitdate, +- [\([0-9-]*\)\(\w\|\W\)*], [\1])", +- [f2fs-tools date based on Git commits])],[ +- AC_DEFINE([F2FS_TOOLS_DATE], +- "f2fs_tools_date", +- [f2fs-tools date based on Source releases])]) ++dnl AS_IF([test -d .git],[ ++dnl AC_DEFINE([F2FS_TOOLS_DATE], ++dnl "m4_bpatsubst(f2fs_tools_gitdate, ++dnl [\([0-9-]*\)\(\w\|\W\)*], [\1])", ++dnl [f2fs-tools date based on Git commits])],[ ++dnl AC_DEFINE([F2FS_TOOLS_DATE], ++dnl "f2fs_tools_date", ++dnl [f2fs-tools date based on Source releases])]) ++ ++AC_DEFINE([F2FS_TOOLS_DATE], "f2fs_tools_date", [f2fs-tools date based on Source releases]) + + AC_CONFIG_SRCDIR([config.h.in]) + AC_CONFIG_HEADER([config.h]) diff --git a/nixpkgs/pkgs/tools/filesystems/f3/default.nix b/nixpkgs/pkgs/tools/filesystems/f3/default.nix new file mode 100644 index 000000000000..d28875829388 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/f3/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchFromGitHub +, parted, udev +}: + +stdenv.mkDerivation rec { + pname = "f3"; + version = "7.2"; + + enableParallelBuilding = true; + + src = fetchFromGitHub { + owner = "AltraMayor"; + repo = pname; + rev = "v${version}"; + sha256 = "1iwdg0r4wkgc8rynmw1qcqz62l0ldgc8lrazq33msxnk5a818jgy"; + }; + + buildInputs = [ parted udev ]; + + patchPhase = "sed -i 's/-oroot -groot//' Makefile"; + + buildFlags = [ "all" # f3read, f3write + "extra" # f3brew, f3fix, f3probe + ]; + + installFlags = [ "PREFIX=$(out)" + "install" + "install-extra" + ]; + + meta = { + description = "Fight Flash Fraud"; + homepage = http://oss.digirati.com.br/f3/; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ makefu ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fatresize/default.nix b/nixpkgs/pkgs/tools/filesystems/fatresize/default.nix new file mode 100644 index 000000000000..5a60f8c055e5 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fatresize/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchurl, parted, utillinux }: + +stdenv.mkDerivation rec { + + version = "1.0.2"; + pname = "fatresize"; + + src = fetchurl { + url = "mirror://sourceforge/fatresize/fatresize-${version}.tar.bz2"; + sha256 = "04wp48jpdvq4nn0dgbw5za07g842rnxlh9mig4mslz70zqs0izjm"; + }; + + buildInputs = [ parted utillinux ]; + + # This patch helps this unmantained piece of software to be built against recent parted + # It basically modifies the detection scheme for parted version (the current one has no micro version defined) + # The second change is to include a header for a moved function since 1.6+ to current 3.1+ parted + # The third change is to modify the call to PED_ASSERT that is no longer defined with 2 params + patches = [ ./fatresize_parted_nix.patch ]; + + preConfigure = '' + echo "Replacing calls to ped_free with free ..." + substituteInPlace ./fatresize.c --replace ped_free free + ''; + + # Filesystem resize functions were reintroduced in parted 3.1 due to no other available free alternatives + # but in a sepparate library -> libparted-fs-resize --- that's why the added LDFLAG + makeFlags = [ "LDFLAGS=-lparted-fs-resize" ]; + + propagatedBuildInputs = [ parted utillinux ]; + + meta = with stdenv.lib; { + description = "The FAT16/FAT32 non-destructive resizer"; + homepage = https://sourceforge.net/projects/fatresize; + platforms = platforms.linux; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch b/nixpkgs/pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch new file mode 100644 index 000000000000..e9aa87a2d564 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch @@ -0,0 +1,74 @@ +diff --git a/aclocal.m4 b/aclocal.m4 +index 18e8176..2e75592 100644 +--- a/aclocal.m4 ++++ b/aclocal.m4 +@@ -88,8 +88,15 @@ int main () + if ( !(version = ped_get_version ()) ) + exit(1); + if (sscanf(version, "%d.%d.%d", &major, &minor, µ) != 3) { +- printf("%s, bad version string\n", version); +- exit(1); ++ if (sscanf(version, "%d.%d", &major, &minor) != 2) ++ { ++ printf("%s, bad version string\n", version); ++ exit(1); ++ } ++ else ++ { ++ micro = 0; ++ } + } + + if ((major > $parted_config_major_version) || +diff --git a/configure b/configure +index ed31457..e5f1705 100755 +--- a/configure ++++ b/configure +@@ -4793,8 +4793,15 @@ int main () + if ( !(version = ped_get_version ()) ) + exit(1); + if (sscanf(version, "%d.%d.%d", &major, &minor, µ) != 3) { +- printf("%s, bad version string\n", version); +- exit(1); ++ if (sscanf(version, "%d.%d", &major, &minor) != 2) ++ { ++ printf("%s, bad version string\n", version); ++ exit(1); ++ } ++ else ++ { ++ micro = 0; ++ } + } + + if ((major > $parted_config_major_version) || +diff --git a/fatresize.c b/fatresize.c +index 424d5d2..e439102 100644 +--- a/fatresize.c ++++ b/fatresize.c +@@ -30,6 +30,7 @@ + #include <inttypes.h> + #include <parted/parted.h> + #include <parted/debug.h> ++#include <parted/filesys.h> + #include <parted/unit.h> + + #include "config.h" +@@ -217,7 +218,7 @@ fatresize_handler(PedException *ex) + static int + snap(PedSector* sector, PedSector new_sector, PedGeometry* range) + { +- PED_ASSERT(ped_geometry_test_sector_inside (range, *sector), return 0); ++ PED_ASSERT(ped_geometry_test_sector_inside (range, *sector)); + if (!ped_geometry_test_sector_inside(range, new_sector)) + return 0; + +@@ -281,7 +282,7 @@ snap_to_boundaries (PedGeometry* new_geom, PedGeometry* old_geom, + end_part->geom.end, end_part->geom.start - 1, -1); + } + +- PED_ASSERT (start <= end, return); ++ PED_ASSERT (start <= end); + ped_geometry_set (new_geom, start, end - start + 1); + } + diff --git a/nixpkgs/pkgs/tools/filesystems/fatsort/default.nix b/nixpkgs/pkgs/tools/filesystems/fatsort/default.nix new file mode 100644 index 000000000000..aee053ad1355 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fatsort/default.nix @@ -0,0 +1,24 @@ +{stdenv, fetchurl, help2man}: + +stdenv.mkDerivation rec { + version = "1.5.0.456"; + pname = "fatsort"; + + src = fetchurl { + url = "mirror://sourceforge/fatsort/${pname}-${version}.tar.xz"; + sha256 = "15fy2m4p9s8cfvnzdcd5ynkc2js0zklkkf34sjxdac7x2iwb8dd8"; + }; + + patches = [ ./fatsort-Makefiles.patch ]; + + buildInputs = [ help2man ]; + + meta = with stdenv.lib; { + homepage = http://fatsort.sourceforge.net/; + description = "Sorts FAT partition table, for devices that don't do sorting of files"; + maintainers = [ maintainers.kovirobi ]; + license = licenses.gpl2; + inherit version; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch b/nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch new file mode 100644 index 000000000000..9c9f58e97ab4 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fatsort/fatsort-Makefiles.patch @@ -0,0 +1,31 @@ +diff -uNr fatsort-1.3.365-a/Makefile fatsort-1.3.365-b/Makefile +--- fatsort-1.3.365-a/Makefile 2014-04-08 19:19:36.000000000 +0100 ++++ fatsort-1.3.365-b/Makefile 2014-12-14 18:31:55.982857720 +0000 +@@ -1,4 +1,5 @@ +-MANDIR=/usr/local/share/man/man1 ++PREFIX=$(out) ++MANDIR=$(PREFIX)/share/man/man1 + + INSTALL_FLAGS=-m 0755 -p -D + +diff -uNr fatsort-1.3.365-a/src/Makefile fatsort-1.3.365-b/src/Makefile +--- fatsort-1.3.365-a/src/Makefile 2014-04-08 19:19:36.000000000 +0100 ++++ fatsort-1.3.365-b/src/Makefile 2014-12-14 18:32:08.282870461 +0000 +@@ -1,3 +1,5 @@ ++PREFIX=$(out) ++ + CC=gcc + LD=gcc + +@@ -33,9 +35,9 @@ + + # Mac OS X does not have a "/usr/local/sbin" + ifeq ($(UNAME),Darwin) +-SBINDIR=/usr/local/bin ++SBINDIR=$(PREFIX)/bin + else +-SBINDIR=/usr/local/sbin ++SBINDIR=$(PREFIX)/sbin + endif + + OBJ=fatsort.o FAT_fs.o fileio.o endianness.o signal.o entrylist.o errors.o options.o clusterchain.o sort.o misc.o natstrcmp.o stringlist.o diff --git a/nixpkgs/pkgs/tools/filesystems/file-rename/default.nix b/nixpkgs/pkgs/tools/filesystems/file-rename/default.nix new file mode 100644 index 000000000000..8eeb052b22f0 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/file-rename/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, perlPackages, makeWrapper }: + +perlPackages.buildPerlPackage { + pname = "File-Rename"; + version = "0.20"; + + src = fetchurl { + url = mirror://cpan/authors/id/R/RM/RMBARKER/File-Rename-0.20.tar.gz; + sha256 = "1cf6xx2hiy1xalp35fh8g73j67r0w0g66jpcbc6971x9jbm7bvjy"; + }; + + nativeBuildInputs = [ makeWrapper ]; + + postInstall = '' + wrapProgram $out/bin/rename \ + --prefix PERL5LIB : $out/${perlPackages.perl.libPrefix} + ''; + + doCheck = !stdenv.isDarwin; + + meta = with stdenv.lib; { + description = "Perl extension for renaming multiple files"; + license = licenses.artistic1; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fsfs/default.nix b/nixpkgs/pkgs/tools/filesystems/fsfs/default.nix new file mode 100644 index 000000000000..75e5280d391d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fsfs/default.nix @@ -0,0 +1,30 @@ +{stdenv, fetchurl, openssl, fuse}: + +throw "It still does not build" + +stdenv.mkDerivation { + name = "fsfs-0.1.1"; + src = fetchurl { + url = mirror://sourceforge/fsfs/fsfs-0.1.1.tar.gz; + sha256 = "05wka9aq182li2r7gxcd8bb3rhpns7ads0k59v7w1jza60l57c74"; + }; + + buildInputs = [ fuse openssl ]; + + patchPhase = '' + sed -i -e 's,CONFDIR=\(.*\),CONFDIR='$out/etc, \ + -e 's,USERCONFPREFIX=\(.*\),USERCONFPREFIX='$out/var/lib, Makefile \ + src/Makefile src/utils/Makefile + ''; + + preInstall = '' + mkdir -p $out/etc $out/var/lib + makeFlags="$makeFlags prefix=$out" + ''; + + meta = { + homepage = http://fsfs.sourceforge.net/; + description = "Secure distributed file system in user space"; + license = stdenv.lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix b/nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix new file mode 100644 index 000000000000..a8eb1118f4d3 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fuse-7z-ng/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchFromGitHub, fuse, p7zip, autoconf, automake, pkgconfig, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "fuse-7z-ng"; + version = "git-2014-06-08"; + + src = fetchFromGitHub { + owner = "kedazo"; + repo = pname; + rev = "eb5efb1f304c2b7bc2e0389ba06c9bf2ac4b932c"; + sha256 = "17v1gcmg5q661b047zxjar735i4d3508dimw1x3z1pk4d1zjhp3x"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse autoconf automake makeWrapper ]; + + preConfigure = "./autogen.sh"; + + libs = stdenv.lib.makeLibraryPath [ p7zip ]; # 'cause 7z.so is loaded manually + postInstall = '' + wrapProgram $out/bin/${pname} --suffix LD_LIBRARY_PATH : "${libs}/p7zip" + + mkdir -p $out/share/doc/${pname} + cp TODO README NEWS COPYING ChangeLog AUTHORS $out/share/doc/${pname}/ + ''; + + meta = with stdenv.lib; { + inherit version; + inherit (src.homepage); + description = "A FUSE-based filesystem that uses the p7zip library"; + longDescription = '' + fuse-7z-ng is a FUSE file system that uses the p7zip + library to access all archive formats supported by 7-zip. + + This project is a fork of fuse-7z ( https://gitorious.org/fuse-7z/fuse-7z ). + ''; + platforms = platforms.linux; + license = licenses.gpl3Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix b/nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix new file mode 100644 index 000000000000..0d7bcdcd0f26 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fuse-overlayfs/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, fuse3 }: + +stdenv.mkDerivation rec { + pname = "fuse-overlayfs"; + version = "0.7.2"; + + src = fetchFromGitHub { + owner = "containers"; + repo = pname; + rev = "v${version}"; + sha256 = "1ybrki63ixrkraynms5i4jiil9901whwxs6p61h2c2ild8w2ir8n"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + + buildInputs = [ fuse3 ]; + + meta = with lib; { + description = "FUSE implementation for overlayfs"; + longDescription = "An implementation of overlay+shiftfs in FUSE for rootless containers."; + license = licenses.gpl3; + maintainers = with maintainers; [ ma9e ]; + platforms = platforms.unix; + inherit (src.meta) homepage; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix b/nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix new file mode 100644 index 000000000000..41c4cc84f966 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/fuseiso/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, fetchpatch, pkgconfig, fuse, zlib, glib }: + +stdenv.mkDerivation { + name = "fuseiso-20070708"; + + src = fetchurl { + url = "mirror://sourceforge/project/fuseiso/fuseiso/20070708/fuseiso-20070708.tar.bz2"; + sha256 = "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse zlib glib ]; + + patches = let fetchPatchFromDebian = { patch, sha256 }: + fetchpatch { + inherit sha256; + url = "https://sources.debian.net/data/main/f/fuseiso/20070708-3.2/debian/patches/${patch}"; + }; + in [ + (fetchPatchFromDebian { + patch = "00-support_large_iso.patch"; + sha256 = "1lmclb1qwzz5f4wlq693g83bblwnjjl73qhgfxbsaac5hnn2shjw"; + }) + (fetchPatchFromDebian { # CVE-2015-8837 + patch = "02-prevent-buffer-overflow.patch"; + sha256 = "1ls2pp3mh91pdb51qz1fsd8pwhbky6988bpd156bn7wgfxqzh8ig"; + }) + (fetchPatchFromDebian { # CVE-2015-8836 + patch = "03-prevent-integer-overflow.patch"; + sha256 = "100cw07fk4sa3hl7a1gk2hgz4qsxdw99y20r7wpidwwwzy463zcv"; + }) + ]; + + meta = { + homepage = https://sourceforge.net/projects/fuseiso; + description = "FUSE module to mount ISO filesystem images"; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix new file mode 100644 index 000000000000..af3e92509853 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gcsfuse/default.nix @@ -0,0 +1,28 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "gcsfuse"; + version = "0.28.1"; + + src = fetchFromGitHub { + owner = "googlecloudplatform"; + repo = "gcsfuse"; + rev = "v${version}"; + sha256 = "0dh01qvsjlzji2mwznykc2nghg4f1raylvgnp6sbxv9x1kpnwx71"; + }; + + modSha256 = "0i86xs3lq2mj22yv7jmhmb34k7lz348bakqz020xpyccllkkszy4"; + + patches = [ + ./go.mod.patch + ./go.sum.patch + ]; + + meta = with lib;{ + description = "A user-space file system for interacting with Google Cloud Storage"; + homepage = "https://cloud.google.com/storage/docs/gcs-fuse"; + license = licenses.asl20; + platforms = platforms.unix; + maintainers = []; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/gcsfuse/go.mod.patch b/nixpkgs/pkgs/tools/filesystems/gcsfuse/go.mod.patch new file mode 100644 index 000000000000..fbda63432d7c --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gcsfuse/go.mod.patch @@ -0,0 +1,28 @@ +--- a/go.mod 2019-10-09 22:35:05.777065057 -0400 ++++ b/go.mod 2019-10-10 21:34:15.809681738 -0400 +@@ -0,0 +1,25 @@ ++module github.com/googlecloudplatform/gcsfuse ++ ++go 1.12 ++ ++require ( ++ cloud.google.com/go v0.0.0-20170807235027-9be7f826df5c ++ github.com/codegangsta/cli v0.0.0-20170804093415-b99aa811b4c1 ++ github.com/golang/protobuf v0.0.0-20170902000452-17ce1425424a ++ github.com/jacobsa/daemonize v0.0.0-20160101105449-e460293e890f ++ github.com/jacobsa/fuse v0.0.0-20170513050233-fe7f3a55dcaa ++ github.com/jacobsa/gcloud v0.0.0-20180124212516-9291bd1e8308 ++ github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd ++ github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff ++ github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11 ++ github.com/jacobsa/ratelimit v0.0.0-20150904001804-f5e47030f3b0 ++ github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb ++ github.com/jacobsa/syncutil v0.0.0-20150827001642-c39ef5c1aa0b ++ github.com/jacobsa/timeutil v0.0.0-20170205232429-577e5acbbcf6 ++ github.com/jacobsa/util v0.0.0-20150810040848-976a6f4de67e ++ github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 ++ golang.org/x/net v0.0.0-20170809000501-1c05540f6879 ++ golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95 ++ google.golang.org/api v0.0.0-20170807210121-5c4ffd5985e2 ++ google.golang.org/appengine v0.0.0-20170801183137-c5a90ac045b7 ++) diff --git a/nixpkgs/pkgs/tools/filesystems/gcsfuse/go.sum.patch b/nixpkgs/pkgs/tools/filesystems/gcsfuse/go.sum.patch new file mode 100644 index 000000000000..d537266e3c12 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gcsfuse/go.sum.patch @@ -0,0 +1,38 @@ +--- a/go.sum 2019-10-09 22:35:05.777065057 -0400 ++++ b/go.sum 2019-10-10 21:34:15.809681738 -0400 +@@ -0,0 +1,35 @@ ++cloud.google.com/go v0.0.0-20170807235027-9be7f826df5c h1:pTb3uxaVLke7AQ/KUVTHWZmzKrKYrip7FimNb3ecAbo= ++cloud.google.com/go v0.0.0-20170807235027-9be7f826df5c/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= ++github.com/codegangsta/cli v0.0.0-20170804093415-b99aa811b4c1 h1:PTPzzngHWcTI0ph/9I92RhVtRkdOCi37wySw/ojR5Eg= ++github.com/codegangsta/cli v0.0.0-20170804093415-b99aa811b4c1/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= ++github.com/golang/protobuf v0.0.0-20170902000452-17ce1425424a/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= ++github.com/jacobsa/daemonize v0.0.0-20160101105449-e460293e890f h1:X+tnaqoCcBgAwSTJtoYW6p0qKiuPyMfofEHEFUf2kdU= ++github.com/jacobsa/daemonize v0.0.0-20160101105449-e460293e890f/go.mod h1:Ip4fOwzCrnDVuluHBd7FXIMb7SHOKfkt9/UDrYSZvqI= ++github.com/jacobsa/fuse v0.0.0-20170513050233-fe7f3a55dcaa h1:3420E523ahKsI3tlbO0zeLvgzuTFdJoy6JoAVuShs8U= ++github.com/jacobsa/fuse v0.0.0-20170513050233-fe7f3a55dcaa/go.mod h1:9Aml1MG17JVeXrN4D2mtJvYHtHklJH5bESjCKNzVjFU= ++github.com/jacobsa/gcloud v0.0.0-20180124212516-9291bd1e8308 h1:sfc1gTCrsJQJMySgDstAhwzogqQIrTxkwwScG4p2kbM= ++github.com/jacobsa/gcloud v0.0.0-20180124212516-9291bd1e8308/go.mod h1:3fF6sEraNZSToePaj5q+f9KSaMpuZcwccqAQmOKDv/k= ++github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd h1:9GCSedGjMcLZCrusBZuo4tyKLpKUPenUUqi34AkuFmA= ++github.com/jacobsa/oglematchers v0.0.0-20150720000706-141901ea67cd/go.mod h1:TlmyIZDpGmwRoTWiakdr+HA1Tukze6C6XbRVidYq02M= ++github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff h1:2xRHTvkpJ5zJmglXLRqHiZQNjUoOkhUyhTAhEQvPAWw= ++github.com/jacobsa/oglemock v0.0.0-20150831005832-e94d794d06ff/go.mod h1:gJWba/XXGl0UoOmBQKRWCJdHrr3nE0T65t6ioaj3mLI= ++github.com/jacobsa/ogletest v0.0.0-20170503003838-80d50a735a11/go.mod h1:+DBdDyfoO2McrOyDemRBq0q9CMEByef7sYl7JH5Q3BI= ++github.com/jacobsa/ratelimit v0.0.0-20150904001804-f5e47030f3b0 h1:6GaIakaFrxn738iBykUc6fyS5sIAKRg/wafwzrzRX30= ++github.com/jacobsa/ratelimit v0.0.0-20150904001804-f5e47030f3b0/go.mod h1:5/sdn6lSZE5l3rXMkJGO7Y3MHJImklO43rZx9ouOWYQ= ++github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb h1:uSWBjJdMf47kQlXMwWEfmc864bA1wAC+Kl3ApryuG9Y= ++github.com/jacobsa/reqtrace v0.0.0-20150505043853-245c9e0234cb/go.mod h1:ivcmUvxXWjb27NsPEaiYK7AidlZXS7oQ5PowUS9z3I4= ++github.com/jacobsa/syncutil v0.0.0-20150827001642-c39ef5c1aa0b h1:HMNP0njxow/ahg3AFKzu8HnyOUSRiVqWXm+i4VefV+Y= ++github.com/jacobsa/syncutil v0.0.0-20150827001642-c39ef5c1aa0b/go.mod h1:mPvulh9VKXvo+yOlrD4VYOOYuLdZJ36wa/5QIrtXvWs= ++github.com/jacobsa/timeutil v0.0.0-20170205232429-577e5acbbcf6 h1:XKHJmHcgU9glxk3eLPiRZT5VFSHJitVTnMj/EgIoXC4= ++github.com/jacobsa/timeutil v0.0.0-20170205232429-577e5acbbcf6/go.mod h1:JEWKD6V8xETMW+DEv+IQVz++f8Cn8O/X0HPeDY3qNis= ++github.com/jacobsa/util v0.0.0-20150810040848-976a6f4de67e h1:BegecLAVSx5IW1bOImB8Lt6+4yiWP4t+PUeckWYzIeg= ++github.com/jacobsa/util v0.0.0-20150810040848-976a6f4de67e/go.mod h1:q0HiLetNeSPHjs8ddOw9U6xahog8xR7WPp6PhzJ6wmk= ++github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro= ++github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= ++golang.org/x/net v0.0.0-20170809000501-1c05540f6879 h1:0rFa7EaCGdQPmZVbo9F7MNF65b8dyzS6EUnXjs9Cllk= ++golang.org/x/net v0.0.0-20170809000501-1c05540f6879/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= ++golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95 h1:RS+wSrhdVci7CsPwJaMN8exaP3UTuQU0qB34R/E/JD0= ++golang.org/x/oauth2 v0.0.0-20170807180024-9a379c6b3e95/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= ++google.golang.org/api v0.0.0-20170807210121-5c4ffd5985e2 h1:wF/9eBxkxh3/00HWCFpF3583KFXGapuZ3EVpZIuLd4Q= ++google.golang.org/api v0.0.0-20170807210121-5c4ffd5985e2/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= ++google.golang.org/appengine v0.0.0-20170801183137-c5a90ac045b7/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix b/nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix new file mode 100644 index 000000000000..0ef85abd2b77 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/genext2fs/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "genext2fs-1.4.1"; + + src = fetchurl { + url = mirror://sourceforge/genext2fs/genext2fs-1.4.1.tar.gz; + sha256 = "1z7czvsf3ircvz2cw1cf53yifsq29ljxmj15hbgc79l6gbxbnka0"; + }; + + # https://sourceforge.net/p/genext2fs/bugs/2/ + # Will be fixed in the next release, whenever this happens + postPatch = '' + sed -e 's@4 [*] (EXT2_TIND_BLOCK+1)@-1+&@' -i genext2fs.c + ''; + + meta = with stdenv.lib; { + homepage = http://genext2fs.sourceforge.net/; + description = "A tool to generate ext2 filesystem images without requiring root privileges"; + license = licenses.gpl2; + platforms = platforms.all; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/genimage/default.nix b/nixpkgs/pkgs/tools/filesystems/genimage/default.nix new file mode 100644 index 000000000000..e905222ad45e --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/genimage/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, pkgconfig, libconfuse, gettext }: + +stdenv.mkDerivation rec { + pname = "genimage"; + version = "9"; + + src = fetchurl { + url = "https://public.pengutronix.de/software/genimage/genimage-${version}.tar.xz"; + sha256 = "0y4h8x8lqxam8m90rdfq8cg5137kvilxr3d1qzddpx7nxpvmmwv9"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ libconfuse gettext ]; + + postInstall = '' + # As there is no manpage or built-in --help, add the README file for + # documentation. + docdir="$out/share/doc/genimage" + mkdir -p "$docdir" + cp -v README "$docdir" + ''; + + meta = with stdenv.lib; { + homepage = https://git.pengutronix.de/cgit/genimage; + description = "Generate filesystem images from directory trees"; + license = licenses.gpl2Plus; + platforms = platforms.all; + maintainers = [ maintainers.bjornfor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/genromfs/default.nix b/nixpkgs/pkgs/tools/filesystems/genromfs/default.nix new file mode 100644 index 000000000000..1e6c73f725a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/genromfs/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + version = "0.5.2"; + pname = "genromfs"; + + src = fetchurl { + url = "mirror://sourceforge/romfs/genromfs/${version}/${pname}-${version}.tar.gz"; + sha256 = "0q6rpq7cmclmb4ayfyknvzbqysxs4fy8aiahlax1sb2p6k3pzwrh"; + }; + + postPatch = '' + substituteInPlace Makefile \ + --replace "prefix = /usr" "prefix = $out" \ + --replace "gcc" "cc" + ''; + + meta = with stdenv.lib; { + homepage = http://romfs.sourceforge.net/; + description = "Tool for creating romfs file system images"; + license = licenses.gpl2; + maintainers = with maintainers; [ pxc ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/gitfs/default.nix b/nixpkgs/pkgs/tools/filesystems/gitfs/default.nix new file mode 100644 index 000000000000..5b3794146665 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gitfs/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchFromGitHub, python2Packages }: + +python2Packages.buildPythonApplication rec { + pname = "gitfs"; + version = "0.5.2"; + + src = fetchFromGitHub { + owner = "PressLabs"; + repo = "gitfs"; + rev = version; + sha256 = "1jzwdwan8ndvp2lw6j7zbvg5k9rgf2d8dcxjrwc6bwyk59xdxn4p"; + }; + + patchPhase = '' + # requirement checks are unnecessary at runtime + echo > requirements.txt + ''; + + buildInputs = with python2Packages; [ pytest pytestcov mock ]; + propagatedBuildInputs = with python2Packages; [ atomiclong fusepy pygit2 ]; + + checkPhase = "py.test"; + doCheck = false; + + meta = { + description = "A FUSE filesystem that fully integrates with git"; + longDescription = '' + A git remote repository's branch can be mounted locally, + and any subsequent changes made to the files will be + automatically committed to the remote. + ''; + homepage = https://github.com/PressLabs/gitfs; + license = stdenv.lib.licenses.asl20; + platforms = stdenv.lib.platforms.linux; + maintainers = [ stdenv.lib.maintainers.robbinch ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix b/nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix new file mode 100644 index 000000000000..b5fc12024b17 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/glusterfs/default.nix @@ -0,0 +1,194 @@ +{stdenv, fetchurl, fuse, bison, flex_2_5_35, openssl, python3, ncurses, readline, + autoconf, automake, libtool, pkgconfig, zlib, libaio, libxml2, acl, sqlite, + liburcu, attr, makeWrapper, coreutils, gnused, gnugrep, which, + openssh, gawk, findutils, utillinux, lvm2, btrfs-progs, e2fsprogs, xfsprogs, systemd, + rsync, glibc +}: +let + s = + rec { + baseName="glusterfs"; + # NOTE: On each glusterfs release, it should be checked if gluster added + # new, or changed, Python scripts whose PYTHONPATH has to be set in + # `postFixup` below, and whose runtime deps need to go into + # `nativeBuildInputs`. + # The command + # find /nix/store/...-glusterfs-.../ -name '*.py' -executable + # can help with finding new Python scripts. + version = "7.1"; + name="${baseName}-${version}"; + url="https://github.com/gluster/glusterfs/archive/v${version}.tar.gz"; + sha256 = "11v5hwijbb08xq3dd4m6bkspa3v4vjzcnw6j1qyh0gjmc7yy4ml3"; + }; + + buildInputs = [ + fuse bison flex_2_5_35 openssl ncurses readline + autoconf automake libtool pkgconfig zlib libaio libxml2 + acl sqlite liburcu attr makeWrapper utillinux + (python3.withPackages (pkgs: [ + pkgs.flask + pkgs.prettytable + pkgs.requests + pkgs.pyxattr + ])) + # NOTE: `python3` has to be *AFTER* the above `python3.withPackages`, + # to ensure that the packages are available but the `toPythonPath` + # shell function used in `postFixup` is also still available. + python3 + ]; + # Some of the headers reference acl + propagatedBuildInputs = [ + acl + ]; + # Packages from which GlusterFS calls binaries at run-time from PATH, + # with comments on which commands are known to be called by it. + runtimePATHdeps = [ + attr # getfattr setfattr + btrfs-progs # btrfs + coreutils # lots of commands in bash scripts + e2fsprogs # tune2fs + findutils # find + gawk # awk + glibc # getent + gnugrep # grep + gnused # sed + lvm2 # lvs + openssh # ssh + rsync # rsync, e.g. for geo-replication + systemd # systemctl + utillinux # mount umount + which # which + xfsprogs # xfs_info + ]; +in +stdenv.mkDerivation +{ + inherit (s) name version; + inherit buildInputs propagatedBuildInputs; + + patches = [ + # Remove when https://bugzilla.redhat.com/show_bug.cgi?id=1489610 is fixed + ./glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch + ]; + + postPatch = '' + sed -e '/chmod u+s/d' -i contrib/fuse-util/Makefile.am + ''; + + # Note that the VERSION file is something that is present in release tarballs + # but not in git tags (at least not as of writing in v3.10.1). + # That's why we have to create it. + # Without this, gluster (at least 3.10.1) will fail very late and cryptically, + # for example when setting up geo-replication, with a message like + # Staging of operation 'Volume Geo-replication Create' failed on localhost : Unable to fetch master volume details. Please check the master cluster and master volume. + # What happens here is that the gverify.sh script tries to compare the versions, + # but fails when the version is empty. + # See upstream GlusterFS bug https://bugzilla.redhat.com/show_bug.cgi?id=1452705 + preConfigure = '' + echo "v${s.version}" > VERSION + ./autogen.sh + export PYTHON=${python3}/bin/python + ''; + + configureFlags = [ + ''--localstatedir=/var'' + ]; + + makeFlags = [ "DESTDIR=$(out)" ]; + + enableParallelBuilding = true; + + postInstall = '' + cp -r $out/$out/* $out + rm -r $out/nix + ''; + + postFixup = '' + # glusterd invokes `gluster` and other utilities when telling other glusterd nodes to run commands. + # For example for `peer_georep-sshkey` key generation, so `$out/bin` is needed in the PATH. + # It also invokes bash scripts like `gverify.sh`. + # It also invokes executable Python scripts in `$out/libexec/glusterfs`, which is why we set up PYTHONPATH accordingly. + # We set up the paths for the main entry point executables. + + GLUSTER_PATH="${stdenv.lib.makeBinPath runtimePATHdeps}:$out/bin" + GLUSTER_PYTHONPATH="$(toPythonPath $out):$out/libexec/glusterfs" + GLUSTER_LD_LIBRARY_PATH="$out/lib" + + wrapProgram $out/bin/glusterd --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/bin/gluster --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/sbin/mount.glusterfs --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + + # Set Python environment for the Python based utilities. + # It would be nice if there was a better way to do this, automatically for all of them. + # Also, this is brittle: If we forget a dependency or gluster adds a new one, things will break deep inside gluster. + # We should better try to get an explicit list of Python dependencies from gluster and ensure all of them are in the PYTHONPATH of all these python scripts. + # But at the time of writing (gluster 3.10), gluster only provides this in form of a gluster.spec file for RPM creation, + # and even that one is not complete (for example it doesn't mention the `flask` dependency). + + wrapProgram $out/bin/gluster-eventsapi --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/bin/gluster-georep-sshkey --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/bin/gluster-mountbroker --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/bin/glusterfind --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + + # Note that we only wrap the symlinks in $out/bin, not the actual executable scripts in $out/libexec/glusterfs. + # This is because those scripts use `__file__` in their program logic + # (see https://github.com/gluster/glusterfs/blob/v3.10.1/extras/cliutils/cliutils.py#L116) + # which would break if we changed the file name (which is what `wrapProgram` does). + # Luckily, `libexec` scripts are never supposed to be invoked straight from PATH, + # instead they are invoked directly from `gluster` or `glusterd`, which is why it is + # sufficient to set PYTHONPATH for those executables. + # + # Exceptions to these rules are the `glusterfind` `brickfind.py` and `changelog.py` + # crawlers, which are directly invoked on other gluster nodes using a remote SSH command + # issues by `glusterfind`. + + wrapProgram $out/share/glusterfs/scripts/eventsdash.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/libexec/glusterfs/glusterfind/brickfind.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + wrapProgram $out/libexec/glusterfs/glusterfind/changelog.py --set PATH "$GLUSTER_PATH" --set PYTHONPATH "$GLUSTER_PYTHONPATH" --set LD_LIBRARY_PATH "$GLUSTER_LD_LIBRARY_PATH" + ''; + + doInstallCheck = true; + + # Below we run Python programs. That generates .pyc/.pyo files. + # By default they are indeterministic because such files contain time stamps + # (see https://nedbatchelder.com/blog/200804/the_structure_of_pyc_files.html). + # So we use the same environment variables as in + # https://github.com/NixOS/nixpkgs/blob/249b34aadca7038207492f29142a3456d0cecec3/pkgs/development/interpreters/python/mk-python-derivation.nix#L61 + # to make these files deterministic. + # A general solution to this problem might be brought by #25707. + DETERMINISTIC_BUILD = 1; + PYTHONHASHSEED = 0; + + installCheckPhase = '' + # Tests that the above programs work without import errors. + # For testing it manually in a shell you may want to substitute `$out` with `$(dirname $(readlink -f $(which gluster)))/../`. + $out/bin/glusterd --help + # $out/bin/gluster help # can't do this because even `gluster help` tries to write to `/var/log/glusterfs/cli.log` + $out/bin/gluster-eventsapi --help + $out/bin/gluster-georep-sshkey --help + $out/bin/gluster-mountbroker --help + $out/bin/glusterfind --help + # gfid_to_path.py doesn't accept --help, and it requires different arguments + # (a dir as single argument) than the usage prints when stdin is not a TTY. + # The `echo ""` is just so that stdin is not a TTY even if you try this line + # on a real TTY for testing purposes. + echo "" | (mkdir -p nix-test-dir-for-gfid_to_path && touch b && $out/libexec/glusterfs/gfind_missing_files/gfid_to_path.py nix-test-dir-for-gfid_to_path) + $out/share/glusterfs/scripts/eventsdash.py --help + + # this gets falsely loaded as module by glusterfind + rm -r $out/bin/conf.py + ''; + + src = fetchurl { + inherit (s) url sha256; + }; + + meta = with stdenv.lib; { + inherit (s) version; + description = "Distributed storage system"; + homepage = https://www.gluster.org; + license = licenses.lgpl3Plus; # dual licese: choice of lgpl3Plus or gpl2 + maintainers = [ maintainers.raskin ]; + platforms = with platforms; linux ++ freebsd; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch b/nixpkgs/pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch new file mode 100644 index 000000000000..f08d73cf3a65 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/glusterfs/glusterfs-fix-bug-1489610-glusterfind-var-data-under-prefix.patch @@ -0,0 +1,27 @@ +From f523afac49e24ecc0fa4ad85195135689cf445f0 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me> +Date: Wed, 27 Sep 2017 21:36:41 +0200 +Subject: [PATCH] Fix "glusterfind saves var data under $prefix instead of + localstatedir". Fixes #1489610 + +Change-Id: Id2362c20f34346c37acfb9eb1ad105d0b7b8b60f +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index f87d8a454..b4d3f5d10 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1118,7 +1118,7 @@ if test "x$exec_prefix" = xNONE; then + exec_prefix="$(eval echo $prefix)" + fi + GLUSTERFS_LIBEXECDIR="$(eval echo $libexecdir)/glusterfs" +-GLUSTERFSD_MISCDIR="$(eval echo $prefix)/var/lib/misc/glusterfsd" ++GLUSTERFSD_MISCDIR="$(eval echo $localstatedir)/lib/misc/glusterfsd" + prefix=$old_prefix + exec_prefix=$old_exec_prefix + +-- +2.12.0 + diff --git a/nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix new file mode 100644 index 000000000000..605e341c4d77 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/default.nix @@ -0,0 +1,20 @@ +{ pkgconfig, libusb1, buildGoPackage, fetchgit }: + +buildGoPackage rec { + pname = "go-mtpfs"; + version = "2018-02-09"; + rev = "d6f8f3c05ce0ed31435057ec342268a0735863bb"; + + goPackagePath = "github.com/hanwen/go-mtpfs"; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ libusb1 ]; + + src = fetchgit { + inherit rev; + url = "https://github.com/hanwen/go-mtpfs"; + sha256 = "0a0d5dy92nzp1czh87hx3xfdcpa4jh14j0b64c025ha62s9a4gxk"; + }; + + goDeps = ./deps.nix; +} diff --git a/nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix new file mode 100644 index 000000000000..f558a53f7d2d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/go-mtpfs/deps.nix @@ -0,0 +1,30 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.3.0 +[ + { + goPackagePath = "github.com/hanwen/go-fuse"; + fetch = { + type = "git"; + url = "https://github.com/hanwen/go-fuse"; + rev = "d1c826d19ad0c8d0c7e5b4eb34ee0f2ae09f6cef"; + sha256 = "0hn2iqsb6rip2b05fvcngyh0sazln2h3fx18khq4fv41n1iy11dc"; + }; + } + { + goPackagePath = "github.com/hanwen/usb"; + fetch = { + type = "git"; + url = "https://github.com/hanwen/usb"; + rev = "69aee4530ac705cec7c5344418d982aaf15cf0b1"; + sha256 = "01k0c2g395j65vm1w37mmrfkg6nm900khjrrizzpmx8f8yf20dky"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "48ac38b7c8cbedd50b1613c0fccacfc7d88dfcdf"; + sha256 = "037vs8sdvq310j3b6z9k62zlby1mzmsr9ha01rcy98dv5v8bkhin"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix b/nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix new file mode 100644 index 000000000000..8491bf20e8f1 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gocryptfs/default.nix @@ -0,0 +1,50 @@ +# This file was generated by https://github.com/kamilchm/go2nix v1.2.1 +{ stdenv, buildGoPackage, fetchFromGitHub, openssl, pandoc, pkgconfig }: + +let + goFuseVersion = with stdenv.lib; substring 0 7 (head (filter ( + d: d.goPackagePath == "github.com/hanwen/go-fuse" + ) (import ./deps.nix))).fetch.rev; +in +buildGoPackage rec { + pname = "gocryptfs"; + version = "1.7.1"; + + goPackagePath = "github.com/rfjakob/gocryptfs"; + + nativeBuildInputs = [ pandoc pkgconfig ]; + buildInputs = [ openssl ]; + + src = fetchFromGitHub { + owner = "rfjakob"; + repo = pname; + rev = "v${version}"; + sha256 = "1zhzhvjhvi6xzib985bsnj9yzp4zsnm91m1679nbab6vm3kanq06"; + }; + + postPatch = "rm -r tests"; + + buildFlagsArray = '' + -ldflags= + -X main.GitVersion=${version} + -X main.GitVersionFuse=${goFuseVersion} + ''; + + goDeps = ./deps.nix; + + postBuild = '' + pushd go/src/github.com/rfjakob/gocryptfs/Documentation/ + mkdir -p $out/share/man/man1 + pandoc MANPAGE.md -s -t man -o $out/share/man/man1/gocryptfs.1 + pandoc MANPAGE-XRAY.md -s -t man -o $out/share/man/man1/gocryptfs-xray.1 + popd + ''; + + meta = with stdenv.lib; { + description = "Encrypted overlay filesystem written in Go"; + license = licenses.mit; + homepage = https://nuetzlich.net/gocryptfs/; + maintainers = with maintainers; [ flokli offline ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/gocryptfs/deps.nix b/nixpkgs/pkgs/tools/filesystems/gocryptfs/deps.nix new file mode 100644 index 000000000000..cebad12327e0 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gocryptfs/deps.nix @@ -0,0 +1,75 @@ +# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix) +[ + { + goPackagePath = "github.com/hanwen/go-fuse"; + fetch = { + type = "git"; + url = "https://github.com/hanwen/go-fuse"; + rev = "161a164844568ebf4bfaa68c90ba3a9f2914dda4"; + sha256 = "1r0rs76k9zg60i02jlcqxi7m4ivla1xwv3ijwav7pfbyyr1yqhsx"; + }; + } + { + goPackagePath = "github.com/jacobsa/crypto"; + fetch = { + type = "git"; + url = "https://github.com/jacobsa/crypto"; + rev = "9f44e2d11115452dad8f404f029574422855f46a"; + sha256 = "18c3cx8izxdajq22zdq0n19j9d2l6iickd3mz39j5h96kw7l5qmy"; + }; + } + { + goPackagePath = "github.com/pkg/xattr"; + fetch = { + type = "git"; + url = "https://github.com/pkg/xattr"; + rev = "7782c2d6871d6e659e1563dc19c86b845264a6fc"; + sha256 = "1j3z5b9nwgkxia925rkiq8n5avhf4zhmsdbpn2s3xb16a2w66prd"; + }; + } + { + goPackagePath = "github.com/rfjakob/eme"; + fetch = { + type = "git"; + url = "https://github.com/rfjakob/eme"; + rev = "2222dbd4ba467ab3fc7e8af41562fcfe69c0d770"; + sha256 = "0c227ly3z8pqaqg22lpd8nzgqrfsbjx5gi9rp9ks1cmd11dv2gl9"; + }; + } + { + goPackagePath = "github.com/sabhiram/go-gitignore"; + fetch = { + type = "git"; + url = "https://github.com/sabhiram/go-gitignore"; + rev = "d3107576ba9425fc1c85f4b3569c4631b805a02e"; + sha256 = "1rdwyxgcsiwgmlqnc3k6h300mzlvjc3j21np4yh1h476wc8dvl0l"; + }; + } + { + goPackagePath = "golang.org/x/crypto"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/crypto"; + rev = "a1f597ede03a7bef967a422b5b3a5bd08805a01e"; + sha256 = "0yiczljll72ip2vkxgd6052rhpaba37a68vf6si3v8s8s3g870lc"; + }; + } + { + goPackagePath = "golang.org/x/sync"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sync"; + rev = "e225da77a7e68af35c70ccbf71af2b83e6acac3c"; + sha256 = "0bh3583smcfw6jw3w6lp0za93rz7hpxfdz8vhxng75b7a6vdlw4p"; + }; + } + { + goPackagePath = "golang.org/x/sys"; + fetch = { + type = "git"; + url = "https://go.googlesource.com/sys"; + rev = "61b9204099cb1bebc803c9ffb9b2d3acd9d457d9"; + sha256 = "110carnw1rxk9awbcdbg5is0zl28vynm649y7rza36pg1vlv8rrh"; + }; + } +] diff --git a/nixpkgs/pkgs/tools/filesystems/gpart/default.nix b/nixpkgs/pkgs/tools/filesystems/gpart/default.nix new file mode 100644 index 000000000000..59b4785888b2 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/gpart/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "gpart"; + version = "0.3"; + + # GitHub repository 'collating patches for gpart from all distributions': + src = fetchFromGitHub { + sha256 = "1lsd9k876p944k9s6sxqk5yh9yr7m42nbw9vlsllin7pd4djl4ya"; + rev = version; + repo = "gpart"; + owner = "baruch"; + }; + + nativeBuildInputs = [ autoreconfHook ]; + + enableParallelBuilding = true; + + doCheck = true; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "Guess PC-type hard disk partitions"; + longDescription = '' + Gpart is a tool which tries to guess the primary partition table of a + PC-type hard disk in case the primary partition table in sector 0 is + damaged, incorrect or deleted. The guessed table can be written to a file + or device. + ''; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/grive2/default.nix b/nixpkgs/pkgs/tools/filesystems/grive2/default.nix new file mode 100644 index 000000000000..f325fc97e32c --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/grive2/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, pkgconfig, yajl, cmake, libgcrypt, curl, expat, boost, libiberty }: + +stdenv.mkDerivation rec { + version = "0.5.1"; + pname = "grive2"; + + src = fetchFromGitHub { + owner = "vitalif"; + repo = "grive2"; + rev = "v${version}"; + sha256 = "1kv34ys8qarjsxpb1kd8dp7b3b4ycyiwjzd6mg97d3jk7405g6nm"; + }; + + nativeBuildInputs = [ cmake pkgconfig ]; + + buildInputs = [ libgcrypt yajl curl expat stdenv boost libiberty ]; + + meta = with stdenv.lib; { + description = "A console Google Drive client"; + homepage = https://github.com/vitalif/grive2; + license = licenses.gpl2; + platforms = platforms.linux; + }; + +} diff --git a/nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix new file mode 100644 index 000000000000..2032ca1c1e75 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/hfsprogs/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchurl, openssl, libbsd }: + +let version = "332.25"; + package_name = "hfsprogs"; in +stdenv.mkDerivation { + name = "${package_name}-${version}"; + srcs = [ + (fetchurl { + url = "http://ftp.de.debian.org/debian/pool/main/h/hfsprogs/${package_name}_${version}-11.debian.tar.gz"; + sha256 = "62d9b8599c66ebffbc57ce5d776e20b41341130d9b27341d63bda08460ebde7c"; + }) + (fetchurl { + url = "https://opensource.apple.com/tarballs/diskdev_cmds/diskdev_cmds-${version}.tar.gz"; + sha256 = "74c9aeca899ed7f4bf155c65fc45bf0f250c0f6d57360ea953b1d536d9aa45e6"; + }) + ]; + + sourceRoot = "diskdev_cmds-" + version; + patches = [ "../debian/patches/*.patch" ]; + + buildInputs = [ openssl libbsd ]; + makefile = "Makefile.lnx"; + + # Inspired by PKGBUILD of https://www.archlinux.org/packages/community/x86_64/hfsprogs/ + installPhase = '' + # Create required package directories + install -m 755 -d "$out/bin" + install -m 755 -d "$out/share/${package_name}" + install -m 755 -d "$out/share/man/man8/" + # Copy executables + install -m 755 "newfs_hfs.tproj/newfs_hfs" "$out/bin/mkfs.hfsplus" + install -m 755 "fsck_hfs.tproj/fsck_hfs" "$out/bin/fsck.hfsplus" + # Copy shared data + install -m 644 "newfs_hfs.tproj/hfsbootdata.img" "$out/share/${package_name}/hfsbootdata" + # Copy man pages + install -m 644 "newfs_hfs.tproj/newfs_hfs.8" "$out/share/man/man8/mkfs.hfsplus.8" + install -m 644 "fsck_hfs.tproj/fsck_hfs.8" "$out/share/man/man8/fsck.hfsplus.8" + ''; + + meta = { + description = "HFS/HFS+ user space utils"; + license = stdenv.lib.licenses.apsl20; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/httpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/httpfs/default.nix new file mode 100644 index 000000000000..b0f7981ebb3c --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/httpfs/default.nix @@ -0,0 +1,35 @@ +{ fetchurl, stdenv, pkgconfig, fuse, openssl, asciidoc +, docbook_xml_dtd_45, docbook_xsl , libxml2, libxslt }: + +stdenv.mkDerivation rec { + name = "httpfs2-0.1.5"; + + src = fetchurl { + url = "mirror://sourceforge/httpfs/httpfs2/${name}.tar.gz"; + sha256 = "1h8ggvhw30n2r6w11n1s458ypggdqx6ldwd61ma4yd7binrlpjq1"; + }; + + buildInputs = + [ pkgconfig fuse openssl + asciidoc docbook_xml_dtd_45 docbook_xsl libxml2 libxslt + ]; + + installPhase = + '' mkdir -p "$out/bin" + cp -v httpfs2 "$out/bin" + + mkdir -p "$out/share/man/man1" + cp -v *.1 "$out/share/man/man1" + ''; + + meta = { + description = "HTTPFS2, a FUSE-based HTTP file system for Linux"; + + homepage = http://httpfs.sourceforge.net/; + + license = stdenv.lib.licenses.gpl2Plus; + + platforms = stdenv.lib.platforms.linux; + maintainers = [ ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix new file mode 100644 index 000000000000..9b1c2b66e7aa --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/hubicfuse/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, pkgconfig, curl, openssl, fuse, libxml2, json_c, file }: + +stdenv.mkDerivation rec { + pname = "hubicfuse"; + version = "3.0.1"; + + src = fetchFromGitHub { + owner = "TurboGit"; + repo = "hubicfuse"; + rev = "v${version}"; + sha256 = "1x988hfffxgvqxh083pv3lj5031fz03sbgiiwrjpaiywfbhm8ffr"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ curl openssl fuse libxml2 json_c file ]; + postInstall = '' + install hubic_token $out/bin + mkdir -p $out/sbin + ln -sf $out/bin/hubicfuse $out/sbin/mount.hubicfuse + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/TurboGit/hubicfuse; + description = "FUSE-based filesystem to access hubic cloud storage"; + platforms = platforms.linux; + license = licenses.mit; + maintainers = [ maintainers.jpierre03 ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/idsk/default.nix b/nixpkgs/pkgs/tools/filesystems/idsk/default.nix new file mode 100644 index 000000000000..72ed4f0ee1b4 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/idsk/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, cmake }: + +stdenv.mkDerivation rec { + + pname = "idsk"; + version = "0.19"; + + src = fetchFromGitHub { + repo = "idsk"; + owner = "cpcsdk"; + rev = "v${version}"; + sha256 = "0b4my5cz5kbzh4n65jr721piha6zixaxmfiss2zidip978k9rb6f"; + }; + + nativeBuildInputs = [ cmake ]; + + installPhase = '' + mkdir -p $out/bin + cp iDSK $out/bin + ''; + + meta = with stdenv.lib; { + description = "Manipulating CPC dsk images and files"; + homepage = "https://github.com/cpcsdk/idsk" ; + license = licenses.mit; + maintainers = [ maintainers.genesis ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/ifuse/default.nix b/nixpkgs/pkgs/tools/filesystems/ifuse/default.nix new file mode 100644 index 000000000000..aef6087d3f28 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ifuse/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, usbmuxd, fuse, libimobiledevice }: + +stdenv.mkDerivation rec { + pname = "ifuse"; + version = "2018-10-08"; + + src = fetchFromGitHub { + owner = "libimobiledevice"; + repo = pname; + rev = "e75d32c34d0e8b80320f0a007d5ecbb3f55ef7f0"; + sha256 = "1b9w2i0sliswlkkb890l9i0rxrf631xywxf8ihygfmjdsfw47h1m"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig fuse usbmuxd libimobiledevice ]; + + meta = with stdenv.lib; { + homepage = https://github.com/libimobiledevice/ifuse; + description = "A fuse filesystem implementation to access the contents of iOS devices"; + longDescription = '' + Mount directories of an iOS device locally using fuse. By default the media + directory is mounted, options allow to also mount the sandbox container of an + app, an app's documents folder or even the root filesystem on jailbroken + devices. + ''; + license = licenses.lgpl21Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ infinisil ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/irods/common.nix b/nixpkgs/pkgs/tools/filesystems/irods/common.nix new file mode 100644 index 000000000000..902d7d7d1a1e --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/irods/common.nix @@ -0,0 +1,55 @@ +{ stdenv, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp, boost, jansson, zeromq, openssl, pam, libiodbc, kerberos, gcc, libcxx, which }: + +# Common attributes of irods packages + +with stdenv; + +{ + enableParallelBuilding = true; + + buildInputs = [ bzip2 zlib autoconf automake cmake gnumake help2man texinfo libtool cppzmq libarchive avro-cpp jansson zeromq openssl pam libiodbc kerberos gcc boost libcxx which ]; + + cmakeFlags = [ + "-DIRODS_EXTERNALS_FULLPATH_CLANG=${stdenv.cc}" + "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME=${stdenv.cc}" + "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE=${libarchive.lib}" + "-DIRODS_EXTERNALS_FULLPATH_AVRO=${avro-cpp}" + "-DIRODS_EXTERNALS_FULLPATH_BOOST=${boost}" + "-DIRODS_EXTERNALS_FULLPATH_JANSSON=${jansson}" + "-DIRODS_EXTERNALS_FULLPATH_ZMQ=${zeromq}" + "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ=${cppzmq}" + "-DIRODS_LINUX_DISTRIBUTION_NAME=nix" + "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=${builtins.nixVersion}" + "-DCPACK_GENERATOR=TGZ" + "-DCMAKE_CXX_FLAGS=-I${libcxx}/include/c++/v1" + ]; + + preConfigure = '' + patchShebangs ./packaging + patchShebangs ./scripts + substituteInPlace CMakeLists.txt --replace "DESTINATION usr/bin" "DESTINATION bin" + substituteInPlace CMakeLists.txt --replace "INCLUDE_DIRS usr/include/" "INCLUDE_DIRS include/" + substituteInPlace CMakeLists.txt --replace "DESTINATION usr/lib/" "DESTINATION lib/" + export cmakeFlags="$cmakeFlags + -DCMAKE_INSTALL_PREFIX=$out + " + ''; + + meta = { + description = "Integrated Rule-Oriented Data System (iRODS)"; + longDescription = '' + The Integrated Rule-Oriented Data System (iRODS) is open source data management + software used by research organizations and government agencies worldwide. + iRODS is released as a production-level distribution aimed at deployment in mission + critical environments. It virtualizes data storage resources, so users can take + control of their data, regardless of where and on what device the data is stored. + As data volumes grow and data services become more complex, iRODS is increasingly + important in data management. The development infrastructure supports exhaustive + testing on supported platforms; plug-in support for microservices, storage resources, + drivers, and databases; and extensive documentation, training and support services.''; + homepage = https://irods.org; + license = stdenv.lib.licenses.bsd3; + maintainers = [ stdenv.lib.maintainers.bzizou ]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/irods/default.nix b/nixpkgs/pkgs/tools/filesystems/irods/default.nix new file mode 100644 index 000000000000..b6099c099f32 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/irods/default.nix @@ -0,0 +1,91 @@ +{ stdenv, fetchurl, bzip2, zlib, autoconf, automake, cmake, gnumake, help2man , texinfo, libtool , cppzmq , libarchive, avro-cpp_llvm, boost, jansson, zeromq, openssl , pam, libiodbc, kerberos, gcc, libcxx, which }: + +with stdenv; + +let + avro-cpp=avro-cpp_llvm; +in +let + common = import ./common.nix { + inherit stdenv bzip2 zlib autoconf automake cmake gnumake + help2man texinfo libtool cppzmq libarchive jansson + zeromq openssl pam libiodbc kerberos gcc libcxx + boost avro-cpp which; + }; +in rec { + + # irods: libs and server package + irods = stdenv.mkDerivation (common // rec { + version = "4.2.2"; + prefix = "irods"; + name = "${prefix}-${version}"; + + src = fetchurl { + url = "https://github.com/irods/irods/releases/download/${version}/irods-${version}.tar.gz"; + sha256 = "0b89hs7sizwrs2ja7jl521byiwb58g297p0p7zg5frxmv4ig8dw7"; + }; + + # Patches: + # irods_root_path.patch : the root path is obtained by stripping 3 items of the path, + # but we don't use /usr with nix, so remove only 2 items. + patches = [ ./irods_root_path.patch ]; + + # fix build with recent llvm versions + NIX_CFLAGS_COMPILE = "-Wno-deprecated-register -Wno-deprecated-declarations"; + + preConfigure = common.preConfigure + '' + patchShebangs ./test + substituteInPlace plugins/database/CMakeLists.txt --replace "COMMAND cpp" "COMMAND ${gcc.cc}/bin/cpp" + substituteInPlace cmake/server.cmake --replace "DESTINATION usr/sbin" "DESTINATION sbin" + substituteInPlace cmake/server.cmake --replace "IRODS_DOC_DIR usr/share" "IRODS_DOC_DIR share" + substituteInPlace cmake/runtime_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib" + substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/lib" "DESTINATION lib" + substituteInPlace cmake/development_library.cmake --replace "DESTINATION usr/include" "DESTINATION include" + export cmakeFlags="$cmakeFlags + -DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,$out/lib + -DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,$out/lib + -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,$out/lib + " + + substituteInPlace cmake/server.cmake --replace SETUID "" + ''; + + meta = common.meta // { + longDescription = common.meta.longDescription + '' + This package provides the servers and libraries.''; + }; + }); + + + # icommands (CLI) package, depends on the irods package + irods-icommands = stdenv.mkDerivation (common // rec { + version = "4.2.2"; + name = "irods-icommands-${version}"; + src = fetchurl { + url = "https://github.com/irods/irods_client_icommands/archive/${version}.tar.gz"; + sha256 = "15zcxrx0q5c3rli3snd0b2q4i0hs3zzcrbpnibbhsip855qvs77h"; + }; + + buildInputs = common.buildInputs ++ [ irods ]; + + preConfigure = common.preConfigure + '' + patchShebangs ./bin + ''; + + cmakeFlags = common.cmakeFlags ++ [ + "-DCMAKE_INSTALL_PREFIX=${out}" + "-DIRODS_DIR=${irods}/lib/irods/cmake" + "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib" + "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath,${irods}/lib" + "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath,${irods}/lib" + ]; + + meta = common.meta // { + description = common.meta.description + " CLI clients"; + longDescription = common.meta.longDescription + '' + This package provides the CLI clients, called 'icommands'.''; + broken = true; + }; + }); +} + diff --git a/nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch b/nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch new file mode 100644 index 000000000000..16b6ba08cbb2 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/irods/irods_root_path.patch @@ -0,0 +1,71 @@ +diff -r -u irods-4.2.0.orig/lib/core/src/irods_default_paths.cpp irods-4.2.0/lib/core/src/irods_default_paths.cpp +--- irods-4.2.0.orig/lib/core/src/irods_default_paths.cpp 2016-11-15 06:23:55.000000000 +0000 ++++ irods-4.2.0/lib/core/src/irods_default_paths.cpp 2016-12-20 18:03:17.156883399 +0000 +@@ -18,7 +18,7 @@ + try { + boost::filesystem::path path{dl_info.dli_fname}; + path = boost::filesystem::canonical(path); +- path.remove_filename().remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install ++ path.remove_filename().remove_filename(); // Removes filename and the two directories (usr and lib) between libirods_common.so and base of irods install + return path; + } catch(const boost::filesystem::filesystem_error& e) { + THROW(-1, e.what()); +@@ -27,8 +27,7 @@ + + boost::filesystem::path + get_irods_config_directory() { +- boost::filesystem::path path{get_irods_root_directory()}; +- path.append("etc").append("irods"); ++ boost::filesystem::path path("/etc/irods"); + return path; + } + +diff -r -u irods-4.2.0.orig/scripts/irods/paths.py irods-4.2.0/scripts/irods/paths.py +--- irods-4.2.0.orig/scripts/irods/paths.py 2016-11-15 06:23:55.000000000 +0000 ++++ irods-4.2.0/scripts/irods/paths.py 2016-12-21 15:17:07.437864606 +0000 +@@ -10,7 +10,7 @@ + return os.path.join(root_directory(), 'var', 'lib', 'irods') + + def config_directory(): +- return os.path.join(root_directory(), 'etc', 'irods') ++ return os.path.join(os.path.abspath('/'), 'etc', 'irods') + + def plugins_directory(): + return os.path.join(root_directory(), 'usr', 'lib', 'irods', 'plugins') +@@ -37,7 +37,7 @@ + + def version_path(): + return os.path.join( +- irods_directory(), ++ home_directory(), + 'VERSION.json') + + def hosts_config_path(): +@@ -64,7 +64,7 @@ + + def log_directory(): + return os.path.join( +- irods_directory(), ++ home_directory(), + 'log') + + def control_log_path(): +@@ -110,8 +110,7 @@ + def server_bin_directory(): + return os.path.join( + root_directory(), +- 'usr', +- 'sbin') ++ 'bin') + + def server_executable(): + return os.path.join( +@@ -132,7 +131,7 @@ + return os.path.join(config_directory(), 'service_account.config') + + def genosauth_path(): +- return os.path.join(irods_directory(), 'clients', 'bin', 'genOSAuth') ++ return os.path.join(home_directory(), 'clients', 'bin', 'genOSAuth') + + def irods_user_and_group_entries(): + try: diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch b/nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch new file mode 100644 index 000000000000..697029cd5a8c --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/ar-fix.patch @@ -0,0 +1,10 @@ +--- jfsutils-1.1.15/configure.in.orig 2018-11-27 20:46:55.830242385 +0300 ++++ jfsutils-1.1.15/configure.in 2018-11-27 20:47:00.596307630 +0300 +@@ -15,6 +15,7 @@ + AC_PATH_PROG(LN, ln, ln) + AC_PROG_LN_S + AC_PROG_RANLIB ++AM_PROG_AR + + dnl Checks for header files. + AC_HEADER_STDC diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix b/nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix new file mode 100644 index 000000000000..92dfe00c9514 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchurl, libuuid, autoreconfHook }: + +stdenv.mkDerivation rec { + name = "jfsutils-1.1.15"; + + src = fetchurl { + url = "http://jfs.sourceforge.net/project/pub/${name}.tar.gz"; + sha256 = "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4"; + }; + + patches = [ + ./types.patch + ./hardening-format.patch + # required for cross-compilation + ./ar-fix.patch + ]; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ libuuid ]; + + meta = with stdenv.lib; { + description = "IBM JFS utilities"; + homepage = http://jfs.sourceforge.net; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch b/nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch new file mode 100644 index 000000000000..dd2a93a81ec6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/hardening-format.patch @@ -0,0 +1,37 @@ +--- a/fscklog/fscklog.c 2016-01-29 04:59:54.102223291 +0000 ++++ b/fscklog/fscklog.c 2016-01-29 05:00:10.707552565 +0000 +@@ -252,8 +252,8 @@ + + sprintf(debug_detail, " [%s:%d]\n", basename(file_name), line_number); + +- printf(msg_string); +- printf(debug_detail); ++ printf("%s", msg_string); ++ printf("%s", debug_detail); + + return 0; + } +--- a/fscklog/display.c 2016-01-29 05:05:42.582133444 +0000 ++++ b/fscklog/display.c 2016-01-29 05:05:47.541231780 +0000 +@@ -182,7 +182,7 @@ + } else { + /* the record looks ok */ + msg_txt = &log_entry[log_entry_pos]; +- printf(msg_txt); ++ printf("%s", msg_txt); + /* + * set up for the next record + */ +--- a/logdump/helpers.c 2016-01-29 05:06:26.081996021 +0000 ++++ b/logdump/helpers.c 2016-01-29 05:06:43.097333425 +0000 +@@ -95,8 +95,8 @@ + + sprintf(debug_detail, " [%s:%d]\n", file_name, line_number); + +- printf(msg_string); +- printf(debug_detail); ++ printf("%s", msg_string); ++ printf("%s", debug_detail); + + return 0; + } diff --git a/nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch b/nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch new file mode 100644 index 000000000000..a682f2695f9e --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/jfsutils/types.patch @@ -0,0 +1,12 @@ +diff -ru -x '*~' jfsutils-1.1.15-orig/libfs/devices.h jfsutils-1.1.15/libfs/devices.h +--- jfsutils-1.1.15-orig/libfs/devices.h 2005-11-22 21:43:55.000000000 +0100 ++++ jfsutils-1.1.15/libfs/devices.h 2013-01-28 13:58:56.888630278 +0100 +@@ -18,6 +18,8 @@ + #ifndef H_DEVICES + #define H_DEVICES + ++#include <inttypes.h> ++ + #define GET 0 + #define PUT 1 + #define VRFY 2 diff --git a/nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix new file mode 100644 index 000000000000..58963753a51a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/jmtpfs/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, pkgconfig, file, fuse, libmtp }: + +let version = "0.5"; in +stdenv.mkDerivation { + pname = "jmtpfs"; + inherit version; + + src = fetchFromGitHub { + sha256 = "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"; + rev = "v${version}"; + repo = "jmtpfs"; + owner = "JasonFerrara"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ file fuse libmtp ]; + + meta = with stdenv.lib; { + description = "A FUSE filesystem for MTP devices like Android phones"; + homepage = https://github.com/JasonFerrara/jmtpfs; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = [ maintainers.coconnor ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix b/nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix new file mode 100644 index 000000000000..3ae898d4ba8a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/lizardfs/default.nix @@ -0,0 +1,59 @@ +{ stdenv +, fetchFromGitHub +, fetchpatch +, cmake +, makeWrapper +, python2 +, db +, fuse +, asciidoc +, libxml2 +, libxslt +, docbook_xml_dtd_412 +, docbook_xsl +, boost +, pkgconfig +, judy +, pam +, spdlog +, zlib # optional +}: + +stdenv.mkDerivation rec { + pname = "lizardfs"; + version = "3.12.0"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "0zk73wmx82ari3m2mv0zx04x1ggsdmwcwn7k6bkl5c0jnxffc4ax"; + }; + + nativeBuildInputs = [ cmake pkgconfig makeWrapper ]; + + buildInputs = + [ db fuse asciidoc libxml2 libxslt docbook_xml_dtd_412 docbook_xsl + zlib boost judy pam spdlog python2 + ]; + + patches = [ + # Use system-provided spdlog instead of downloading an old one (next two patches) + (fetchpatch { + url = "https://salsa.debian.org/debian/lizardfs/raw/d003c371/debian/patches/system-spdlog.patch"; + sha256 = "1znpqqzb0k5bb7s4d7abfxzn5ry1khz8r76sb808c95cpkw91a9i"; + }) + (fetchpatch { + url = "https://salsa.debian.org/debian/lizardfs/raw/bfcd5bcf/debian/patches/spdlog.patch"; + sha256 = "0j44rb816i6kfh3y2qdha59c4ja6wmcnlrlq29il4ybxn42914md"; + }) + ]; + + meta = with stdenv.lib; { + homepage = "https://lizardfs.com"; + description = "A highly reliable, scalable and efficient distributed file system"; + platforms = platforms.linux; + license = licenses.gpl3; + maintainers = [ maintainers.rushmorem ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix b/nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix new file mode 100644 index 000000000000..a7c9421f46ad --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mergerfs/default.nix @@ -0,0 +1,38 @@ +{ stdenv, fetchFromGitHub, automake, autoconf, pkgconfig, gettext, libtool, pandoc, which, attr, libiconv }: + +stdenv.mkDerivation rec { + pname = "mergerfs"; + version = "2.28.3"; + + src = fetchFromGitHub { + owner = "trapexit"; + repo = pname; + rev = version; + sha256 = "1w6p3svc2yknp6swqg8lax6n9b31lyplb3j7r8nv14hbq4hymylx"; + }; + + nativeBuildInputs = [ + automake autoconf pkgconfig gettext libtool pandoc which + ]; + buildInputs = [ attr libiconv ]; + + preConfigure = '' + echo "${version}" > VERSION + ''; + + makeFlags = [ "PREFIX=${placeholder "out"}" "XATTR_AVAILABLE=1" ]; + enableParallelBuilding = true; + + postFixup = '' + ln -srf $out/bin/mergerfs $out/bin/mount.fuse.mergerfs + ln -srf $out/bin/mergerfs $out/bin/mount.mergerfs + ''; + + meta = { + description = "A FUSE based union filesystem"; + homepage = "https://github.com/trapexit/mergerfs"; + license = stdenv.lib.licenses.isc; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ jfrankenau makefu ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix b/nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix new file mode 100644 index 000000000000..44337cf11619 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mergerfs/tools.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, coreutils, makeWrapper +, rsync, python3, pythonPackages }: + +stdenv.mkDerivation rec { + pname = "mergerfs-tools"; + version = "20190411"; + + src = fetchFromGitHub { + owner = "trapexit"; + repo = pname; + rev = "6e41fc5848c7cc4408caea86f3991c8cc2ac85a1"; + sha256 = "0izswg6bya13scvb37l3gkl7mvi8q7l11p4hp4phdlcwh9jvdzcj"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ python3 ]; + + makeFlags = [ + "INSTALL=${coreutils}/bin/install" + "PREFIX=${placeholder "out"}" + ]; + + postInstall = with stdenv.lib; '' + wrapProgram $out/bin/mergerfs.balance --prefix PATH : ${makeBinPath [ rsync ]} + wrapProgram $out/bin/mergerfs.dup --prefix PATH : ${makeBinPath [ rsync ]} + wrapProgram $out/bin/mergerfs.mktrash --prefix PATH : ${makeBinPath [ pythonPackages.xattr ]} + ''; + + meta = with stdenv.lib; { + description = "Optional tools to help manage data in a mergerfs pool"; + homepage = "https://github.com/trapexit/mergerfs-tools"; + license = licenses.isc; + platforms = platforms.linux; + maintainers = with maintainers; [ jfrankenau ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix b/nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix new file mode 100644 index 000000000000..4d90e189b950 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mhddfs/default.nix @@ -0,0 +1,35 @@ +{ stdenv, fetchurl, fuse, pkgconfig, attr, uthash }: + +stdenv.mkDerivation rec { + pname = "mhddfs"; + version = "0.1.39"; + + src = fetchurl { + url = "http://mhddfs.uvw.ru/downloads/mhddfs_${version}.tar.gz"; + sha256 = "14ggmh91vv69fp2qpz0nxp0hprlw2wsijss2k2485hb0ci4cabvh"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse attr uthash ]; + + patches = [ + ./fix-format-security-error.patch + ]; + + postPatch = '' + substituteInPlace src/main.c --replace "attr/xattr.h" "sys/xattr.h" + substituteInPlace src/tools.c --replace "attr/xattr.h" "sys/xattr.h" + ''; + + installPhase = '' + mkdir -p $out/bin + cp mhddfs $out/bin/ + ''; + + meta = { + homepage = http://mhddfs.uvw.ru/; + description = "Combines a several mount points into the single one"; + license = stdenv.lib.licenses.gpl3; + maintainers = [ stdenv.lib.maintainers.makefu ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch b/nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch new file mode 100644 index 000000000000..35e58cf0ce9e --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mhddfs/fix-format-security-error.patch @@ -0,0 +1,12 @@ +--- mhddfs-0.1.39/src/usage.c.old 2017-02-28 15:00:25.435438622 +0100 ++++ mhddfs-0.1.39/src/usage.c 2017-02-28 15:00:33.847454958 +0100 +@@ -43,7 +43,7 @@ + "\n" + " see fusermount(1) for information about other options\n" + ""; +- fprintf(to, usage); ++ fputs(usage, to); + if (to==stdout) exit(0); + exit(-1); + } + diff --git a/nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix b/nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix new file mode 100644 index 000000000000..6733b3df45ea --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mkspiffs/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, git }: + +# Changing the variables CPPFLAGS and BUILD_CONFIG_NAME can be done by +# overriding the same-named attributes. See ./presets.nix for examples. + +stdenv.mkDerivation rec { + pname = "mkspiffs"; + version = "0.2.3"; + + src = fetchFromGitHub { + owner = "igrr"; + repo = "mkspiffs"; + rev = version; + fetchSubmodules = true; + sha256 = "1fgw1jqdlp83gv56mgnxpakky0q6i6f922niis4awvxjind8pbm1"; + }; + + nativeBuildInputs = [ git ]; + buildFlags = [ "dist" ]; + installPhase = '' + mkdir -p $out/bin + cp mkspiffs $out/bin + ''; + + meta = with stdenv.lib; { + description = "Tool to build and unpack SPIFFS images"; + license = licenses.mit; + homepage = https://github.com/igrr/mkspiffs; + maintainers = with maintainers; [ haslersn ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix b/nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix new file mode 100644 index 000000000000..c0b74d9cf1b7 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mkspiffs/presets.nix @@ -0,0 +1,20 @@ +{ lib, mkspiffs }: + +# We provide the same presets as the upstream + +lib.mapAttrs ( + name: { CPPFLAGS }: + mkspiffs.overrideAttrs (drv: { + inherit CPPFLAGS; + BUILD_CONFIG_NAME = "-${name}"; + }) +) { + arduino-esp8266.CPPFLAGS = [ + "-DSPIFFS_USE_MAGIC_LENGTH=0" + "-DSPIFFS_ALIGNED_OBJECT_INDEX_TABLES=1" + ]; + + arduino-esp32.CPPFLAGS = [ "-DSPIFFS_OBJ_META_LEN=4" ]; + + esp-idf.CPPFLAGS = [ "-DSPIFFS_OBJ_META_LEN=4" ]; +} diff --git a/nixpkgs/pkgs/tools/filesystems/moosefs/default.nix b/nixpkgs/pkgs/tools/filesystems/moosefs/default.nix new file mode 100644 index 000000000000..5d3c2d15fb2d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/moosefs/default.nix @@ -0,0 +1,39 @@ +{ stdenv +, fetchFromGitHub +, makeWrapper +, python +, fuse +, pkgconfig +, libpcap +, zlib +}: + +stdenv.mkDerivation rec { + pname = "moosefs"; + version = "3.0.109"; + + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "1pwackc511fzx28w3an5qk738ykhpspvc1063w2hv901f213xjzw"; + }; + + nativeBuildInputs = [ pkgconfig makeWrapper ]; + + buildInputs = + [ fuse libpcap zlib ]; + + postInstall = '' + wrapProgram $out/sbin/mfscgiserv \ + --prefix PATH ":" "${python}/bin" + ''; + + meta = with stdenv.lib; { + homepage = https://moosefs.com; + description = "Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System"; + platforms = platforms.linux; + license = licenses.gpl2; + maintainers = [ maintainers.mfossen ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix b/nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix new file mode 100644 index 000000000000..b453067eaef8 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mp3fs/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchurl, flac, fuse, lame, libid3tag, pkgconfig }: + +stdenv.mkDerivation rec { + pname = "mp3fs"; + version = "0.91"; + + src = fetchurl { + url = "https://github.com/khenriks/mp3fs/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "14ngiqg24p3a0s6hp33zjl4i46d8qn4v9id36psycq3n3csmwyx4"; + }; + + patches = [ ./fix-statfs-operation.patch ]; + + buildInputs = [ flac fuse lame libid3tag ]; + nativeBuildInputs = [ pkgconfig ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + description = "FUSE file system that transparently transcodes to MP3"; + longDescription = '' + A read-only FUSE filesystem which transcodes between audio formats + (currently only FLAC to MP3) on the fly when files are opened and read. + It can let you use a FLAC collection with software and/or hardware + which only understands the MP3 format, or transcode files through + simple drag-and-drop in a file browser. + ''; + homepage = https://khenriks.github.io/mp3fs/; + license = licenses.gpl3Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch b/nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch new file mode 100644 index 000000000000..9b3094e60053 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mp3fs/fix-statfs-operation.patch @@ -0,0 +1,39 @@ +From fea072084ff9d7c4d2c688059a2462bb0e59a2ec Mon Sep 17 00:00:00 2001 +From: K Henriksson <kthenriksson@gmail.com> +Date: Wed, 27 Aug 2014 21:55:18 -0700 +Subject: [PATCH] Fix statfs operation + +The statfs implementation does not properly translate names back to the +original, since the major encoding rewrite. This corrects that, and +should fix issue #27. +--- + src/fuseops.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/fuseops.c b/src/fuseops.c +index e7b4e7e..c333cbd 100644 +--- a/src/fuseops.c ++++ b/src/fuseops.c +@@ -337,9 +337,20 @@ static int mp3fs_statfs(const char *path, struct statvfs *stbuf) { + if (!origpath) { + goto translate_fail; + } +- ++ ++ /* pass-through for regular files */ ++ if (statvfs(origpath, stbuf) == 0) { ++ goto passthrough; ++ } else { ++ /* Not really an error. */ ++ errno = 0; ++ } ++ ++ find_original(origpath); ++ + statvfs(origpath, stbuf); +- ++ ++passthrough: + free(origpath); + translate_fail: + return -errno; diff --git a/nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix b/nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix new file mode 100644 index 000000000000..3b355c92226b --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mtdutils/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, autoreconfHook, pkgconfig, cmocka, acl, libuuid, lzo, zlib, zstd }: + +stdenv.mkDerivation rec { + pname = "mtd-utils"; + version = "2.1.1"; + + src = fetchurl { + url = "ftp://ftp.infradead.org/pub/${pname}/${pname}-${version}.tar.bz2"; + sha256 = "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ] ++ stdenv.lib.optional doCheck cmocka; + buildInputs = [ acl libuuid lzo zlib zstd ]; + + configureFlags = [ + (stdenv.lib.enableFeature doCheck "unit-tests") + (stdenv.lib.enableFeature doCheck "tests") + ]; + enableParallelBuilding = true; + + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + + meta = { + description = "Tools for MTD filesystems"; + license = stdenv.lib.licenses.gpl2Plus; + homepage = "http://www.linux-mtd.infradead.org/"; + maintainers = with stdenv.lib.maintainers; [ viric ]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch b/nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch new file mode 100644 index 000000000000..46b790afd30a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mtools/UNUSED-darwin.patch @@ -0,0 +1,11 @@ +--- mtools/sysincludes.h.orig 2017-04-01 20:59:46.083196540 +0100 ++++ mtools/sysincludes.h 2017-04-01 20:59:12.855030456 +0100 +@@ -103,7 +103,7 @@ + # define PACKED __attribute__ ((packed)) + # if __GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3 + /* gcc 2.6.3 doesn't have "unused" */ /* mool */ +-# define UNUSED(x) x __attribute__ ((unused));x ++# define UNUSED(x) x + # define UNUSEDP __attribute__ ((unused)) + # else + # define UNUSED(x) x diff --git a/nixpkgs/pkgs/tools/filesystems/mtools/default.nix b/nixpkgs/pkgs/tools/filesystems/mtools/default.nix new file mode 100644 index 000000000000..b477ad8deace --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mtools/default.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "mtools-4.0.23"; + + src = fetchurl { + url = "mirror://gnu/mtools/${name}.tar.bz2"; + sha256 = "1qwfxzr964fasxlzhllahk8mzh7c82s808wvly95dsqsflkdp27i"; + }; + + patches = stdenv.lib.optional stdenv.isDarwin ./UNUSED-darwin.patch; + + # fails to find X on darwin + configureFlags = stdenv.lib.optional stdenv.isDarwin "--without-x"; + + doCheck = true; + + meta = with stdenv.lib; { + homepage = https://www.gnu.org/software/mtools/; + description = "Utilities to access MS-DOS disks"; + platforms = platforms.unix; + license = licenses.gpl3; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix b/nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix new file mode 100644 index 000000000000..bf048113714f --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/mtpfs/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, pkgconfig, fuse, libmtp, glib, libmad, libid3tag }: + +stdenv.mkDerivation rec { + name = "mtpfs-1.1"; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ fuse libmtp glib libid3tag libmad ]; + + # adding LIBS is a hack, duno why it does not find libid3tag.so by adding buildInputs + preConfigure = '' + export MAD_CFLAGS=${libmad}/include + export MAD_LIBS=${libmad}/lib/libmad.so + export LIBS=${libid3tag}/lib/libid3tag.so + ''; + + src = fetchurl { + url = "https://www.adebenham.com/files/mtp/${name}.tar.gz"; + sha256 = "07acrqb17kpif2xcsqfqh5j4axvsa4rnh6xwnpqab5b9w5ykbbqv"; + }; + + meta = with stdenv.lib; { + homepage = https://github.com/cjd/mtpfs; + description = "FUSE Filesystem providing access to MTP devices"; + platforms = platforms.all; + license = licenses.gpl3; + maintainers = [ maintainers.qknight ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/netatalk/default.nix b/nixpkgs/pkgs/tools/filesystems/netatalk/default.nix new file mode 100644 index 000000000000..0a4207d0715f --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/netatalk/default.nix @@ -0,0 +1,61 @@ +{ fetchurl, stdenv, autoreconfHook, pkgconfig, perl, python +, db, libgcrypt, avahi, libiconv, pam, openssl, acl +, ed, glibc, libevent +}: + +stdenv.mkDerivation rec{ + name = "netatalk-3.1.12"; + + src = fetchurl { + url = "mirror://sourceforge/netatalk/netatalk/${name}.tar.bz2"; + sha256 = "1ld5mnz88ixic21m6f0xcgf8v6qm08j6xabh1dzfj6x47lxghq0m"; + }; + + patches = [ + ./no-suid.patch + ./omitLocalstatedirCreation.patch + ]; + + nativeBuildInputs = [ autoreconfHook pkgconfig perl python python.pkgs.wrapPython ]; + + buildInputs = [ db libgcrypt avahi libiconv pam openssl acl libevent ]; + + configureFlags = [ + "--with-bdb=${db.dev}" + "--with-ssl-dir=${openssl.dev}" + "--with-lockfile=/run/lock/netatalk" + "--with-libevent=${libevent.dev}" + "--localstatedir=/var/lib" + ]; + + # Expose librpcsvc to the linker for afpd + # Fixes errors that showed up when closure-size was merged: + # afpd-nfsquota.o: In function `callaurpc': + # netatalk-3.1.7/etc/afpd/nfsquota.c:78: undefined reference to `xdr_getquota_args' + # netatalk-3.1.7/etc/afpd/nfsquota.c:78: undefined reference to `xdr_getquota_rslt' + postConfigure = '' + ${ed}/bin/ed -v etc/afpd/Makefile << EOF + /^afpd_LDADD + /am__append_2 + a + ${glibc.static}/lib/librpcsvc.a \\ + . + w + EOF + ''; + + postInstall = '' + buildPythonPath ${python.pkgs.dbus-python} + patchPythonScript $out/bin/afpstats + ''; + + enableParallelBuilding = true; + + meta = { + description = "Apple Filing Protocol Server"; + homepage = http://netatalk.sourceforge.net/; + license = stdenv.lib.licenses.gpl3; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ jcumming ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch b/nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch new file mode 100644 index 000000000000..194c1f5fac9f --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/netatalk/no-suid.patch @@ -0,0 +1,11 @@ +diff --git a/bin/afppasswd/Makefile.am b/bin/afppasswd/Makefile.am +index 578eac1..d17aa22 100644 +--- a/bin/afppasswd/Makefile.am ++++ b/bin/afppasswd/Makefile.am +@@ -16,5 +16,5 @@ AM_CFLAGS = @SSL_CFLAGS@ -I$(top_srcdir)/sys \ + + install-exec-hook: + if HAVE_OPENSSL +- chmod u+s $(DESTDIR)$(bindir)/afppasswd ++# chmod u+s $(DESTDIR)$(bindir)/afppasswd + endif diff --git a/nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch b/nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch new file mode 100644 index 000000000000..01c4ee9ba478 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/netatalk/omitLocalstatedirCreation.patch @@ -0,0 +1,19 @@ +diff --git a/config/Makefile.am b/config/Makefile.am +index c98a2ab..58b7f0a 100644 +--- a/config/Makefile.am ++++ b/config/Makefile.am +@@ -36,10 +36,10 @@ endif + # + + install-data-local: install-config-files +- mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/ +- mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/CNID/ +- $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/ +- $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/CNID/ ++# mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/ ++# mkdir -pm 0755 $(DESTDIR)$(localstatedir)/netatalk/CNID/ ++# $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/ ++# $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(localstatedir)/netatalk/CNID/ + + uninstall-local: + @for f in $(CONFFILES) $(GENFILES); do \ diff --git a/nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix b/nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix new file mode 100644 index 000000000000..dd8116ff4013 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nilfs-utils/default.nix @@ -0,0 +1,63 @@ +{ stdenv, fetchurl, fetchpatch, libuuid, libselinux }: +let + sourceInfo = rec { + version = "2.2.7"; + url = "http://nilfs.sourceforge.net/download/nilfs-utils-${version}.tar.bz2"; + sha256 = "01f09bvjk2crx65pxmxiw362wkkl3v2v144dfn3i7bk5gz253xic"; + baseName = "nilfs-utils"; + name = "${baseName}-${version}"; + }; +in +stdenv.mkDerivation { + src = fetchurl { + url = sourceInfo.url; + sha256 = sourceInfo.sha256; + }; + + inherit (sourceInfo) name version; + buildInputs = [libuuid libselinux]; + + preConfigure = '' + sed -e '/sysconfdir=\/etc/d; ' -i configure + sed -e "s@sbindir=/sbin@sbindir=$out/sbin@" -i configure + sed -e 's@/sbin/@'"$out"'/sbin/@' -i ./lib/cleaner*.c + ''; + + patches = [ + # Fix w/musl + (fetchpatch { + url = "https://github.com/nilfs-dev/nilfs-utils/commit/115fe4b976858c487cf83065f513d8626089579a.patch"; + sha256 = "0h89jz9l5d4rqj647ljbnv451l4ncqpsvzj0v70mn5391hfwsjlv"; + }) + (fetchpatch { + url = "https://github.com/nilfs-dev/nilfs-utils/commit/51b32c614be9e98c32de7f531ee600ca0740946f.patch"; + sha256 = "1ycq83c6jjy74aif47v075k5y2szzwhq6mbcrpd1z4b4i1x6yhpn"; + }) + ]; + + configureFlags = [ + "--with-libmount" + ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + # AC_FUNC_MALLOC is broken on cross builds. + "ac_cv_func_malloc_0_nonnull=yes" + "ac_cv_func_realloc_0_nonnull=yes" + ]; + + # FIXME: https://github.com/NixOS/patchelf/pull/98 is in, but stdenv + # still doesn't use it + # + # To make sure patchelf doesn't mistakenly keep the reference via + # build directory + postInstall = '' + find . -name .libs | xargs rm -rf + ''; + + meta = with stdenv.lib; { + description = "NILFS utilities"; + maintainers = [ maintainers.raskin ]; + platforms = platforms.linux; + license = with licenses; [ gpl2 lgpl21 ]; + downloadPage = "http://nilfs.sourceforge.net/en/download.html"; + updateWalker = true; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix new file mode 100644 index 000000000000..da2dff6b77a9 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.nix @@ -0,0 +1,50 @@ +# FIXME: Unify with pkgs/development/python-modules/blivet/default.nix. + +{ stdenv, fetchurl, buildPythonApplication, pykickstart, pyparted, pyblock +, libselinux, cryptsetup, multipath_tools, lsof, utillinux +, useNixUdev ? true, systemd ? null +# useNixUdev is here for bw compatibility +}: + +assert useNixUdev -> systemd != null; + +buildPythonApplication rec { + pname = "blivet"; + version = "0.17-1"; + + src = fetchurl { + url = "https://git.fedorahosted.org/cgit/blivet.git/snapshot/" + + "${pname}-${version}.tar.bz2"; + sha256 = "1k3mws2q0ryb7422mml6idmaasz2i2v6ngyvg6d976dx090qnmci"; + }; + + patches = [ ./blivet.patch ]; + + postPatch = '' + sed -i -e 's|"multipath"|"${multipath_tools}/sbin/multipath"|' \ + blivet/devicelibs/mpath.py blivet/devices.py + sed -i -e '/"wipefs"/ { + s|wipefs|${utillinux.bin}/sbin/wipefs| + s/-f/--force/ + }' blivet/formats/__init__.py + sed -i -e 's|"lsof"|"${lsof}/bin/lsof"|' blivet/formats/fs.py + sed -i -r -e 's|"(u?mount)"|"${utillinux.bin}/bin/\1"|' blivet/util.py + sed -i -e '/find_library/,/find_library/ { + c libudev = "${systemd.lib}/lib/libudev.so.1" + }' blivet/pyudev.py + ''; + + propagatedBuildInputs = [ + pykickstart pyparted pyblock libselinux.py cryptsetup + ] ++ stdenv.lib.optional useNixUdev systemd; + + # tests are currently _heavily_ broken upstream + doCheck = false; + + meta = with stdenv.lib; { + homepage = https://fedoraproject.org/wiki/Blivet; + description = "Module for management of a system's storage configuration"; + license = with licenses; [ gpl2Plus lgpl21Plus ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch new file mode 100644 index 000000000000..d53231a84fd6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/blivet.patch @@ -0,0 +1,51 @@ +diff --git a/blivet/pyudev.py b/blivet/pyudev.py +index 705b93d..7268d71 100644 +--- a/blivet/pyudev.py ++++ b/blivet/pyudev.py +@@ -7,9 +7,9 @@ from ctypes import * + + + # XXX this one may need some tweaking... +-def find_library(name, somajor=0): ++def find_library(name): + env = os.environ.get("LD_LIBRARY_PATH") +- common = ["/lib64", "/lib"] ++ common = ["/lib64", "/lib", "/lib/x86_64-linux-gnu", "/lib/i686-linux-gnu"] + + if env: + libdirs = env.split(":") + common +@@ -19,7 +19,7 @@ def find_library(name, somajor=0): + libdirs = filter(os.path.isdir, libdirs) + + for dir in libdirs: +- files = fnmatch.filter(os.listdir(dir), "lib%s.so.%d" % (name, somajor)) ++ files = fnmatch.filter(os.listdir(dir), "lib%s.so.*" % name) + files = [os.path.join(dir, file) for file in files] + + if files: +@@ -32,11 +32,10 @@ def find_library(name, somajor=0): + + # find the udev library + name = "udev" +-somajor = 1 +-libudev = find_library(name=name, somajor=somajor) ++libudev = find_library(name) + + if not libudev or not os.path.exists(libudev): +- raise ImportError, "No library named %s.%d" % (name, somajor) ++ raise ImportError, "No library named lib%s.so" % name + + # load the udev library + libudev = CDLL(libudev) +diff --git a/blivet/deviceaction.py b/blivet/deviceaction.py +index 705b93d..60f8f32 100644 +--- a/blivet/deviceaction.py ++++ b/blivet/deviceaction.py +@@ -467,6 +467,7 @@ def execute(self): + + self.device.disk.format.commitToDisk() + ++ self.device.setup() + self.device.format.create(device=self.device.path, + options=self.device.formatArgs) + diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix new file mode 100644 index 000000000000..b5f3a2f3e1f6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/cryptsetup.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, lvm2, libgcrypt, libuuid, pkgconfig, popt +, enablePython ? true, python ? null +}: + +assert enablePython -> python != null; + +stdenv.mkDerivation rec { + name = "cryptsetup-1.6.3"; + + src = fetchurl { + url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2"; + sha256 = "1n1qk5chyjspbiianrdb55fhb4wl0vfyqz2br05vfb24v4qlgbx2"; + }; + + configureFlags = [ "--enable-cryptsetup-reencrypt" ] + ++ stdenv.lib.optional enablePython "--enable-python"; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ lvm2 libgcrypt libuuid popt ] + ++ stdenv.lib.optional enablePython python; + + meta = { + homepage = http://code.google.com/p/cryptsetup/; + description = "LUKS for dm-crypt"; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [ ]; + platforms = with stdenv.lib.platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix new file mode 100644 index 000000000000..129283e83ebe --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/default.nix @@ -0,0 +1,77 @@ +{ stdenv, fetchurl, python, buildPythonApplication +# Propagated to blivet +, useNixUdev ? true +# Needed by NixOps +, udevSoMajor ? null +# Propagated dependencies +, pkgs, urlgrabber +}: + +let + blivet = import ./blivet.nix { + inherit stdenv fetchurl buildPythonApplication; + inherit pykickstart pyparted pyblock cryptsetup multipath_tools; + inherit useNixUdev; + inherit (pkgs) lsof utillinux systemd; + libselinux = pkgs.libselinux.override { enablePython = true; }; + }; + + cryptsetup = import ./cryptsetup.nix { + inherit stdenv fetchurl python; + inherit (pkgs) pkgconfig libgcrypt libuuid popt lvm2; + }; + + dmraid = import ./dmraid.nix { + inherit stdenv fetchurl lvm2; + }; + + lvm2 = import ./lvm2.nix { + inherit stdenv fetchurl; + inherit (pkgs) pkgconfig utillinux systemd coreutils; + }; + + multipath_tools = import ./multipath-tools.nix { + inherit stdenv fetchurl lvm2; + inherit (pkgs) readline systemd libaio gzip; + }; + + parted = import ./parted.nix { + inherit stdenv fetchurl; + inherit (pkgs) utillinux readline libuuid gettext check lvm2; + }; + + pyblock = import ./pyblock.nix { + inherit stdenv fetchurl python lvm2 dmraid; + }; + + pykickstart = import ./pykickstart.nix { + inherit stdenv fetchurl python buildPythonApplication urlgrabber; + }; + + pyparted = import ./pyparted.nix { + inherit stdenv fetchurl python buildPythonApplication parted; + inherit (pkgs) pkgconfig e2fsprogs; + }; + +in buildPythonApplication rec { + pname = "nixpart"; + version = "0.4.1"; + disabled = python.isPy3k; + + src = fetchurl { + url = "https://github.com/NixOS/nixpart/archive/v${version}.tar.gz"; + sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp"; + }; + + propagatedBuildInputs = [ blivet ]; + + doCheck = false; + + meta = with stdenv.lib; { + description = "NixOS storage manager/partitioner"; + homepage = "https://github.com/NixOS/nixpart"; + license = licenses.gpl2Plus; + maintainers = [ maintainers.aszlig ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix new file mode 100644 index 000000000000..fd6088891023 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/dmraid.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, lvm2 }: + +stdenv.mkDerivation rec { + name = "dmraid-1.0.0.rc15"; + + src = fetchurl { + url = "https://people.redhat.com/~heinzm/sw/dmraid/src/old/${name}.tar.bz2"; + sha256 = "01bcaq0sc329ghgj7f182xws7jgjpdc41bvris8fsiprnxc7511h"; + }; + + preConfigure = "cd */"; + + buildInputs = [ lvm2 ]; + + meta = { + description = "Old-style RAID configuration utility"; + longDescription = '' + Old RAID configuration utility (still under development, though). + It is fully compatible with modern kernels and mdadm recognizes + its volumes. May be needed for rescuing an older system or nuking + the metadata when reformatting. + ''; + maintainers = [ stdenv.lib.maintainers.raskin ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix new file mode 100644 index 000000000000..804b052b61ae --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/lvm2.nix @@ -0,0 +1,64 @@ +{ stdenv, fetchurl, pkgconfig, systemd, utillinux, coreutils }: + +let + v = "2.02.106"; +in + +stdenv.mkDerivation { + name = "lvm2-${v}"; + + src = fetchurl { + url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${v}.tgz"; + sha256 = "0nr833bl0q4zq52drjxmmpf7bs6kqxwa5kahwwxm9411khkxz0vc"; + }; + + configureFlags = [ + "--disable-readline" + "--enable-udev_rules" + "--enable-udev_sync" + "--enable-pkgconfig" + "--enable-applib" + ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ systemd ]; + + preConfigure = + '' + substituteInPlace scripts/lvmdump.sh \ + --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 ${systemd}/bin/udevadm + + sed -i /DEFAULT_SYS_DIR/d Makefile.in + sed -i /DEFAULT_PROFILE_DIR/d conf/Makefile.in + ''; + + enableParallelBuilding = true; + + #patches = [ ./purity.patch ]; + + # To prevent make install from failing. + installFlags = [ "OWNER=" "GROUP=" "confdir=${placeholder "out"}/etc" ]; + + # Install systemd stuff. + #installTargets = "install install_systemd_generators install_systemd_units install_tmpfiles_configuration"; + + postInstall = + '' + substituteInPlace $out/lib/udev/rules.d/13-dm-disk.rules \ + --replace $out/sbin/blkid ${utillinux.bin}/sbin/blkid + + # Systemd stuff + mkdir -p $out/etc/systemd/system $out/lib/systemd/system-generators + cp scripts/blk_availability_systemd_red_hat.service $out/etc/systemd/system + cp scripts/lvm2_activation_generator_systemd_red_hat $out/lib/systemd/system-generators + ''; + + meta = { + homepage = http://sourceware.org/lvm2/; + description = "Tools to support Logical Volume Management (LVM) on Linux"; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix new file mode 100644 index 000000000000..f30bd958cf3a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/multipath-tools.nix @@ -0,0 +1,36 @@ +# FIXME: unify with pkgs/os-specific/linux/multipath-tools/default.nix. + +{ stdenv, fetchurl, lvm2, libaio, gzip, readline, systemd }: + +stdenv.mkDerivation rec { + name = "multipath-tools-0.4.9"; + + src = fetchurl { + url = "http://christophe.varoqui.free.fr/multipath-tools/${name}.tar.bz2"; + sha256 = "04n7kazp1zrlqfza32phmqla0xkcq4zwn176qff5ida4a60whi4d"; + }; + + sourceRoot = "."; + + buildInputs = [ lvm2 libaio readline gzip ]; + + preBuild = + '' + makeFlagsArray=(GZIP="-9" prefix=$out mandir=$out/share/man/man8 man5dir=$out/share/man/man5 LIB=lib) + + substituteInPlace multipath/Makefile --replace /etc $out/etc + substituteInPlace kpartx/Makefile --replace /etc $out/etc + + substituteInPlace kpartx/kpartx.rules --replace /sbin/kpartx $out/sbin/kpartx + substituteInPlace kpartx/kpartx_id --replace /sbin/dmsetup ${lvm2}/sbin/dmsetup + + substituteInPlace libmultipath/defaults.h --replace /lib/udev/scsi_id ${systemd.lib}/lib/udev/scsi_id + substituteInPlace libmultipath/hwtable.c --replace /lib/udev/scsi_id ${systemd.lib}/lib/udev/scsi_id + ''; + + meta = { + description = "Tools for the Linux multipathing driver"; + homepage = http://christophe.varoqui.free.fr/; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix new file mode 100644 index 000000000000..046fe81e64ac --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/parted.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchurl, lvm2, libuuid, gettext, readline +, utillinux, check, enableStatic ? false }: + +stdenv.mkDerivation rec { + name = "parted-3.1"; + + src = fetchurl { + url = "mirror://gnu/parted/${name}.tar.xz"; + sha256 = "05fa4m1bky9d13hqv91jlnngzlyn7y4rnnyq6d86w0dg3vww372y"; + }; + + buildInputs = [ libuuid ] + ++ stdenv.lib.optional (readline != null) readline + ++ stdenv.lib.optional (gettext != null) gettext + ++ stdenv.lib.optional (lvm2 != null) lvm2; + + configureFlags = + (if (readline != null) + then [ "--with-readline" ] + else [ "--without-readline" ]) + ++ stdenv.lib.optional (lvm2 == null) "--disable-device-mapper" + ++ stdenv.lib.optional enableStatic "--enable-static"; + + doCheck = true; + checkInputs = [ check utillinux ]; + + meta = { + description = "Create, destroy, resize, check, and copy partitions"; + + longDescription = '' + GNU Parted is an industrial-strength package for creating, destroying, + resizing, checking and copying partitions, and the file systems on + them. This is useful for creating space for new operating systems, + reorganising disk usage, copying data on hard disks and disk imaging. + + It contains a library, libparted, and a command-line frontend, parted, + which also serves as a sample implementation and script backend. + ''; + + homepage = https://www.gnu.org/software/parted/; + license = stdenv.lib.licenses.gpl3Plus; + + maintainers = [ + # Add your name here! + ]; + + # GNU Parted requires libuuid, which is part of util-linux-ng. + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix new file mode 100644 index 000000000000..2abab9057376 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyblock.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, python, lvm2, dmraid }: + +stdenv.mkDerivation rec { + pname = "pyblock"; + version = "0.53"; + md5_path = "f6d33a8362dee358517d0a9e2ebdd044"; + + src = fetchurl { + url = "https://src.fedoraproject.org/repo/pkgs/python-pyblock/" + + "${pname}-${version}.tar.bz2/${md5_path}/${pname}-${version}.tar.bz2"; + sha256 = "f6cef88969300a6564498557eeea1d8da58acceae238077852ff261a2cb1d815"; + }; + + postPatch = '' + sed -i -e 's|/usr/include/python|${python}/include/python|' \ + -e 's/-Werror *//' -e 's|/usr/|'"$out"'/|' Makefile + ''; + + buildInputs = [ python lvm2 dmraid ]; + + makeFlags = [ + "USESELINUX=0" + "SITELIB=$(out)/lib/${python.libPrefix}/site-packages" + ]; + + meta = { + description = "Interface for working with block devices"; + license = stdenv.lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix new file mode 100644 index 000000000000..9d067359c44a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pykickstart.nix @@ -0,0 +1,30 @@ +{ stdenv, python, buildPythonApplication, fetchurl, urlgrabber }: + +buildPythonApplication rec { + pname = "pykickstart"; + version = "1.99.39"; + md5_path = "d249f60aa89b1b4facd63f776925116d"; + + src = fetchurl { + url = "https://src.fedoraproject.org/repo/pkgs/pykickstart/" + + "${pname}-${version}.tar.gz/${md5_path}/${pname}-${version}.tar.gz"; + sha256 = "e0d0f98ac4c5607e6a48d5c1fba2d50cc804de1081043f9da68cbfc69cad957a"; + }; + + postPatch = '' + sed -i -e "s/for tst in tstList/for tst in sorted(tstList, \ + key=lambda m: m.__name__)/" tests/baseclass.py + ''; + + propagatedBuildInputs = [ urlgrabber ]; + + checkPhase = '' + ${python}/bin/${python.executable} tests/baseclass.py -vv + ''; + + meta = { + homepage = http://fedoraproject.org/wiki/Pykickstart; + description = "Read and write Fedora kickstart files"; + license = stdenv.lib.licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix new file mode 100644 index 000000000000..e0947b01f51b --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/0.4/pyparted.nix @@ -0,0 +1,42 @@ +{ stdenv, fetchurl, pkgconfig, python, buildPythonApplication, parted, e2fsprogs }: + +buildPythonApplication rec { + pname = "pyparted"; + version = "3.10"; + + src = fetchurl { + url = "https://fedorahosted.org/releases/p/y/pyparted/${pname}-${version}.tar.gz"; + sha256 = "17wq4invmv1nfazaksf59ymqyvgv3i8h4q03ry2az0s9lldyg3dv"; + }; + + postPatch = '' + sed -i -e 's|/sbin/mke2fs|${e2fsprogs}&|' tests/baseclass.py + sed -i -e ' + s|e\.path\.startswith("/tmp/temp-device-")|"temp-device-" in e.path| + ' tests/test__ped_ped.py + '' + stdenv.lib.optionalString stdenv.isi686 '' + # remove some integers in this test case which overflow on 32bit systems + sed -i -r -e '/class *UnitGetSizeTestCase/,/^$/{/[0-9]{11}/d}' \ + tests/test__ped_ped.py + ''; + + preConfigure = '' + PATH="${parted}/sbin:$PATH" + ''; + + nativeBuildInputs = [ pkgconfig ]; + + propagatedBuildInputs = [ parted ]; + + checkPhase = '' + patchShebangs Makefile + make test PYTHON=${python.executable} + ''; + + meta = { + homepage = https://fedorahosted.org/pyparted/; + description = "Python interface for libparted"; + license = stdenv.lib.licenses.gpl2Plus; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/nixpart/default.nix b/nixpkgs/pkgs/tools/filesystems/nixpart/default.nix new file mode 100644 index 000000000000..809c5256873e --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/nixpart/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, buildPythonApplication, blivet }: + +buildPythonApplication rec { + pname = "nixpart"; + version = "1.0.0"; + + src = fetchurl { + url = "https://github.com/aszlig/nixpart/archive/v${version}.tar.gz"; + sha256 = "0avwd8p47xy9cydlbjxk8pj8q75zyl68gw2w6fnkk78dcb1a3swp"; + }; + + propagatedBuildInputs = [ blivet ]; + + meta = { + description = "NixOS storage manager/partitioner"; + license = stdenv.lib.licenses.gpl2Plus; + maintainers = [ stdenv.lib.maintainers.aszlig ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix b/nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix new file mode 100644 index 000000000000..1d402090355f --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/ntfs-3g/default.nix @@ -0,0 +1,49 @@ +{stdenv, fetchurl, utillinux, libuuid +, crypto ? false, libgcrypt, gnutls, pkgconfig}: + +stdenv.mkDerivation rec { + pname = "ntfs3g"; + version = "2017.3.23"; + + outputs = [ "out" "dev" "man" "doc" ]; + + buildInputs = [ libuuid ] ++ stdenv.lib.optionals crypto [ gnutls libgcrypt ]; + nativeBuildInputs = stdenv.lib.optional crypto pkgconfig; + + src = fetchurl { + url = "https://tuxera.com/opensource/ntfs-3g_ntfsprogs-${version}.tgz"; + sha256 = "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"; + }; + + patchPhase = '' + substituteInPlace src/Makefile.in --replace /sbin '@sbindir@' + substituteInPlace ntfsprogs/Makefile.in --replace /sbin '@sbindir@' + substituteInPlace libfuse-lite/mount_util.c \ + --replace /bin/mount ${utillinux}/bin/mount \ + --replace /bin/umount ${utillinux}/bin/umount + ''; + + configureFlags = [ + "--disable-ldconfig" + "--exec-prefix=\${prefix}" + "--enable-mount-helper" + "--enable-posix-acls" + "--enable-xattr-mappings" + "--${if crypto then "enable" else "disable"}-crypto" + "--enable-extras" + ]; + + postInstall = + '' + # Prefer ntfs-3g over the ntfs driver in the kernel. + ln -sv mount.ntfs-3g $out/sbin/mount.ntfs + ''; + + meta = with stdenv.lib; { + homepage = https://www.tuxera.com/community/open-source-ntfs-3g/; + description = "FUSE-based NTFS driver with full write support"; + maintainers = with maintainers; [ dezgeg ]; + platforms = platforms.linux; + license = licenses.gpl2Plus; # and (lib)fuse-lite under LGPL2+ + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/orangefs/default.nix b/nixpkgs/pkgs/tools/filesystems/orangefs/default.nix new file mode 100644 index 000000000000..37f4026799b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/orangefs/default.nix @@ -0,0 +1,61 @@ +{ stdenv, fetchurl, bison, flex, autoreconfHook +, openssl, db, attr, perl, tcsh +} : + +stdenv.mkDerivation rec { + pname = "orangefs"; + version = "2.9.7"; + + src = fetchurl { + url = "http://download.orangefs.org/current/source/orangefs-${version}.tar.gz"; + sha256 = "15669f5rcvn44wkas0mld0qmyclrmhbrw4bbbp66sw3a12vgn4sm"; + }; + + nativeBuildInputs = [ bison flex perl autoreconfHook ]; + buildInputs = [ openssl db attr tcsh ]; + + postPatch = '' + # Issue introduced by attr-2.4.48 + substituteInPlace src/apps/user/ofs_setdirhint.c --replace attr/xattr.h sys/xattr.h + + # Do not try to install empty sysconfdir + substituteInPlace Makefile.in --replace 'install -d $(sysconfdir)' "" + + # perl interpreter needs to be fixed or build fails + patchShebangs ./src/apps/admin/pvfs2-genconfig + + # symlink points to a location in /usr + rm ./src/client/webpack/ltmain.sh + ''; + + configureFlags = [ + "--sysconfdir=/etc/orangefs" + "--enable-shared" + "--enable-fast" + "--with-ssl=${stdenv.lib.getDev openssl}" + ]; + + + enableParallelBuilding = true; + + postInstall = '' + # install useful helper scripts + install examples/keys/pvfs2-gen-keys.sh $out/bin + ''; + + postFixup = '' + for f in pvfs2-getmattr pvfs2-setmattr; do + substituteInPlace $out/bin/$f --replace '#!/bin/csh' '#!${tcsh}/bin/tcsh' + done + + sed -i 's:openssl:${openssl}/bin/openssl:' $out/bin/pvfs2-gen-keys.sh + ''; + + meta = with stdenv.lib; { + description = "Scale-out network file system for use on high-end computing systems"; + homepage = "http://www.orangefs.org/"; + license = with licenses; [ asl20 bsd3 gpl2 lgpl21 lgpl21Plus openldap ]; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ markuskowa ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/rdfind/default.nix b/nixpkgs/pkgs/tools/filesystems/rdfind/default.nix new file mode 100644 index 000000000000..424f84ec34f9 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/rdfind/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl, nettle }: + +stdenv.mkDerivation rec { + pname = "rdfind"; + version = "1.4.1"; + + src = fetchurl { + url = "https://rdfind.pauldreik.se/${pname}-${version}.tar.gz"; + sha256 = "132y3wwgnbpdx6f90q0yahd3nkr4cjzcy815ilc8p97b4vn17iih"; + }; + + buildInputs = [ nettle ]; + + meta = with stdenv.lib; { + homepage = https://rdfind.pauldreik.se/; + description = "Removes or hardlinks duplicate files very swiftly"; + license = stdenv.lib.licenses.gpl2; + maintainers = [ maintainers.wmertens ]; + platforms = platforms.all; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix b/nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix new file mode 100644 index 000000000000..dbc391d00828 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/reiser4progs/default.nix @@ -0,0 +1,32 @@ +{stdenv, fetchurl, libaal}: + +let version = "2.0.0"; in +stdenv.mkDerivation rec { + pname = "reiser4progs"; + inherit version; + + src = fetchurl { + url = "mirror://sourceforge/reiser4/reiser4-utils/${pname}-${version}.tar.gz"; + sha256 = "00kx9prz3d5plp1hn4xdkkd99cw42sanlsjnjhj0fsrlmi9yfs8n"; + }; + + buildInputs = [libaal]; + + hardeningDisable = [ "format" ]; + + preConfigure = '' + substituteInPlace configure --replace " -static" "" + ''; + + preInstall = '' + substituteInPlace Makefile --replace ./run-ldconfig true + ''; + + meta = with stdenv.lib; { + inherit version; + homepage = https://sourceforge.net/projects/reiser4/; + description = "Reiser4 utilities"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix new file mode 100644 index 000000000000..a89ea0657500 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, libuuid, autoreconfHook }: + +let version = "3.6.24"; in +stdenv.mkDerivation rec { + pname = "reiserfsprogs"; + inherit version; + + src = fetchurl { + url = "https://www.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/v${version}/${pname}-${version}.tar.xz"; + sha256 = "0q07df9wxxih8714a3mdp61h5n347l7j2a0l351acs3xapzgwi3y"; + }; + + patches = [ ./reiserfsprogs-ar-fix.patch ]; + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ libuuid ]; + + NIX_CFLAGS_COMPILE = "-std=gnu90"; + + meta = { + inherit version; + homepage = http://www.namesys.com/; + description = "ReiserFS utilities"; + license = stdenv.lib.licenses.gpl2; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch new file mode 100644 index 000000000000..356782a3d984 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch @@ -0,0 +1,10 @@ +--- reiserfsprogs-3.6.24/configure.ac.orig 2018-11-29 17:16:52.313624894 +0300 ++++ reiserfsprogs-3.6.24/configure.ac 2018-11-29 17:16:54.480669132 +0300 +@@ -21,6 +21,7 @@ + AC_PROG_LN_S + AC_PROG_MAKE_SET + AC_PROG_RANLIB ++AM_PROG_AR + + dnl Checks for libraries. + diff --git a/nixpkgs/pkgs/tools/filesystems/relfs/default.nix b/nixpkgs/pkgs/tools/filesystems/relfs/default.nix new file mode 100644 index 000000000000..c99a95714c09 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/relfs/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchcvs, ocaml, fuse, postgresql, pcre +, libuuid, gnome_vfs, pkgconfig, GConf }: + +stdenv.mkDerivation { + name = "relfs-2008.03.05"; + + src = fetchcvs { + cvsRoot = ":pserver:anonymous@relfs.cvs.sourceforge.net:/cvsroot/relfs"; + module = "relfs"; + date = "2008-03-05"; + sha256 = "949f8eff7e74ff2666cccf8a1efbfcce8d54bc41bec6ad6db8c029de7ca832a3"; + }; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ ocaml fuse postgresql pcre libuuid gnome_vfs GConf ]; + + buildPhase = '' + cd deps + sed -e 's/^CPP/#&/ ; s/^# CPP=gcc/CPP=gcc/' -i Makefile.camlidl + make + cd ../src + sed -e 's/NULL\\|FALSE/0/g' -i Mimetype_lib.c + sed -e 's@/usr/local/@'\$out/'@' -i Makefile + sed -e '/install:/a\\\tmkdir -p '\$out'/share' -i Makefile + make + mkdir -p \$out/bin + echo ' + createuser -A -D \$1 + dropdb relfs_\$1 ; + rm -rf /tmp/relfs-\$1-tmp; + mkdir /tmp/relfs-\$1-tmp; + USER=\$1 relfs -f -s /tmp/relfs-\$1-tmp & + sleep 1 && + kill -15 \''${!}; + rm -rf /tmp/relfs-\$1-tmp ; + psql -d relfs_\$1 <<< \"ALTER DATABASE relfs_\$1 OWNER TO \$1; + ALTER TABLE obj OWNER TO \$1; + ALTER TABLE obj_mimetype OWNER TO \$1; + ALTER TABLE membership OWNER TO \$1;\"' > \$out/bin/relfs_grant; + chmod a+x \$out/bin/relfs_grant; + ''; + + meta = with stdenv.lib; { + description = "A relational filesystem on top of FUSE"; + homepage = http://relfs.sourceforge.net; + license = licenses.gpl2; + maintainers = [ maintainers.raskin ]; + platforms = platforms.linux; + broken = true; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/rmount/default.nix b/nixpkgs/pkgs/tools/filesystems/rmount/default.nix new file mode 100644 index 000000000000..46be9e30f70f --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/rmount/default.nix @@ -0,0 +1,32 @@ +{ stdenv, nmap, jq, cifs-utils, sshfs, fetchFromGitHub, makeWrapper }: + +stdenv.mkDerivation rec { + + pname = "rmount"; + version = "1.0.1"; + + src = fetchFromGitHub { + rev = "v${version}"; + owner = "Luis-Hebendanz"; + repo = "rmount"; + sha256 = "1wjmfvbsq3126z51f2ivj85cjmkrzdm2acqsiyqs57qga2g6w5p9"; + }; + + buildInputs = [ makeWrapper ]; + + installPhase = '' + install -D ${src}/rmount.man $out/share/man/man1/rmount.1 + install -D ${src}/rmount.bash $out/bin/rmount + install -D ${src}/config.json $out/share/config.json + + wrapProgram $out/bin/rmount --prefix PATH : ${stdenv.lib.makeBinPath [ nmap jq cifs-utils sshfs ]} + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/Luis-Hebendanz/rmount; + description = "Remote mount utility which parses a json file"; + license = licenses.mit; + maintainers = [ maintainers.luis ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/s3backer/default.nix b/nixpkgs/pkgs/tools/filesystems/s3backer/default.nix new file mode 100644 index 000000000000..186da6255ebf --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/s3backer/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub +, autoreconfHook, pkgconfig +, fuse, curl, expat }: + +stdenv.mkDerivation rec { + pname = "s3backer"; + version = "1.5.4"; + + src = fetchFromGitHub { + sha256 = "1228qlfgz48k9vv72hrz488zg73zls99cppb9vmikc0pzv1xndsx"; + rev = version; + repo = "s3backer"; + owner = "archiecobbs"; + }; + + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + buildInputs = [ fuse curl expat ]; + + autoreconfPhase = '' + patchShebangs ./autogen.sh + ./autogen.sh + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/archiecobbs/s3backer; + description = "FUSE-based single file backing store via Amazon S3"; + license = licenses.gpl2Plus; + platforms = with platforms; linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/s3fs/default.nix b/nixpkgs/pkgs/tools/filesystems/s3fs/default.nix new file mode 100644 index 000000000000..3fc082dad462 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/s3fs/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, curl, openssl, libxml2, fuse }: + +stdenv.mkDerivation rec { + pname = "s3fs-fuse"; + version = "1.85"; + + src = fetchFromGitHub { + owner = "s3fs-fuse"; + repo = "s3fs-fuse"; + rev = "v${version}"; + sha256 = "0sk2b7bxb2wzni1f39l4976dy47s7hqv62l7x7fwcjp62y22nw7m"; + }; + + buildInputs = [ curl openssl libxml2 fuse ]; + nativeBuildInputs = [ autoreconfHook pkgconfig ]; + + configureFlags = [ + "--with-openssl" + ]; + + postInstall = '' + ln -s $out/bin/s3fs $out/bin/mount.s3fs + ''; + + meta = with stdenv.lib; { + description = "Mount an S3 bucket as filesystem through FUSE"; + license = licenses.gpl2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix b/nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix new file mode 100644 index 000000000000..36ac3630e54d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/sasquatch/default.nix @@ -0,0 +1,53 @@ +{ fetchFromGitHub +, fetchurl +, lz4 ? null +, lz4Support ? false +, lzma +, lzo +, stdenv +, xz +, zlib +}: + +assert lz4Support -> (lz4 != null); + +let + patch = fetchFromGitHub { + owner = "devttys0"; + repo = "sasquatch"; + rev = "3e0cc40fc6dbe32bd3a5e6c553b3320d5d91ceed"; + sha256 = "19lhndjv7v9w6nmszry63zh5rqii9v7wvsbpc2n6q606hyz955g2"; + } + "/patches/patch0.txt"; +in +stdenv.mkDerivation rec { + pname = "sasquatch"; + version = "4.3"; + + src = fetchurl { + url = mirror://sourceforge/squashfs/squashfs4.3.tar.gz; + sha256 = "1xpklm0y43nd9i6jw43y2xh5zvlmj9ar2rvknh0bh7kv8c95aq0d"; + }; + + buildInputs = [ lzma lzo xz zlib ] + ++ stdenv.lib.optional lz4Support lz4; + + patches = [ patch ]; + patchFlags = [ "-p0" ]; + + postPatch = '' + cd squashfs-tools + ''; + + installFlags = [ "INSTALL_DIR=\${out}/bin" ]; + + makeFlags = [ "XZ_SUPPORT=1" ] + ++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1"; + + meta = with stdenv.lib; { + homepage = "https://github.com/devttys0/sasquatch"; + description = "Set of patches to the standard unsquashfs utility (part of squashfs-tools) that attempts to add support for as many hacked-up vendor-specific SquashFS implementations as possible"; + license = licenses.gpl2Plus; + maintainers = [ maintainers.pamplemousse ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/securefs/default.nix b/nixpkgs/pkgs/tools/filesystems/securefs/default.nix new file mode 100644 index 000000000000..c5a5af212d90 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/securefs/default.nix @@ -0,0 +1,37 @@ +{ stdenv, fetchFromGitHub +, cmake +, fuse }: + +stdenv.mkDerivation rec { + pname = "securefs"; + version = "0.8.3"; + + src = fetchFromGitHub { + sha256 = "0nf0bd163gz844mikqab2mh7xjlj31ixa6hi85qxdifyjpfjv7y4"; + rev = version; + repo = "securefs"; + owner = "netheril96"; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ fuse ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "Transparent encryption filesystem"; + longDescription = '' + Securefs is a filesystem in userspace (FUSE) that transparently encrypts + and authenticates data stored. It is particularly designed to secure + data stored in the cloud. + Securefs mounts a regular directory onto a mount point. The mount point + appears as a regular filesystem, where one can read/write/create files, + directories and symbolic links. The underlying directory will be + automatically updated to contain the encrypted and authenticated + contents. + ''; + license = with licenses; [ bsd2 mit ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/simg2img/default.nix b/nixpkgs/pkgs/tools/filesystems/simg2img/default.nix new file mode 100644 index 000000000000..78f80ecfa87a --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/simg2img/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, zlib }: + +stdenv.mkDerivation rec { + pname = "simg2img"; + version = "1.1.3"; + + src = fetchFromGitHub { + owner = "anestisb"; + repo = "android-simg2img"; + rev = version; + sha256 = "119gl9i61g2wr07hzv6mi1ihql6yd6pwq94ki2pgcpfbamv8f6si"; + }; + + buildInputs = [ zlib ]; + + makeFlags = [ "PREFIX=$(out)" ]; + + meta = with stdenv.lib; { + description = "Tool to convert Android sparse images to raw images"; + homepage = "https://github.com/anestisb/android-simg2img"; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = [ maintainers.dezgeg ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix new file mode 100644 index 000000000000..be46abb2694d --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, fuse, samba, pkgconfig, glib, autoconf, attr, libsecret }: + +stdenv.mkDerivation rec { + pname = "smbnetfs"; + version = "0.6.1"; + src = fetchurl { + url = "mirror://sourceforge/project/smbnetfs/smbnetfs/SMBNetFS-${version}/${pname}-${version}.tar.bz2"; + sha256 = "02iqjnm6pdwc1q38z56akiwdbp0xisr6qwrmxs1lrk5mq7j8x2w4"; + }; + + nativeBuildInputs = [ pkgconfig autoconf ]; + buildInputs = [ fuse samba glib attr libsecret ]; + + postPatch = '' + substituteInPlace src/function.c --replace "attr/xattr.h" "sys/xattr.h" + ''; + + meta = with stdenv.lib; { + description = "A FUSE FS for mounting Samba shares"; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + license = licenses.gpl2; + downloadPage = "https://sourceforge.net/projects/smbnetfs/files/smbnetfs"; + updateWalker = true; + inherit version; + homepage = https://sourceforge.net/projects/smbnetfs/; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream new file mode 100644 index 000000000000..d56fa42f1d1b --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/smbnetfs/default.upstream @@ -0,0 +1,6 @@ +url https://sourceforge.net/projects/smbnetfs/files/smbnetfs/ +version_link '[-][0-9.]+[a-z]*/$' +version_link '[.]tar[.][a-z0-9]+/download$' +SF_redirect +version '.*[-]([0-9.]+[a-z]*)[.]tar[.].*' '\1' +do_overwrite () { do_overwrite_just_version; } diff --git a/nixpkgs/pkgs/tools/filesystems/snapraid/default.nix b/nixpkgs/pkgs/tools/filesystems/snapraid/default.nix new file mode 100644 index 000000000000..b5ffdade98f8 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/snapraid/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchFromGitHub, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "snapraid"; + version = "11.3"; + + src = fetchFromGitHub { + owner = "amadvance"; + repo = "snapraid"; + rev = "v${version}"; + sha256 = "08rwz55njkr1w794y3hs8nxc11vzbv4drds9wgxpf6ps8qf9q49f"; + }; + + VERSION = version; + + doCheck = true; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ ]; + + meta = { + homepage = http://www.snapraid.it/; + description = "A backup program for disk arrays"; + license = stdenv.lib.licenses.gpl3; + maintainers = [ stdenv.lib.maintainers.makefu ]; + platforms = stdenv.lib.platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/0001-Fix-build-on-BSD-systems.patch b/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/0001-Fix-build-on-BSD-systems.patch new file mode 100644 index 000000000000..2834b046cef2 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/0001-Fix-build-on-BSD-systems.patch @@ -0,0 +1,103 @@ +From ea1bc0fcfd33191002c5d1f7072c1c02bb7ec4af Mon Sep 17 00:00:00 2001 +From: Alyssa Ross <hi@alyssa.is> +Date: Thu, 14 Nov 2019 15:45:46 +0000 +Subject: [PATCH] Fix build on BSD systems + +I tested FreeBSD, DragonflyBSD, NetBSD and OpenBSD and the endian +macros weren't necessary (and in fact caused errors) on all of them. + +Because OpenBSD ships with an ancient GCC that doesn't support the +checked addition/multiplication builtins, the build there would fail +unless built with CC=cc or CC=clang. I changed configure.ac to prefer +cc over gcc, so that the distribution's compiler preference is +respected. (The default is [gcc cc]). I had to move AC_PROG_CC above +LT_INIT because otherwise LT_INIT would run AC_PROG_CC first, and we +wouldn't have a chance to use non-default parameters. +--- + configure.ac | 2 +- + include/util/compat.h | 13 +++++-------- + lib/common/dirstack.c | 1 + + lib/common/mkdir_p.c | 2 +- + 4 files changed, 8 insertions(+), 10 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 018b3f6..19ea0ed 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3,8 +3,8 @@ AC_INIT([squashfs-tools-ng], [0.7], [goliath@infraroot.at], squashfs-tools-ng) + AC_CONFIG_MACRO_DIR([m4]) + AM_INIT_AUTOMAKE([foreign dist-xz subdir-objects]) + AM_SILENT_RULES([yes]) ++AC_PROG_CC([cc gcc clang]) + LT_INIT +-AC_PROG_CC + AC_PROG_CC_C99 + AC_PROG_INSTALL + AC_SYS_LARGEFILE +diff --git a/include/util/compat.h b/include/util/compat.h +index 74d0b6f..f53fd0e 100644 +--- a/include/util/compat.h ++++ b/include/util/compat.h +@@ -7,6 +7,10 @@ + #ifndef COMPAT_H + #define COMPAT_H + ++#ifndef __linux__ ++#define O_PATH 0 ++#endif ++ + #if defined(__APPLE__) + #include <libkern/OSByteOrder.h> + +@@ -17,14 +21,8 @@ + #define le32toh(x) OSSwapLittleToHostInt32(x) + #define le16toh(x) OSSwapLittleToHostInt16(x) + #define le64toh(x) OSSwapLittleToHostInt64(x) +-#elif defined(__OpenBSD__) ++#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #include <sys/endian.h> +-#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +-#include <sys/endian.h> +- +-#define le16toh(x) letoh16(x) +-#define le32toh(x) letoh32(x) +-#define le64toh(x) letoh64(x) + #elif defined(_WIN32) || defined(__WINDOWS__) + #define htole16(x) (x) + #define htole32(x) (x) +@@ -89,7 +87,6 @@ + #else + #include <sys/types.h> + #include <sys/stat.h> +-#include <sys/sysmacros.h> + #endif + + #endif /* COMPAT_H */ +diff --git a/lib/common/dirstack.c b/lib/common/dirstack.c +index 8f73898..f8d1278 100644 +--- a/lib/common/dirstack.c ++++ b/lib/common/dirstack.c +@@ -5,6 +5,7 @@ + * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at> + */ + #include "common.h" ++#include "util/compat.h" + + #include <string.h> + #include <stdlib.h> +diff --git a/lib/common/mkdir_p.c b/lib/common/mkdir_p.c +index cb433b3..95187ba 100644 +--- a/lib/common/mkdir_p.c ++++ b/lib/common/mkdir_p.c +@@ -7,7 +7,7 @@ + #include "common.h" + + #include <string.h> +-#include <alloca.h> ++#include <stdlib.h> + #include <stdio.h> + #include <errno.h> + +-- +2.23.0 + diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix b/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix new file mode 100644 index 000000000000..727e257a4861 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/squashfs-tools-ng/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchurl, fetchpatch, autoreconfHook, doxygen, graphviz, perl +, pkgconfig, lz4, xz, zlib, zstd +}: + +stdenv.mkDerivation rec { + pname = "squashfs-tools-ng"; + version = "0.7"; + + src = fetchurl { + url = "https://infraroot.at/pub/squashfs/squashfs-tools-ng-${version}.tar.xz"; + sha256 = "01yn621dnsfhrah3qj1xh6ynag7r3nvihc510sa5frapkyg9nw8n"; + }; + + patches = lib.optional (!stdenv.isLinux) ./0001-Fix-build-on-BSD-systems.patch; + + nativeBuildInputs = [ doxygen graphviz pkgconfig perl ] + ++ lib.optional (!stdenv.isLinux) autoreconfHook; + buildInputs = [ zlib xz lz4 zstd ]; + + meta = with lib; { + homepage = https://github.com/AgentD/squashfs-tools-ng; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ qyliss ]; + platforms = platforms.unix; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch b/nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch new file mode 100644 index 000000000000..e73c06788756 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/squashfs/4k-align.patch @@ -0,0 +1,98 @@ +This patch has been edited to apply to squashfs 4.4, commit +52eb4c279cd283ed9802dd1ceb686560b22ffb67. Below is the original +message body of the patch. + +From 7bda7c75748f36b0a50f93e46144d5a4de4974ad Mon Sep 17 00:00:00 2001 +From: Amin Hassani <ahassani@google.com> +Date: Thu, 15 Dec 2016 10:43:15 -0800 +Subject: [PATCH] mksquashfs 4K aligns the files inside the squashfs image + +Files inside a squashfs image are not necessarily 4k (4096) +aligned. This patch starts each file in a 4k aligned address and pads +zero to the end of the file until it reaches the next 4k aligned +address. This will not change the size of the compressed +blocks (especially the last one) and hence it will not change how the +files are being loaded in kernel or unsquashfs. However on average this +increases the size of the squashfs image which can be calculated by the +following formula: + +increased_size = (number_of_unfragmented_files_in_image + number of fragments) * 2048 + +The 4k alignment can be enabled by flag '-4k-align' +--- + squashfs-tools/mksquashfs.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c +index a45b77f..07b1c06 100644 +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -102,7 +102,9 @@ int old_exclude = TRUE; + int use_regex = FALSE; + int nopad = FALSE; + int exit_on_error = FALSE; ++int do_4k_align = FALSE; + long long start_offset = 0; ++#define ALIGN_UP(bytes, size) (bytes = (bytes + size - 1) & ~(size - 1)) + + long long global_uid = -1, global_gid = -1; + +@@ -1546,6 +1548,9 @@ void unlock_fragments() + * queue at this time. + */ + while(!queue_empty(locked_fragment)) { ++ // 4k align the start of remaining queued fragments. ++ if(do_4k_align) ++ ALIGN_UP(bytes, 4096); + write_buffer = queue_get(locked_fragment); + frg = write_buffer->block; + size = SQUASHFS_COMPRESSED_SIZE_BLOCK(fragment_table[frg].size); +@@ -2478,6 +2483,9 @@ void *frag_deflator(void *arg) + write_buffer->size = compressed_size; + pthread_mutex_lock(&fragment_mutex); + if(fragments_locked == FALSE) { ++ // 4k align the start of each fragment. ++ if(do_4k_align) ++ ALIGN_UP(bytes, 4096); + fragment_table[file_buffer->block].size = c_byte; + fragment_table[file_buffer->block].start_block = bytes; + write_buffer->block = bytes; +@@ -2877,6 +2885,10 @@ int write_file_blocks(squashfs_inode *inode, struct dir_ent *dir_ent, + long long sparse = 0; + struct file_buffer *fragment_buffer = NULL; + ++ // 4k align the start of each file. ++ if(do_4k_align) ++ ALIGN_UP(bytes, 4096); ++ + if(pre_duplicate(read_size)) + return write_file_blocks_dup(inode, dir_ent, read_buffer, dup); + +@@ -4972,6 +4984,7 @@ void write_filesystem_tables(struct squashfs_super_block *sBlk, int nopad) + "compressed", no_fragments ? "no" : noF ? "uncompressed" : + "compressed", no_xattrs ? "no" : noX ? "uncompressed" : + "compressed", noI || noId ? "uncompressed" : "compressed"); ++ printf("\t4k %saligned\n", do_4k_align ? "" : "un"); + printf("\tduplicates are %sremoved\n", duplicate_checking ? "" : + "not "); + printf("Filesystem size %.2f Kbytes (%.2f Mbytes)\n", bytes / 1024.0, +@@ -5853,6 +5866,8 @@ print_compressor_options: + root_name = argv[i]; + } else if(strcmp(argv[i], "-version") == 0) { + VERSION(); ++ } else if(strcmp(argv[i], "-4k-align") == 0) { ++ do_4k_align = TRUE; + } else { + ERROR("%s: invalid option\n\n", argv[0]); + printOptions: +@@ -5904,6 +5919,7 @@ printOptions: + ERROR("\t\t\tdirectory containing that directory, " + "rather than the\n"); + ERROR("\t\t\tcontents of the directory\n"); ++ ERROR("-4k-align\t\tenables 4k alignment of all files\n"); + ERROR("\nFilesystem filter options:\n"); + ERROR("-p <pseudo-definition>\tAdd pseudo file " + "definition\n"); +-- +2.23.0 + diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch b/nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch new file mode 100644 index 000000000000..eb2dc24ec1a8 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/squashfs/darwin.patch @@ -0,0 +1,357 @@ +Patch based on commits by Dave Vasilevsky <dave@vasilevsky.ca> and +Blake Riley <blake.riley@gmail.com>, squashed into a single patch, +with BSD-specific changes omitted. + +See also https://github.com/plougher/squashfs-tools/pull/69. + +diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c +index 4b06ccb..3cad2ab 100644 +--- a/squashfs-tools/action.c ++++ b/squashfs-tools/action.c +@@ -38,6 +38,10 @@ + #include <limits.h> + #include <errno.h> + ++#ifndef FNM_EXTMATCH /* glibc extension */ ++ #define FNM_EXTMATCH 0 ++#endif ++ + #include "squashfs_fs.h" + #include "mksquashfs.h" + #include "action.h" +@@ -2284,9 +2288,12 @@ static char *get_start(char *s, int n) + + static int subpathname_fn(struct atom *atom, struct action_data *action_data) + { +- return fnmatch(atom->argv[0], get_start(strdupa(action_data->subpath), ++ char *path = strdup(action_data->subpath); ++ int is_match = fnmatch(atom->argv[0], get_start(path, + count_components(atom->argv[0])), + FNM_PATHNAME|FNM_PERIOD|FNM_EXTMATCH) == 0; ++ free(path); ++ return is_match; + } + + /* +diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c +index fe23d78..5c2f835 100644 +--- a/squashfs-tools/info.c ++++ b/squashfs-tools/info.c +@@ -144,31 +144,22 @@ void dump_state() + void *info_thrd(void *arg) + { + sigset_t sigmask; +- struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 }; +- int sig, waiting = 0; ++ int sig, err, waiting = 0; + + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGQUIT); + sigaddset(&sigmask, SIGHUP); ++ sigaddset(&sigmask, SIGALRM); + + while(1) { +- if(waiting) +- sig = sigtimedwait(&sigmask, NULL, ×pec); +- else +- sig = sigwaitinfo(&sigmask, NULL); ++ err = sigwait(&sigmask, &sig); + +- if(sig == -1) { ++ if(err == -1) { + switch(errno) { +- case EAGAIN: +- /* interval timed out */ +- waiting = 0; +- /* FALLTHROUGH */ + case EINTR: +- /* if waiting, the wait will be longer, but +- that's OK */ + continue; + default: +- BAD_ERROR("sigtimedwait/sigwaitinfo failed " ++ BAD_ERROR("sigwait failed " + "because %s\n", strerror(errno)); + } + } +@@ -179,8 +170,12 @@ void *info_thrd(void *arg) + /* set one second interval period, if ^\ received + within then, dump queue and cache status */ + waiting = 1; +- } else ++ alarm(1); ++ } else if (sig == SIGQUIT) { + dump_state(); ++ } else if (sig == SIGALRM) { ++ waiting = 0; ++ } + } + } + +diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c +index a45b77f..3607448 100644 +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -35,7 +35,12 @@ + #include <stddef.h> + #include <sys/types.h> + #include <sys/stat.h> ++#ifndef linux ++#include <sys/sysctl.h> ++#else ++#include <sys/sysinfo.h> + #include <sys/sysmacros.h> ++#endif + #include <fcntl.h> + #include <errno.h> + #include <dirent.h> +@@ -50,7 +55,10 @@ + #include <sys/wait.h> + #include <limits.h> + #include <ctype.h> +-#include <sys/sysinfo.h> ++ ++#ifndef FNM_EXTMATCH /* glibc extension */ ++ #define FNM_EXTMATCH 0 ++#endif + + #ifndef linux + #define __BYTE_ORDER BYTE_ORDER +@@ -4348,6 +4356,7 @@ void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGQUIT); + sigaddset(&sigmask, SIGHUP); ++ sigaddset(&sigmask, SIGALRM); + if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) + BAD_ERROR("Failed to set signal mask in intialise_threads\n"); + +@@ -5195,6 +5204,35 @@ int get_physical_memory() + long long page_size = sysconf(_SC_PAGESIZE); + int phys_mem; + ++#ifndef linux ++ #ifdef HW_MEMSIZE ++ #define SYSCTL_PHYSMEM HW_MEMSIZE ++ #elif defined(HW_PHYSMEM64) ++ #define SYSCTL_PHYSMEM HW_PHYSMEM64 ++ #else ++ #define SYSCTL_PHYSMEM HW_PHYSMEM ++ #endif ++ ++ int mib[2]; ++ uint64_t sysctl_physmem = 0; ++ size_t sysctl_len = sizeof(sysctl_physmem); ++ ++ mib[0] = CTL_HW; ++ mib[1] = SYSCTL_PHYSMEM; ++ ++ if(sysctl(mib, 2, &sysctl_physmem, &sysctl_len, NULL, 0) == 0) { ++ /* some systems use 32-bit values, work with what we're given */ ++ if (sysctl_len == 4) ++ sysctl_physmem = *(uint32_t*)&sysctl_physmem; ++ phys_mem = sysctl_physmem >> 20; ++ } else { ++ ERROR_START("Failed to get amount of available " ++ "memory."); ++ ERROR_EXIT(" Defaulting to least viable amount\n"); ++ phys_mem = SQUASHFS_LOWMEM; ++ } ++ #undef SYSCTL_PHYSMEM ++#else + if(num_pages == -1 || page_size == -1) { + struct sysinfo sys; + int res = sysinfo(&sys); +@@ -5207,6 +5245,7 @@ int get_physical_memory() + } + + phys_mem = num_pages * page_size >> 20; ++#endif + + if(phys_mem < SQUASHFS_LOWMEM) + BAD_ERROR("Mksquashfs requires more physical memory than is " +diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c +index 4debedf..3257c30 100644 +--- a/squashfs-tools/read_xattrs.c ++++ b/squashfs-tools/read_xattrs.c +@@ -39,13 +39,13 @@ + #include <endian.h> + #endif + ++#include <stdlib.h> ++ + #include "squashfs_fs.h" + #include "squashfs_swap.h" + #include "xattr.h" + #include "error.h" + +-#include <stdlib.h> +- + extern int read_fs_bytes(int, long long, int, void *); + extern int read_block(int, long long, long long *, int, void *); + +diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c +index 727f1d5..c1a6183 100644 +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -32,8 +32,12 @@ + #include "stdarg.h" + #include "fnmatch_compat.h" + ++#ifndef linux ++#include <sys/sysctl.h> ++#else + #include <sys/sysinfo.h> + #include <sys/sysmacros.h> ++#endif + #include <sys/types.h> + #include <sys/time.h> + #include <sys/resource.h> +@@ -1080,7 +1084,7 @@ int create_inode(char *pathname, struct inode *i) + break; + case SQUASHFS_SYMLINK_TYPE: + case SQUASHFS_LSYMLINK_TYPE: { +- struct timespec times[2] = { ++ struct timeval times[2] = { + { i->time, 0 }, + { i->time, 0 } + }; +@@ -1099,8 +1103,7 @@ int create_inode(char *pathname, struct inode *i) + goto failed; + } + +- res = utimensat(AT_FDCWD, pathname, times, +- AT_SYMLINK_NOFOLLOW); ++ res = lutimes(pathname, times); + if(res == -1) { + EXIT_UNSQUASH_STRICT("create_inode: failed to set time on " + "%s, because %s\n", pathname, +@@ -2235,6 +2238,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size) + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGQUIT); + sigaddset(&sigmask, SIGHUP); ++ sigaddset(&sigmask, SIGALRM); + if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) + EXIT_UNSQUASH("Failed to set signal mask in initialise_threads" + "\n"); +diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h +index 934618b..0e680ab 100644 +--- a/squashfs-tools/unsquashfs.h ++++ b/squashfs-tools/unsquashfs.h +@@ -46,6 +46,10 @@ + #include <sys/ioctl.h> + #include <sys/time.h> + ++#ifndef FNM_EXTMATCH /* glibc extension */ ++ #define FNM_EXTMATCH 0 ++#endif ++ + #ifndef linux + #define __BYTE_ORDER BYTE_ORDER + #define __BIG_ENDIAN BIG_ENDIAN +diff --git a/squashfs-tools/unsquashfs_info.c b/squashfs-tools/unsquashfs_info.c +index c8e2b9b..7d4f7af 100644 +--- a/squashfs-tools/unsquashfs_info.c ++++ b/squashfs-tools/unsquashfs_info.c +@@ -97,31 +97,22 @@ void dump_state() + void *info_thrd(void *arg) + { + sigset_t sigmask; +- struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 }; +- int sig, waiting = 0; ++ int sig, err, waiting = 0; + + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGQUIT); + sigaddset(&sigmask, SIGHUP); ++ sigaddset(&sigmask, SIGALRM); + + while(1) { +- if(waiting) +- sig = sigtimedwait(&sigmask, NULL, ×pec); +- else +- sig = sigwaitinfo(&sigmask, NULL); ++ err = sigwait(&sigmask, &sig); + +- if(sig == -1) { ++ if(err == -1) { + switch(errno) { +- case EAGAIN: +- /* interval timed out */ +- waiting = 0; +- /* FALLTHROUGH */ + case EINTR: +- /* if waiting, the wait will be longer, but +- that's OK */ + continue; + default: +- BAD_ERROR("sigtimedwait/sigwaitinfo failed " ++ BAD_ERROR("sigwait failed " + "because %s\n", strerror(errno)); + } + } +@@ -133,8 +124,12 @@ void *info_thrd(void *arg) + /* set one second interval period, if ^\ received + within then, dump queue and cache status */ + waiting = 1; +- } else ++ alarm(1); ++ } else if (sig == SIGQUIT) { + dump_state(); ++ } else if (sig == SIGALRM) { ++ waiting = 0; ++ } + } + } + +diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c +index 7742dfe..f8cd3b6 100644 +--- a/squashfs-tools/unsquashfs_xattr.c ++++ b/squashfs-tools/unsquashfs_xattr.c +@@ -27,6 +27,11 @@ + + #include <sys/xattr.h> + ++#ifdef XATTR_NOFOLLOW /* Apple's xattrs */ ++ #define lsetxattr(path_, name_, val_, sz_, flags_) \ ++ setxattr(path_, name_, val_, sz_, 0, flags_ | XATTR_NOFOLLOW) ++#endif ++ + #define NOSPACE_MAX 10 + + extern int root_process; +diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c +index 64dfd82..d82d186 100644 +--- a/squashfs-tools/xattr.c ++++ b/squashfs-tools/xattr.c +@@ -22,6 +22,14 @@ + * xattr.c + */ + ++#ifndef linux ++#define __BYTE_ORDER BYTE_ORDER ++#define __BIG_ENDIAN BIG_ENDIAN ++#define __LITTLE_ENDIAN LITTLE_ENDIAN ++#else ++#include <endian.h> ++#endif ++ + #define TRUE 1 + #define FALSE 0 + +@@ -36,6 +44,13 @@ + #include <stdlib.h> + #include <sys/xattr.h> + ++#ifdef XATTR_NOFOLLOW /* Apple's xattrs */ ++ #define llistxattr(path_, buf_, sz_) \ ++ listxattr(path_, buf_, sz_, XATTR_NOFOLLOW) ++ #define lgetxattr(path_, name_, val_, sz_) \ ++ getxattr(path_, name_, val_, sz_, 0, XATTR_NOFOLLOW) ++#endif ++ + #include "squashfs_fs.h" + #include "squashfs_swap.h" + #include "mksquashfs.h" +-- +2.23.0 + diff --git a/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix b/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix new file mode 100644 index 000000000000..f02a913bc257 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchFromGitHub, zlib, xz +, lz4 ? null +, lz4Support ? false +, zstd +}: + +assert lz4Support -> (lz4 != null); + +stdenv.mkDerivation { + pname = "squashfs"; + version = "4.4"; + + src = fetchFromGitHub { + owner = "plougher"; + repo = "squashfs-tools"; + sha256 = "0697fv8n6739mcyn57jclzwwbbqwpvjdfkv1qh9s56lvyqnplwaw"; + # Tag "4.4" points to this commit. + rev = "52eb4c279cd283ed9802dd1ceb686560b22ffb67"; + }; + + patches = [ + # This patch adds an option to pad filesystems (increasing size) in + # exchange for better chunking / binary diff calculation. + ./4k-align.patch + ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch; + + buildInputs = [ zlib xz zstd ] + ++ stdenv.lib.optional lz4Support lz4; + + preBuild = "cd squashfs-tools"; + + installFlags = [ "INSTALL_DIR=\${out}/bin" ]; + + makeFlags = [ "XZ_SUPPORT=1" "ZSTD_SUPPORT=1" ] + ++ stdenv.lib.optional lz4Support "LZ4_SUPPORT=1"; + + meta = { + homepage = http://squashfs.sourceforge.net/; + description = "Tool for creating and unpacking squashfs filesystems"; + platforms = stdenv.lib.platforms.unix; + license = stdenv.lib.licenses.gpl2Plus; + maintainers = with stdenv.lib.maintainers; [ ruuda ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix new file mode 100644 index 000000000000..e828698b0e97 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/squashfuse/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, libtool, fuse, + pkgconfig, lz4, xz, zlib, lzo, zstd }: + +with stdenv.lib; + +stdenv.mkDerivation rec { + + pname = "squashfuse"; + version = "0.1.103"; + + meta = { + description = "FUSE filesystem to mount squashfs archives"; + homepage = https://github.com/vasi/squashfuse; + maintainers = [ maintainers.genesis ]; + platforms = platforms.linux; + license = "BSD-2-Clause"; + }; + + # platforms.darwin should be supported : see PLATFORMS file in src. + # we could use a nix fuseProvider, and let the derivation choose the OS + # specific implementation. + + src = fetchFromGitHub { + owner = "vasi"; + repo = pname; + rev = "540204955134eee44201d50132a5f66a246bcfaf"; + sha256 = "062s77y32p80vc24a79z31g90b9wxzvws1xvicgx5fn1pd0xa0q6"; + }; + + nativeBuildInputs = [ autoreconfHook libtool pkgconfig ]; + buildInputs = [ lz4 xz zlib lzo zstd fuse ]; +} diff --git a/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix new file mode 100644 index 000000000000..018dfe7858e3 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix @@ -0,0 +1,52 @@ +{ stdenv, fetchFromGitHub +, meson, pkgconfig, ninja, docutils, makeWrapper +, fuse3, glib +, which, python3Packages +, openssh +}: + +stdenv.mkDerivation rec { + version = "3.7.0"; + pname = "sshfs-fuse"; + + src = fetchFromGitHub { + owner = "libfuse"; + repo = "sshfs"; + rev = "sshfs-${version}"; + sha256 = "119qvjaai3nqs2psqk2kv4gxjchrnrcfnmlwk7yxnj3v59pgyxhv"; + }; + + nativeBuildInputs = [ meson pkgconfig ninja docutils makeWrapper ]; + buildInputs = [ fuse3 glib ]; + checkInputs = [ which python3Packages.pytest ]; + + NIX_CFLAGS_COMPILE = stdenv.lib.optionalString + (stdenv.hostPlatform.system == "i686-linux") + "-D_FILE_OFFSET_BITS=64"; + + postInstall = '' + mkdir -p $out/sbin + ln -sf $out/bin/sshfs $out/sbin/mount.sshfs + wrapProgram $out/bin/sshfs --prefix PATH : "${openssh}/bin" + ''; + + #doCheck = true; + checkPhase = '' + # The tests need fusermount: + mkdir bin && cp ${fuse3}/bin/fusermount3 bin/fusermount + export PATH=bin:$PATH + # Can't access /dev/fuse within the sandbox: "FUSE kernel module does not seem to be loaded" + substituteInPlace test/util.py --replace "/dev/fuse" "/dev/null" + # TODO: "fusermount executable not setuid, and we are not root" + # We should probably use a VM test instead + python3 -m pytest test/ + ''; + + meta = with stdenv.lib; { + inherit (src.meta) homepage; + description = "FUSE-based filesystem that allows remote filesystems to be mounted over SSH"; + platforms = platforms.linux; + license = licenses.gpl2; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/svnfs/default.nix b/nixpkgs/pkgs/tools/filesystems/svnfs/default.nix new file mode 100644 index 000000000000..ebfb211732e8 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/svnfs/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchurl, automake, autoconf, subversion, fuse, apr, perl }: + +stdenv.mkDerivation { + name = "svnfs-0.4"; + + src = fetchurl { + url = http://www.jmadden.eu/wp-content/uploads/svnfs/svnfs-0.4.tgz; + sha256 = "1lrzjr0812lrnkkwk60bws9k1hq2iibphm0nhqyv26axdsygkfky"; + }; + + buildInputs = [automake autoconf subversion fuse apr perl]; + + # why is this required? + preConfigure='' + export LD_LIBRARY_PATH=${subversion.out}/lib + ''; + + NIX_CFLAGS_COMPILE="-I ${subversion.dev}/include/subversion-1"; + NIX_LDFLAGS="-lsvn_client-1 -lsvn_subr-1"; + + meta = { + description = "FUSE filesystem for accessing Subversion repositories"; + homepage = http://www.jmadden.eu/index.php/svnfs/; + license = stdenv.lib.licenses.gpl2; + maintainers = [stdenv.lib.maintainers.marcweber]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix b/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix new file mode 100644 index 000000000000..67e21ac4c2c4 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/tmsu/default.nix @@ -0,0 +1,62 @@ +{ stdenv, fetchgit, fetchFromGitHub, go, fuse }: + +stdenv.mkDerivation rec { + pname = "tmsu"; + version = "0.7.4"; + + go-sqlite3 = fetchgit { + url = "git://github.com/mattn/go-sqlite3"; + rev = "c9a0db5d8951646743317f0756da0339fe144dd5"; + sha256 = "1m0q9869fis0dhg34g5wc5xi6pby491spfxi23w461h29higbrqh"; + }; + + go-fuse = fetchgit { + url = "git://github.com/hanwen/go-fuse"; + rev = "8c85ded140ac1889372a0e22d8d21e3d10a303bd"; + sha256 = "1iph2hpvby2mfwqg9pp39xjqdl9a09h4442yfdn5l67pznljh2bi"; + }; + + src = fetchFromGitHub { + owner = "oniony"; + repo = "tmsu"; + rev = "v${version}"; + sha256 = "1g9gxlll2g4qkqbrshq3888sy1lgw6p5dvcrl5qyh6w73yimi1cq"; + }; + + buildInputs = [ go fuse ]; + + preBuild = '' + mkdir -p src/github.com/mattn/go-sqlite3/ + ln -s ${go-sqlite3}/* src/github.com/mattn/go-sqlite3 + + mkdir -p src/github.com/hanwen/go-fuse + ln -s ${go-fuse}/* src/github.com/hanwen/go-fuse + + mkdir -p src/github.com/oniony/tmsu + ln -s ${src}/* src/github.com/oniony/tmsu + + patchShebangs tests/. + + export GOPATH=$PWD + export GOCACHE=$TMPDIR/go-cache + ''; + + installPhase = '' + mkdir -p $out/bin + mkdir -p $out/sbin + mkdir -p $out/share/man/man1 + mkdir -p $out/share/zsh/site-functions + make install INSTALL_DIR=$out/bin \ + MOUNT_INSTALL_DIR=$out/sbin \ + MAN_INSTALL_DIR=$out/share/man/man1 \ + ZSH_COMP_INSTALL_DIR=$out/share/zsh/site-functions + ''; + + meta = with stdenv.lib; { + homepage = http://www.tmsu.org; + description = "A tool for tagging your files using a virtual filesystem"; + maintainers = with maintainers; [ pSub ]; + license = licenses.gpl3; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix b/nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix new file mode 100644 index 000000000000..62b4b9301397 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/u3-tool/default.nix @@ -0,0 +1,21 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "u3-tool"; + version = "0.3"; + + enableParallelBuilding = true; + + src = fetchurl { + url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz"; + sha256 = "1p9c9kibd1pdbdfa0nd0i3n7bvzi3xg0chm38jg3xfl8gsn0390f"; + }; + + meta = with stdenv.lib; { + description = "Tool for controlling the special features of a 'U3 smart drive' USB Flash disk"; + homepage = https://sourceforge.net/projects/u3-tool/ ; + license = licenses.gpl2; + platforms = with platforms; linux; + maintainers = with maintainers; [ makefu ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/udftools/default.nix b/nixpkgs/pkgs/tools/filesystems/udftools/default.nix new file mode 100644 index 000000000000..9efaf96182d7 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/udftools/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, ncurses, readline, autoreconfHook }: + +stdenv.mkDerivation rec { + pname = "udftools"; + version = "2.0"; + src = fetchFromGitHub { + owner = "pali"; + repo = "udftools"; + rev = version; + sha256 = "0mz04h3rki6ljwfs15z83gf4vv816w7xgz923waiqgmfj9xpvx87"; + }; + + buildInputs = [ ncurses readline ]; + nativeBuildInputs = [ autoreconfHook ]; + + hardeningDisable = [ "fortify" ]; + + NIX_CFLAGS_COMPILE = "-std=gnu90"; + + preConfigure = '' + sed -e '1i#include <limits.h>' -i cdrwtool/cdrwtool.c -i pktsetup/pktsetup.c + sed -e 's@[(]char[*][)]spm [+]=@spm = ((char*) spm) + @' -i wrudf/wrudf.c + sed -e '27i#include <string.h>' -i include/udf_endian.h + sed -e '38i#include <string.h>' -i wrudf/wrudf-cdrw.c + sed -e '12i#include <string.h>' -i wrudf/wrudf-cdr.c + sed -e '37i#include <stdlib.h>' -i wrudf/ide-pc.c + + sed -e "s@\$(DESTDIR)/lib/udev/rules.d@$out/lib/udev/rules.d@" -i pktsetup/Makefile.am + ''; + + postFixup = '' + sed -i -e "s@/usr/sbin/pktsetup@$out/sbin/pktsetup@" $out/lib/udev/rules.d/80-pktsetup.rules + ''; + + meta = with stdenv.lib; { + description = "UDF tools"; + maintainers = with maintainers; [ raskin ]; + platforms = platforms.linux; + license = licenses.gpl2Plus; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix new file mode 100644 index 000000000000..73272b83989e --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchFromGitHub, cmake, fuse }: + +stdenv.mkDerivation rec { + pname = "unionfs-fuse"; + version = "2.0"; + + src = fetchFromGitHub { + owner = "rpodgorny"; + repo = "unionfs-fuse"; + rev = "v${version}"; + sha256 = "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"; + }; + + patches = + [ # Prevent the unionfs daemon from being killed during + # shutdown. See + # http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons/ + # for details. + ./prevent-kill-on-shutdown.patch + ]; + + buildInputs = [ cmake fuse ]; + + # Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it + # possible to do: + # mount -t unionfs-fuse none /dest -o dirs=/source1=RW,/source2=RO + # + # This must be done in preConfigure because the build process removes + # helper from the source directory during the build. + preConfigure = '' + mkdir -p $out/sbin + cp -a mount.unionfs $out/sbin/mount.unionfs-fuse + substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse + substituteInPlace $out/sbin/mount.unionfs-fuse --replace unionfs $out/bin/unionfs + ''; + + meta = with stdenv.lib; { + description = "FUSE UnionFS implementation"; + homepage = https://github.com/rpodgorny/unionfs-fuse; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = with maintainers; [ orivej ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch new file mode 100644 index 000000000000..0a98b83282b6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/unionfs-fuse/prevent-kill-on-shutdown.patch @@ -0,0 +1,14 @@ +diff -ru -x '*~' unionfs-fuse-0.26-orig/src/unionfs.c unionfs-fuse-0.26/src/unionfs.c +--- unionfs-fuse-0.26-orig/src/unionfs.c 2012-09-11 00:06:32.000000000 +0200 ++++ unionfs-fuse-0.26/src/unionfs.c 2014-05-21 14:22:03.597861805 +0200 +@@ -831,6 +831,10 @@ + } + #endif + ++ /* Prevent systemd's shutdown from killing us. */ ++ if (access("/etc/initrd-release", F_OK) >= 0) ++ argv[0][0] = '@'; ++ + umask(0); + int res = fuse_main(args.argc, args.argv, &unionfs_oper, NULL); + RETURN(uopt.doexit ? uopt.retval : res); diff --git a/nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix b/nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix new file mode 100644 index 000000000000..c15a782fa3c6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/vmfs-tools/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, pkgconfig +, asciidoc, docbook_xsl, fuse, libuuid, libxslt }: + +stdenv.mkDerivation { + name = "vmfs-tools"; + + src = fetchFromGitHub { + owner = "glandium"; + repo = "vmfs-tools"; + rev = "4ab76ef5b074bdf06e4b518ff6d50439de05ae7f"; + sha256 = "14y412ww5hxk336ils62s3fwykfh6mx1j0iiaa5cwc615pi6qvi4"; + }; + + nativeBuildInputs = [ asciidoc docbook_xsl fuse libuuid libxslt pkgconfig ]; + + enableParallelBuilding = true; + + meta = with stdenv.lib; { + homepage = https://github.com/glandium/vmfs-tools; + description = "FUSE-based VMFS (vmware) mounting tools"; + maintainers = with maintainers; [ peterhoeg ]; + platforms = platforms.linux; + license = licenses.gpl2; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/wdfs/default.nix b/nixpkgs/pkgs/tools/filesystems/wdfs/default.nix new file mode 100644 index 000000000000..50a50ad18f05 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/wdfs/default.nix @@ -0,0 +1,18 @@ +{stdenv, fetchurl, glib, neon, fuse, pkgconfig}: + +stdenv.mkDerivation { + name = "wdfs-fuse-1.4.2"; + src = fetchurl { + url = "http://noedler.de/projekte/wdfs/wdfs-1.4.2.tar.gz"; + sha256 = "fcf2e1584568b07c7f3683a983a9be26fae6534b8109e09167e5dff9114ba2e5"; + }; + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [fuse glib neon]; + + meta = with stdenv.lib; { + homepage = http://noedler.de/projekte/wdfs/; + license = licenses.gpl2; + description = "User-space filesystem that allows to mount a webdav share"; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix b/nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix new file mode 100644 index 000000000000..aa28ee625969 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/xfsprogs/default.nix @@ -0,0 +1,65 @@ +{ stdenv, buildPackages, fetchpatch, fetchgit, autoconf, automake, gettext, libtool, pkgconfig +, icu, libuuid, readline +}: + +let + gentooPatch = name: sha256: fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-fs/xfsprogs/files/${name}?id=2517dd766cf84d251631f4324f7ec4bce912abb9"; + inherit sha256; + }; +in + +stdenv.mkDerivation rec { + pname = "xfsprogs"; + version = "4.19.0"; + + src = fetchgit { + url = "https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git"; + rev = "v${version}"; + sha256 = "18728hzfxr1bg4bdzqlxjs893ac1zwlfr7nmc2q4a1sxs0sphd1d"; + }; + + outputs = [ "bin" "dev" "out" "doc" ]; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + nativeBuildInputs = [ + autoconf automake libtool gettext pkgconfig + libuuid # codegen tool uses libuuid + ]; + buildInputs = [ readline icu ]; + propagatedBuildInputs = [ libuuid ]; # Dev headers include <uuid/uuid.h> + + enableParallelBuilding = true; + + # Why is all this garbage needed? Why? Why? + patches = [ + (gentooPatch "xfsprogs-4.15.0-sharedlibs.patch" "0bv2naxpiw7vcsg8p1v2i47wgfda91z1xy1kfwydbp4wmb4nbyyv") + (gentooPatch "xfsprogs-4.15.0-docdir.patch" "1srgdidvq2ka0rmfdwpqp92fapgh53w1h7rajm4nnby5vp2v8dfr") + (gentooPatch "xfsprogs-4.9.0-underlinking.patch" "1r7l8jphspy14i43zbfnjrnyrdm4cpgyfchblascxylmans0gci7") + ]; + + preConfigure = '' + sed -i Makefile -e '/cp include.install-sh/d' + make configure + ''; + + configureFlags = [ + "--disable-lib64" + "--enable-readline" + ]; + + installFlags = [ "install-dev" ]; + + # FIXME: forbidden rpath + postInstall = '' + find . -type d -name .libs | xargs rm -rf + ''; + + meta = with stdenv.lib; { + homepage = http://xfs.org/; + description = "SGI XFS utilities"; + license = licenses.lgpl21; + platforms = platforms.linux; + maintainers = with maintainers; [ dezgeg ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix b/nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix new file mode 100644 index 000000000000..d8d414500793 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/xtreemfs/default.nix @@ -0,0 +1,78 @@ +{ stdenv, boost, fuse, openssl, cmake, attr, jdk, ant, which, file, python +, lib, valgrind, makeWrapper, fetchFromGitHub, fetchpatch }: + +stdenv.mkDerivation { + src = fetchFromGitHub { + # using unstable release because stable (v1.5.1) has broken repl java plugin + rev = "7ddcb081aa125b0cfb008dc98addd260b8353ab3"; + owner = "xtreemfs"; + repo = "xtreemfs"; + sha256 = "1hjmd32pla27zf98ghzz6r5ml8ry86m9dsryv1z01kxv5l95b3m0"; + }; + + pname = "XtreemFS"; + version = "1.5.1.81"; + + buildInputs = [ which attr makeWrapper python ]; + + patches = [ + (fetchpatch { + url = "https://github.com/xtreemfs/xtreemfs/commit/ebfdc2fff56c09f310159d92026883941e42a953.patch"; + sha256 = "075w00ad88qm6xpm5679m0gfzkrc53w17sk7ycybf4hzxjs29ygy"; + name = "xtreemfs-fix-for-openssl_1_1"; + }) + ]; + + preConfigure = '' + export JAVA_HOME=${jdk} + export ANT_HOME=${ant} + + export BOOST_INCLUDEDIR=${boost.dev}/include + export BOOST_LIBRARYDIR=${boost.out}/lib + export CMAKE_INCLUDE_PATH=${openssl.dev}/include + export CMAKE_LIBRARY_PATH=${openssl.out}/lib + + substituteInPlace cpp/cmake/FindValgrind.cmake \ + --replace "/usr/local" "${valgrind}" + + substituteInPlace cpp/CMakeLists.txt \ + --replace '"/lib64" "/usr/lib64"' '"${attr.out}/lib" "${fuse}/lib"' + + export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${fuse}/include" + export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -L${fuse}/lib" + + export DESTDIR=$out + + substituteInPlace Makefile \ + --replace "/usr/share/" "/share/" \ + --replace 'BIN_DIR=$(DESTDIR)/usr/bin' "BIN_DIR=$out/bin" + + substituteInPlace etc/init.d/generate_initd_scripts.sh \ + --replace "/bin/bash" "${stdenv.shell}" + + substituteInPlace cpp/thirdparty/gtest-1.7.0/configure \ + --replace "/usr/bin/file" "${file}/bin/file" + + substituteInPlace cpp/thirdparty/protobuf-2.5.0/configure \ + --replace "/usr/bin/file" "${file}/bin/file" + + substituteInPlace cpp/thirdparty/protobuf-2.5.0/gtest/configure \ + --replace "/usr/bin/file" "${file}/bin/file" + + # do not put cmake into buildInputs + export PATH="$PATH:${cmake}/bin" + ''; + + doCheck = false; + + postInstall = '' + rm -r $out/sbin + ''; + + meta = { + description = "A distributed filesystem"; + maintainers = with lib.maintainers; [ raskin matejc ]; + platforms = lib.platforms.linux; + license = lib.licenses.bsd3; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix b/nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix new file mode 100644 index 000000000000..041d9a4e3f8b --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/yandex-disk/default.nix @@ -0,0 +1,64 @@ +{ stdenv, fetchurl, writeText, zlib, rpmextract, patchelf, which }: + +let + p = if stdenv.is64bit then { + arch = "x86_64"; + gcclib = "${stdenv.cc.cc.lib}/lib64"; + sha256 = "14bpc5ddhxvgfxkxhj5q9z443s7z4nn1zf4k1hxj7rbf13rcpg00"; + } + else { + arch = "i386"; + gcclib = "${stdenv.cc.cc.lib}/lib"; + sha256 = "1s829q8gy9xgz0jm7w70aljqs2h49x402blqfr9zvn806aprmrm5"; + }; +in +stdenv.mkDerivation rec { + + pname = "yandex-disk"; + version = "0.1.5.1039"; + + src = fetchurl { + url = "https://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${pname}-${version}-1.fedora.${p.arch}.rpm"; + sha256 = p.sha256; + }; + + builder = writeText "builder.sh" '' + . $stdenv/setup + mkdir -pv $out/bin + mkdir -pv $out/share + mkdir -pv $out/etc + + mkdir -pv unpacked + cd unpacked + ${rpmextract}/bin/rpmextract $src + + cp -r -t $out/bin usr/bin/* + cp -r -t $out/share usr/share/* + cp -r -t $out/etc etc/* + + sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \ + $out/etc/bash_completion.d/yandex-disk-completion.bash + + ${patchelf}/bin/patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "${zlib.out}/lib:${p.gcclib}" \ + $out/bin/yandex-disk + ''; + + meta = { + homepage = http://help.yandex.com/disk/cli-clients.xml; + description = "A free cloud file storage service"; + maintainers = with stdenv.lib.maintainers; [ smironov jagajaga ]; + platforms = ["i686-linux" "x86_64-linux"]; + license = stdenv.lib.licenses.unfree; + longDescription = '' + Yandex.Disk console client for Linux lets you manage files on Disk without + using a window interface or programs that support WebDAV. The advantages + of the console client compared to a WebDAV connection: + * low system resource requirements; + * faster file reading and writing speeds; + * faster syncing with Disk's server; + * no need to be constantly connected to work with files. + ''; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/zerofree/default.nix b/nixpkgs/pkgs/tools/filesystems/zerofree/default.nix new file mode 100644 index 000000000000..734c8df9b6ae --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/zerofree/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchurl, e2fsprogs }: + +stdenv.mkDerivation rec { + pname = "zerofree"; + version = "1.1.1"; + + src = fetchurl { + url = "https://frippery.org/uml/${pname}-${version}.tgz"; + sha256 = "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"; + }; + + buildInputs = [ e2fsprogs ]; + + installPhase = '' + mkdir -p $out/bin + cp zerofree $out/bin +''; + + meta = { + homepage = https://frippery.org/uml/; + description = "Zero free blocks from ext2, ext3 and ext4 file-systems"; + platforms = stdenv.lib.platforms.linux; + license = stdenv.lib.licenses.gpl2; + maintainers = [ stdenv.lib.maintainers.theuni ]; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix b/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix new file mode 100644 index 000000000000..476d80653127 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, ruby, zfs }: + +let version = "0.3.6"; in +stdenv.mkDerivation rec { + pname = "zfstools"; + inherit version; + + src = fetchFromGitHub { + sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg"; + rev = "v${version}"; + repo = "zfstools"; + owner = "bdrewery"; + }; + + buildInputs = [ ruby ]; + + installPhase = '' + mkdir -p $out/bin + cp bin/* $out/bin/ + + cp -R lib $out/ + + for f in $out/bin/*; do + substituteInPlace $f --replace "/usr/bin/env ruby" "ruby -I$out/lib" + done + + sed -e 's|cmd.*=.*"zfs |cmd = "${zfs}/sbin/zfs |g' -i $out/lib/zfstools/{dataset,snapshot}.rb + ''; + + meta = with stdenv.lib; { + inherit version; + inherit (src.meta) homepage; + description = "OpenSolaris-compatible auto-snapshotting script for ZFS"; + longDescription = '' + zfstools is an OpenSolaris-like and compatible auto snapshotting script + for ZFS, which also supports auto snapshotting mysql databases. + ''; + license = licenses.bsd2; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix b/nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix new file mode 100644 index 000000000000..89516d525af6 --- /dev/null +++ b/nixpkgs/pkgs/tools/filesystems/zkfuse/default.nix @@ -0,0 +1,22 @@ +{ stdenv, lib, zookeeper, zookeeper_mt, fuse, autoreconfHook, log4cxx, boost }: + +stdenv.mkDerivation { + pname = "zkfuse"; + inherit (zookeeper) version src; + + sourceRoot = "${zookeeper.name}/src/contrib/zkfuse"; + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ zookeeper_mt log4cxx boost fuse ]; + + installPhase = '' + mkdir -p $out/bin + cp -v src/zkfuse $out/bin + ''; + + meta = with lib; { + platforms = platforms.linux; + maintainers = with maintainers; [ cstrahan ]; + license = licenses.asl20; + }; +} |