2014-09-03 07:39:48 +01:00
|
|
|
{ stdenv, coreutils, fetchurl, patchelf, gcc }:
|
|
|
|
|
|
|
|
let
|
|
|
|
arch = if stdenv.system == "x86_64-linux" then "x86_64"
|
|
|
|
else if stdenv.system == "i686-linux" then "x86"
|
|
|
|
else if stdenv.system == "armv6-linux" then "armv6h"
|
|
|
|
else throw "Copy.com client for: ${stdenv.system} not supported!";
|
|
|
|
|
|
|
|
interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
|
|
|
|
else if stdenv.system == "i686-linux" then "ld-linux.so.2"
|
|
|
|
else if stdenv.system == "armv6-linux" then "ld-linux.so.2"
|
|
|
|
else throw "Copy.com client for: ${stdenv.system} not supported!";
|
|
|
|
|
|
|
|
appdir = "opt/copy";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
|
2014-10-01 19:23:47 +01:00
|
|
|
name = "copy-com-1.47.0410";
|
2014-09-03 07:39:48 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
# Note: copy.com doesn't version this file. Annoying.
|
|
|
|
url = "https://copy.com/install/linux/Copy.tgz";
|
2014-10-01 19:23:47 +01:00
|
|
|
sha256 = "a48c69f6798f888617cfeef5359829e619057ae0e6edf3940b4ea6c81131012a";
|
2014-09-03 07:39:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ coreutils patchelf ];
|
|
|
|
|
|
|
|
phases = "unpackPhase installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/opt
|
|
|
|
cp -r ${arch} "$out/${appdir}"
|
|
|
|
ensureDir "$out/bin"
|
|
|
|
ln -s "$out/${appdir}/CopyConsole" "$out/bin/copy_console"
|
|
|
|
ln -s "$out/${appdir}/CopyAgent" "$out/bin/copy_agent"
|
|
|
|
ln -s "$out/${appdir}/CopyCmd" "$out/bin/copy_cmd"
|
|
|
|
patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
|
|
|
|
"$out/${appdir}/CopyConsole"
|
|
|
|
|
2015-01-15 04:44:00 +00:00
|
|
|
RPATH=${gcc.cc}/lib:$out/${appdir}
|
2014-09-03 07:39:48 +01:00
|
|
|
echo "updating rpaths to: $RPATH"
|
|
|
|
find "$out/${appdir}" -type f -a -perm +0100 \
|
|
|
|
-print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://copy.com;
|
|
|
|
description = "Copy.com Client";
|
|
|
|
# Closed Source unfortunately.
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ nathan-gs ];
|
|
|
|
# NOTE: Copy.com itself only works on linux, so this is ok.
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|