2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, ant, jre, jdk, swt, acl, attr }:
|
2016-04-17 16:04:09 +01:00
|
|
|
|
2021-11-07 20:29:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "areca";
|
|
|
|
version = "7.5";
|
2016-04-17 16:04:09 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-11-07 20:29:51 +00:00
|
|
|
url = "mirror://sourceforge/project/areca/areca-stable/areca-${version}/areca-${version}-src.tar.gz";
|
2016-04-17 16:04:09 +01:00
|
|
|
sha256 = "1q4ha9s96c1syplxm04bh1v1gvjq16l4pa8w25w95d2ywwvyq1xb";
|
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
buildInputs = [ jdk ant acl attr ];
|
|
|
|
|
|
|
|
patches = [ ./fix-javah-bug.diff ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace build.xml --replace "/usr/lib/java/swt.jar" "${swt}/jars/swt.jar"
|
|
|
|
substituteInPlace build.xml --replace "gcc" "${stdenv.cc}/bin/gcc"
|
|
|
|
substituteInPlace areca.sh --replace "bin/" ""
|
|
|
|
substituteInPlace bin/areca_run.sh --replace "/usr/java" "${jre}/lib/openjdk"
|
|
|
|
substituteInPlace bin/areca_run.sh --replace "/usr/lib/java/swt.jar" "${swt}/jars/swt.jar"
|
|
|
|
|
2019-03-09 11:52:34 +00:00
|
|
|
# Fix for NixOS/nixpkgs/issues/53716
|
|
|
|
sed -i -e 's;^;#include <attr/attributes.h>;' jni/com_myJava_file_metadata_posix_jni_wrapper_FileAccessWrapper.c
|
|
|
|
substituteInPlace jni/com_myJava_file_metadata_posix_jni_wrapper_FileAccessWrapper.c --replace attr/xattr.h sys/xattr.h
|
|
|
|
|
2016-04-17 16:04:09 +01:00
|
|
|
sed -i "s#^PROGRAM_DIR.*#PROGRAM_DIR=$out#g" bin/areca_run.sh
|
2021-01-15 13:21:58 +00:00
|
|
|
sed -i "s#^LIBRARY_PATH.*#LIBRARY_PATH=$out/lib:${lib.makeLibraryPath [ swt acl ]}#g" bin/areca_run.sh
|
2016-04-17 16:04:09 +01:00
|
|
|
|
|
|
|
# https://sourceforge.net/p/areca/bugs/563/
|
|
|
|
substituteInPlace bin/areca_run.sh --replace '[ "$JAVA_IMPL" = "java" ]' \
|
|
|
|
'[[ "$JAVA_IMPL" = "java" || "$JAVA_IMPL" = "openjdk" ]]'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = "ant";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib $out/translations
|
|
|
|
cp areca.sh $out/bin/areca
|
|
|
|
cp -r bin $out
|
|
|
|
cp -r lib $out
|
|
|
|
cp -r translations $out
|
|
|
|
cp COPYING $out
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.areca-backup.org/";
|
2016-04-17 16:04:09 +01:00
|
|
|
description = "An Open Source personal backup solution";
|
2021-10-27 11:59:53 +01:00
|
|
|
# Builds fine but fails to launch.
|
|
|
|
broken = true;
|
2016-04-17 16:04:09 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ pSub ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; linux;
|
2016-04-17 16:04:09 +01:00
|
|
|
};
|
|
|
|
}
|