diff --git a/default.nix b/default.nix index 35144cb..dc0038d 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,7 @@ self: super: rec { libevhtp = super.callPackage ./libevhtp/default.nix {}; - seafile-server = super.callPackage ./seafile-server/default.nix { inherit libevhtp python27Packages;}; + libsearpc = super.callPackage ./libsearpc/default.nix {}; + seafile-server = super.callPackage ./seafile-server/default.nix { inherit libevhtp python27Packages libsearpc;}; python27Packages = super.python27Packages // rec { django-jsonfield = super.python27Packages.callPackage ./django-jsonfield/default.nix {}; jsonfield = super.python27Packages.callPackage ./jsonfield/default.nix {}; diff --git a/libsearpc/default.nix b/libsearpc/default.nix new file mode 100644 index 0000000..839c824 --- /dev/null +++ b/libsearpc/default.nix @@ -0,0 +1,32 @@ +{stdenv, fetchFromGitHub, automake, autoconf, pkgconfig, libtool, python2Packages, glib, jansson}: + +stdenv.mkDerivation rec { + version = "3.2.0"; + name = "libsearpc-${version}"; + + src = fetchFromGitHub { + owner = "haiwen"; + repo = "libsearpc"; + #rev = "v${version}"; + rev = "v3.2-latest"; + sha256 = "sha256:0qn5k6ckvd8hhiv4j6xj431qj8wwabfzlzhiccc0an8gxjsfgzsz"; + }; + + patches = [ ./libsearpc.pc.patch ]; + + nativeBuildInputs = [ pkgconfig ]; + buildInputs = [ automake autoconf libtool python2Packages.python python2Packages.simplejson ]; + propagatedBuildInputs = [ glib jansson ]; + + postPatch = "patchShebangs autogen.sh"; + + preConfigure = "./autogen.sh"; + + meta = with stdenv.lib; { + homepage = https://github.com/haiwen/libsearpc; + description = "A simple and easy-to-use C language RPC framework (including both server side & client side) based on GObject System"; + license = licenses.lgpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ schmittlauch ]; + }; +} diff --git a/libsearpc/libsearpc.pc.patch b/libsearpc/libsearpc.pc.patch new file mode 100644 index 0000000..6f30932 --- /dev/null +++ b/libsearpc/libsearpc.pc.patch @@ -0,0 +1,10 @@ +From: Aaron Lindsay + +--- a/libsearpc.pc.in 2013-01-10 01:35:24.000000000 -0500 ++++ b/libsearpc.pc.in 2013-01-19 11:31:50.479301798 -0500 +@@ -1,4 +1,4 @@ +-prefix=(DESTDIR)@prefix@ ++prefix=@prefix@ + exec_prefix=@exec_prefix@ + libdir=@libdir@ + includedir=@includedir@ diff --git a/seafile-server/default.nix b/seafile-server/default.nix index 71cfa90..baab634 100644 --- a/seafile-server/default.nix +++ b/seafile-server/default.nix @@ -15,7 +15,7 @@ sha256 = "sha256:0r3vw145vzhbipwk4cyj1h7sb3szy5hcp36n3pf2jxpwy365ir92"; }; nativeBuildInputs = [ autoconf automake libtool pkgconfig autoreconfHook ]; - buildInputs = [ sqlite glib python27 libuuid openssl ]; + buildInputs = [ sqlite glib python27 libuuid openssl ccnet fuse libarchive ]; checkPhase = "bash ./run_tests.sh"; }; seahub = python27Packages.buildPythonApplication rec { @@ -60,10 +60,17 @@ sha256 = "sha256:0yfq8fvz17l0295kkpj95f33gwm31ikyhymxq4fy088q608vd8g5"; }; - buildInputs = [ vala libsearpc ] + buildInputs = [ vala libsearpc libuuid sqlite openssl libevent glib python27 ] ++ lib.optional (!withMysql) "--without-mysql"; - nativeBuildInputs = [ autoconf automake libtool ]; - preConfigure = "bash autogen.sh"; + nativeBuildInputs = [ autoconf automake libtool pkgconfig autoreconfHook ]; + configureFlags = [ "--disable-static" ]; + # generate required searpc header files + preBuildPhases = '' + pwd + cd ./lib/ + ${python27} ${libsearpc}/bin/searpc-codegen.py rpc_table.py + cd - + ''; meta = { description = "Internal communication framework and user/group management for Seafile server"; @@ -79,4 +86,5 @@ ++ lib.optional withMysql libmysql; phases = [ "installPhase" "fixupPhase" "distPhase" ]; # todo: create data directory in /srv in activation script + inherit ccnet-server; }