diff options
author | Nathan Bijnens <nathan@nathan.gs> | 2014-09-03 10:39:48 +0400 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2014-09-03 11:31:51 +0400 |
commit | 33a3f76ee4e4fe7040aef35d5c01e23f68b4797b (patch) | |
tree | eb903f0cd8e07a6f22ae48d7f83bc112043be9d4 /pkgs/applications/networking/copy-com | |
parent | 07e9016f35500d482729959dea5bcabe5eeefe32 (diff) |
Copy.com: client #3617
Diffstat (limited to 'pkgs/applications/networking/copy-com')
-rw-r--r-- | pkgs/applications/networking/copy-com/default.nix | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/pkgs/applications/networking/copy-com/default.nix b/pkgs/applications/networking/copy-com/default.nix new file mode 100644 index 0000000000000..98679e9609ec9 --- /dev/null +++ b/pkgs/applications/networking/copy-com/default.nix @@ -0,0 +1,58 @@ +{ 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 { + + name = "copy-com-1.4"; + + src = fetchurl { + # Note: copy.com doesn't version this file. Annoying. + url = "https://copy.com/install/linux/Copy.tgz"; + sha256 = "f8da6dbfdaac71c4c4e9102671cf8fbe4ac5cb1dac63464783b8b62a7939b6fa"; + }; + + 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" + + RPATH=${gcc.gcc}/lib:$out/${appdir} + 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; + }; +} |