From 17210fee46826873a623ffd6b691da3d897277e3 Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Tue, 6 Feb 2018 15:03:39 +0100 Subject: [PATCH 1/2] squashfuse: init at 0.1.101 --- pkgs/tools/filesystems/squashfuse/default.nix | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/tools/filesystems/squashfuse/default.nix diff --git a/pkgs/tools/filesystems/squashfuse/default.nix b/pkgs/tools/filesystems/squashfuse/default.nix new file mode 100644 index 000000000000..8a8bc5396fc0 --- /dev/null +++ b/pkgs/tools/filesystems/squashfuse/default.nix @@ -0,0 +1,61 @@ +{ stdenv, fetchurl, automake, autoconf, libtool, fuse, pkgconfig, pcre, + +# Optional Dependencies +lz4 ? null, xz ? null, zlib ? null, lzo ? null, zstd ? null}: + +with stdenv.lib; +let + mkFlag = trueStr: falseStr: cond: name: val: "--" + + (if cond then trueStr else falseStr) + + name + + optionalString (val != null && cond != false) "=${val}"; + mkEnable = mkFlag "enable-" "disable-"; + mkWith = mkFlag "with-" "--without-"; + mkOther = mkFlag "" "" true; + + shouldUsePkg = pkg: if pkg != null && any (x: x == stdenv.system) pkg.meta.platforms then pkg else null; + + optLz4 = shouldUsePkg lz4; + optLzma = shouldUsePkg xz; + optZlib = shouldUsePkg zlib; + optLzo = shouldUsePkg lzo; + optZstd = shouldUsePkg zstd; +in + +stdenv.mkDerivation rec { + + pname = "squashfuse"; + version = "0.1.101"; + name = "${pname}-${version}"; + + meta = { + description = "FUSE filesystem to mount squashfs archives"; + homepage = https://github.com/vasi/squashfuse; + maintainers = [ maintainers.genesis ]; + platforms = platforms.linux ++ platforms.darwin; + license = "BSD-2-Clause"; + }; + + src = fetchurl { + url = "https://github.com/vasi/squashfuse/archive/${version}.tar.gz"; + sha256 = "08d1j1a73dhhypbk0q20qkrz564zpmvkpk3k3s8xw8gd9nvy2xa2"; + }; + + nativeBuildInputs = [ automake autoconf libtool pkgconfig]; + buildInputs = [ optLz4 optLzma optZlib optLzo optZstd fuse ]; + + # We can do it far better i guess, ignoring -with option + # but it should be safer like that. + # TODO: Improve writing nix expression mkWithLib. + configureFlags = [ + (mkWith (optLz4 != null) "lz4=${lz4}/lib" null) + (mkWith (optLzma != null) "xz=${xz}/lib" null) + (mkWith (optZlib != null) "zlib=${zlib}/lib" null) + (mkWith (optLzo != null) "lzo=${lzo}/lib" null) + (mkWith (optZstd != null) "zstd=${zstd}/lib" null) + ]; + + preConfigure = '' + ./autogen.sh + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 73f478280554..c89384e037f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4690,6 +4690,8 @@ with pkgs; squashfsTools = callPackage ../tools/filesystems/squashfs { }; + squashfuse = callPackage ../tools/filesystems/squashfuse { }; + srcml = callPackage ../applications/version-management/srcml { }; sshfs-fuse = callPackage ../tools/filesystems/sshfs-fuse { }; From e2bf162f04b81222550d5f0574ef72f32d68125f Mon Sep 17 00:00:00 2001 From: Bignaux Ronan Date: Tue, 6 Feb 2018 15:34:51 +0100 Subject: [PATCH 2/2] remove platforms.darwin support --- pkgs/tools/filesystems/squashfuse/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/filesystems/squashfuse/default.nix b/pkgs/tools/filesystems/squashfuse/default.nix index 8a8bc5396fc0..75b6deccc83e 100644 --- a/pkgs/tools/filesystems/squashfuse/default.nix +++ b/pkgs/tools/filesystems/squashfuse/default.nix @@ -32,10 +32,14 @@ stdenv.mkDerivation rec { description = "FUSE filesystem to mount squashfs archives"; homepage = https://github.com/vasi/squashfuse; maintainers = [ maintainers.genesis ]; - platforms = platforms.linux ++ platforms.darwin; + 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 = fetchurl { url = "https://github.com/vasi/squashfuse/archive/${version}.tar.gz"; sha256 = "08d1j1a73dhhypbk0q20qkrz564zpmvkpk3k3s8xw8gd9nvy2xa2";