copy-com: 1.47.0410 -> 3.2.01.0481 + several fixes

The graphical UI (the largest part of this package) never worked; fixed.

Added myself as a maintainer.
This commit is contained in:
Tobias Geerinckx-Rice 2015-07-25 04:29:27 +02:00
parent 161c0e7876
commit 078ee4ac55
2 changed files with 80 additions and 70 deletions

View file

@ -1,53 +1,53 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let let
cfg = config.services.copy-com; cfg = config.services.copy-com;
in in
{ {
options = { options = {
services.copy-com = { services.copy-com = {
enable = mkOption { enable = mkOption {
default = false; default = false;
description = " description = "
Enable the copy.com client. Enable the Copy.com client.
NOTE: before enabling the client for the first time, it must be
The first time copy.com is run, it needs to be configured. Before enabling run configured by first running CopyConsole (command line) or CopyAgent
copy_console manually. (graphical) as the appropriate user.
"; ";
}; };
user = mkOption { user = mkOption {
description = "The user for which copy should run."; description = "The user for which the Copy.com client should be run.";
}; };
debug = mkOption { debug = mkOption {
default = false; default = false;
description = "Output more."; description = "Output more (debugging) messages to the console.";
}; };
}; };
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.postfix ]; environment.systemPackages = [ pkgs.postfix ];
systemd.services."copy-com-${cfg.user}" = { systemd.services."copy-com-${cfg.user}" = {
description = "Copy.com Client"; description = "Copy.com client";
after = [ "network.target" "local-fs.target" ]; after = [ "network.target" "local-fs.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
ExecStart = "${pkgs.copy-com}/bin/copy_console ${if cfg.debug then "-consoleOutput -debugToConsole=dirwatch,path-watch,csm_path,csm -debug -console" else ""}"; ExecStart = "${pkgs.copy-com}/bin/CopyConsole ${if cfg.debug then "-consoleOutput -debugToConsole=dirwatch,path-watch,csm_path,csm -debug -console" else ""}";
User = "${cfg.user}"; User = "${cfg.user}";
}; };
}; };
}; };
} }

View file

@ -1,4 +1,5 @@
{ stdenv, coreutils, fetchurl, patchelf, gcc }: { stdenv, fetchurl, patchelf, fontconfig, freetype
, gcc, glib, libICE, libSM, libX11, libXext, libXrender }:
let let
arch = if stdenv.system == "x86_64-linux" then "x86_64" arch = if stdenv.system == "x86_64-linux" then "x86_64"
@ -13,45 +14,54 @@ let
appdir = "opt/copy"; appdir = "opt/copy";
libPackages = [ fontconfig freetype gcc.cc glib libICE libSM libX11 libXext
libXrender ];
libPaths = stdenv.lib.concatStringsSep ":"
(map (path: "${path}/lib") libPackages);
in stdenv.mkDerivation { in stdenv.mkDerivation {
name = "copy-com-1.47.0410"; name = "copy-com-3.2.01.0481";
src = fetchurl { src = fetchurl {
# Note: copy.com doesn't version this file. Annoying. # Note: copy.com doesn't version this file. Annoying.
url = "https://copy.com/install/linux/Copy.tgz"; url = "https://copy.com/install/linux/Copy.tgz";
sha256 = "a48c69f6798f888617cfeef5359829e619057ae0e6edf3940b4ea6c81131012a"; sha256 = "0bpphm71mqpaiygs57kwa23nli0qm64fvgl1qh7fkxyqqabh4g7k";
}; };
buildInputs = [ coreutils patchelf ]; nativeBuildInputs = [ patchelf ];
phases = "unpackPhase installPhase"; phases = "unpackPhase installPhase";
installPhase = '' installPhase = ''
mkdir -p $out/opt mkdir -p $out/opt
cp -r ${arch} "$out/${appdir}" 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.cc}/lib:$out/${appdir} mkdir -p "$out/bin"
echo "updating rpaths to: $RPATH" for binary in Copy{Agent,Console,Cmd}; do
binary="$out/${appdir}/$binary"
ln -sv "$binary" "$out/bin"
patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} "$binary"
done
# Older versions of this package happily installed broken copies of
# anything other than CopyConsole - which was then also mangled to
# copy_console for some reason. Keep backwards compatibility (only
# for CopyConsole) for now; the NixOS service is already fixed.
ln -sv "$out/bin"/{CopyConsole,copy_console}
RPATH=${libPaths}:$out/${appdir}
echo "Updating rpaths to $RPATH in:"
find "$out/${appdir}" -type f -a -perm +0100 \ find "$out/${appdir}" -type f -a -perm +0100 \
-print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \; -print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
''; '';
meta = { meta = {
homepage = http://copy.com; homepage = http://copy.com;
description = "Copy.com Client"; description = "Copy.com graphical & command-line clients";
# Closed Source unfortunately. # Closed Source unfortunately.
license = stdenv.lib.licenses.unfree; license = stdenv.lib.licenses.unfree;
maintainers = with stdenv.lib.maintainers; [ nathan-gs ]; maintainers = with stdenv.lib.maintainers; [ nathan-gs nckx ];
# NOTE: Copy.com itself only works on linux, so this is ok. # NOTE: Copy.com itself only works on linux, so this is ok.
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
}; };