nixpkgs/pkgs/tools/filesystems/sshfs-fuse/default.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, fetchpatch, meson, pkgconfig, ninja, docutils, makeWrapper
2018-08-28 16:59:16 +01:00
, fuse3, glib
, which, python3Packages
, openssh
2017-09-23 21:16:14 +01:00
}:
stdenv.mkDerivation rec {
version = "3.6.0";
pname = "sshfs-fuse";
2016-02-25 11:27:18 +00:00
src = fetchFromGitHub {
owner = "libfuse";
2017-08-13 21:29:00 +01:00
repo = "sshfs";
2016-03-06 16:22:17 +00:00
rev = "sshfs-${version}";
sha256 = "0l4a6azsp920fhl4safxjam6821b77zxhw8mjgm33f60pksslww0";
};
patches = [ (fetchpatch {
url = "https://github.com/libfuse/sshfs/commit/a548abd1f33a8423bec72724a5f48eb96fa55dd2.patch";
2019-11-03 13:58:26 +00:00
sha256 = "19p94aw7nvydd7p2bd1f5cqhlhhamjhda31k22sg06xaqyl893jm";
}) ];
nativeBuildInputs = [ meson pkgconfig ninja docutils makeWrapper ];
buildInputs = [ fuse3 glib ];
2018-08-28 16:59:16 +01:00
checkInputs = [ which python3Packages.pytest ];
2016-02-25 11:27:18 +00:00
2019-10-30 01:29:30 +00:00
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"
'';
2018-08-28 16:59:16 +01:00
#doCheck = true;
2018-08-08 22:34:52 +01:00
checkPhase = ''
2018-08-28 16:59:16 +01:00
# 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
2018-08-08 22:34:52 +01:00
python3 -m pytest test/
'';
2015-06-22 07:25:07 +01:00
meta = with stdenv.lib; {
2017-08-13 21:29:00 +01:00
inherit (src.meta) homepage;
description = "FUSE-based filesystem that allows remote filesystems to be mounted over SSH";
2015-06-22 07:25:07 +01:00
platforms = platforms.linux;
2018-08-11 13:33:17 +01:00
license = licenses.gpl2;
2017-08-13 21:29:00 +01:00
maintainers = with maintainers; [ primeos ];
};
}