From 0ee0582a8f69b1d443500daeb1fd4907afc6c341 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 24 Jun 2018 23:06:36 +0200 Subject: [PATCH 1/4] casync: init at 2-152-ge4a3c5e --- .../networking/sync/casync/default.nix | 26 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 2 files changed, 30 insertions(+) create mode 100644 pkgs/applications/networking/sync/casync/default.nix diff --git a/pkgs/applications/networking/sync/casync/default.nix b/pkgs/applications/networking/sync/casync/default.nix new file mode 100644 index 000000000000..d8b977af7a1b --- /dev/null +++ b/pkgs/applications/networking/sync/casync/default.nix @@ -0,0 +1,26 @@ +{ stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig, sphinx, acl, curl, fuse, libselinux, udev, xz, zstd }: + +stdenv.mkDerivation rec { + name = "casync-${version}"; + version = "2-152-ge4a3c5e"; + + src = fetchFromGitHub { + owner = "systemd"; + repo = "casync"; + rev = "e4a3c5efc8f11e0e99f8cc97bd417665d92b40a9"; + sha256 = "0zx6zvj5a6rr3w9s207rvpfw7gwssiqmp1p3c75bsirmz4nmsdf0"; + }; + + buildInputs = [ acl curl fuse libselinux udev xz zstd ]; + nativeBuildInputs = [ meson ninja pkgconfig sphinx ]; + + PKG_CONFIG_UDEV_UDEVDIR = "lib/udev"; + + meta = with stdenv.lib; { + description = "Content-Addressable Data Synchronizer"; + homepage = https://github.com/systemd/casync; + license = licenses.lgpl21; + platforms = platforms.all; + maintainers = with maintainers; [ flokli ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5d63580c89c1..184a925c48ee 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -991,6 +991,10 @@ with pkgs; capstone = callPackage ../development/libraries/capstone { }; unicorn-emu = callPackage ../development/libraries/unicorn-emu { }; + casync = callPackage ../applications/networking/sync/casync { + sphinx = python3Packages.sphinx; + }; + cataract = callPackage ../applications/misc/cataract { }; cataract-unstable = callPackage ../applications/misc/cataract/unstable.nix { }; From 583ec8eac3f17585f86381624ffefedbf7a8a2a0 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 25 Jun 2018 01:49:52 +0200 Subject: [PATCH 2/4] casync: enable tests --- .../networking/sync/casync/default.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/sync/casync/default.nix b/pkgs/applications/networking/sync/casync/default.nix index d8b977af7a1b..25d9d65c5a87 100644 --- a/pkgs/applications/networking/sync/casync/default.nix +++ b/pkgs/applications/networking/sync/casync/default.nix @@ -1,4 +1,8 @@ -{ stdenv, fetchFromGitHub, fetchpatch, meson, ninja, pkgconfig, sphinx, acl, curl, fuse, libselinux, udev, xz, zstd }: +{ stdenv, fetchFromGitHub, fetchpatch +, meson, ninja, pkgconfig, sphinx +, acl, curl, fuse, libselinux, udev, xz, zstd +, glibcLocales, rsync +}: stdenv.mkDerivation rec { name = "casync-${version}"; @@ -13,9 +17,22 @@ stdenv.mkDerivation rec { buildInputs = [ acl curl fuse libselinux udev xz zstd ]; nativeBuildInputs = [ meson ninja pkgconfig sphinx ]; + checkInputs = [ glibcLocales rsync ]; + + postPatch = '' + for f in test/test-*.sh.in; do + patchShebangs $f + done + patchShebangs test/http-server.py + ''; PKG_CONFIG_UDEV_UDEVDIR = "lib/udev"; + doCheck = true; + preCheck = '' + export LC_ALL="en_US.utf-8" + ''; + meta = with stdenv.lib; { description = "Content-Addressable Data Synchronizer"; homepage = https://github.com/systemd/casync; From de9abc0d9e91910b8ad953766835160044bbda99 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 25 Jun 2018 02:17:01 +0200 Subject: [PATCH 3/4] casync: add feature flags for fuse, selinux and udev --- pkgs/applications/networking/sync/casync/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/sync/casync/default.nix b/pkgs/applications/networking/sync/casync/default.nix index 25d9d65c5a87..38c9e07367f8 100644 --- a/pkgs/applications/networking/sync/casync/default.nix +++ b/pkgs/applications/networking/sync/casync/default.nix @@ -1,6 +1,9 @@ { stdenv, fetchFromGitHub, fetchpatch , meson, ninja, pkgconfig, sphinx , acl, curl, fuse, libselinux, udev, xz, zstd +, fuseSupport ? true +, selinuxSupport ? true +, udevSupport ? true , glibcLocales, rsync }: @@ -15,7 +18,10 @@ stdenv.mkDerivation rec { sha256 = "0zx6zvj5a6rr3w9s207rvpfw7gwssiqmp1p3c75bsirmz4nmsdf0"; }; - buildInputs = [ acl curl fuse libselinux udev xz zstd ]; + buildInputs = [ acl curl xz zstd ] + ++ stdenv.lib.optionals (fuseSupport) [ fuse ] + ++ stdenv.lib.optionals (selinuxSupport) [ libselinux ] + ++ stdenv.lib.optionals (udevSupport) [ udev ]; nativeBuildInputs = [ meson ninja pkgconfig sphinx ]; checkInputs = [ glibcLocales rsync ]; @@ -27,6 +33,9 @@ stdenv.mkDerivation rec { ''; PKG_CONFIG_UDEV_UDEVDIR = "lib/udev"; + mesonFlags = stdenv.lib.optionals (!fuseSupport) [ "-Dfuse=false" ] + ++ stdenv.lib.optionals (!udevSupport) [ "-Dudev=false" ] + ++ stdenv.lib.optionals (!selinuxSupport) [ "-Dselinux=false" ]; doCheck = true; preCheck = '' From 0dfc32989118c5441df52676de90a865e6e0abf9 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 25 Jun 2018 02:17:27 +0200 Subject: [PATCH 4/4] casync: restrict to linux libacl is required, which is linux-only. --- pkgs/applications/networking/sync/casync/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/sync/casync/default.nix b/pkgs/applications/networking/sync/casync/default.nix index 38c9e07367f8..82dd3a506dee 100644 --- a/pkgs/applications/networking/sync/casync/default.nix +++ b/pkgs/applications/networking/sync/casync/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { description = "Content-Addressable Data Synchronizer"; homepage = https://github.com/systemd/casync; license = licenses.lgpl21; - platforms = platforms.all; + platforms = platforms.linux; maintainers = with maintainers; [ flokli ]; }; }