1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-17 02:14:36 +00:00
nixpkgs/pkgs/applications/backup/areca/default.nix
J Phani Mahesh f15bff8202 areca: switch sf downloads to mirror://
This allows fallback to all configured mirrors for sourceforge
to download, instead of relying on just downloads.sourceforge.net
2016-08-20 19:14:28 +05:30

51 lines
1.6 KiB
Nix

{ stdenv, fetchurl, ant, jre, jdk, swt, acl, attr }:
stdenv.mkDerivation rec {
name = "areca-7.5";
src = fetchurl {
url = "mirror://sourceforge/project/areca/areca-stable/areca-7.5/areca-7.5-src.tar.gz";
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"
sed -i "s#^PROGRAM_DIR.*#PROGRAM_DIR=$out#g" bin/areca_run.sh
sed -i "s#^LIBRARY_PATH.*#LIBRARY_PATH=${swt}/lib:$out/lib:${acl}/lib#g" bin/areca_run.sh
# 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
'';
meta = with stdenv.lib; {
homepage = http://www.areca-backup.org/;
description = "An Open Source personal backup solution";
license = licenses.gpl2;
maintainers = with maintainers; [ pSub ];
platforms = with platforms; linux;
};
}