screencloud: init at 1.2.0

Added a package for Screencloud, a program for taking screenshots and
uploading them to various websites.

This package was a bit finicky due to some nonsense in the CMakeLists
file, but it seems to work properly.

The package also includes API keys for the screencloud.net website.
According to the author of the Arch Linux User Repo package for
screencloud, these keys are only used for usage tracking, so we should
be fine including them in the package here.

Forkk f7865c29 78eb702d

+78
+74
pkgs/applications/graphics/screencloud/default.nix
··· 1 + { stdenv, fetchurl, fetchFromGitHub, cmake, qt4, quazip, qt-mobility, qxt, python, pycrypto, glib }: 2 + 3 + with stdenv.lib; 4 + stdenv.mkDerivation rec { 5 + name = "screencloud-${version}"; 6 + version = "1.2.0"; 7 + 8 + # API Keys. According to the author of the AUR package, these are only used 9 + # for tracking usage. 10 + consumerKey = "23e747012c68601f27ab69c6de129ed70552d55b6"; 11 + consumerSecret = "4701cb00c1bd357bbcae7c3d713dd216"; 12 + 13 + src = fetchFromGitHub { 14 + owner = "olav-st"; 15 + repo = "screencloud"; 16 + rev = "v${version}"; 17 + sha256 = "1s0dxa1sa37nvna5nfqdsp294810favj68qb7ghl78qna7zw0cim"; 18 + }; 19 + 20 + buildInputs = [ cmake qt4 quazip qt-mobility qxt python pycrypto ]; 21 + 22 + patchPhase = '' 23 + # Required to make the configure script work. Normally, screencloud's 24 + # CMakeLists file sets the install prefix to /opt by force. This is stupid 25 + # and breaks nix, so we force it to install where we want. Please don't 26 + # write CMakeLists files like this, as things like this are why we can't 27 + # have nice things. 28 + substituteInPlace "CMakeLists.txt" --replace "set(CMAKE_INSTALL_PREFIX \"/opt\")" "" 29 + ''; 30 + 31 + enableParallelBuilding = true; 32 + 33 + # We need to append /opt to our CMAKE_INSTALL_PREFIX, so we tell the Nix not 34 + # to add the argument for us. 35 + dontAddPrefix = true; 36 + 37 + cmakeFlags = [ 38 + "-DQXT_QXTCORE_INCLUDE_DIR=${qxt}/include/QxtCore" 39 + "-DQXT_QXTCORE_LIB_RELEASE=${qxt}/lib/libQxtCore.so" 40 + "-DQXT_QXTGUI_INCLUDE_DIR=${qxt}/include/QxtGui" 41 + "-DQXT_QXTGUI_LIB_RELEASE=${qxt}/lib/libQxtGui.so" 42 + "-DCONSUMER_KEY_SCREENCLOUD=${consumerKey}" 43 + "-DCONSUMER_SECRET_SCREENCLOUD=${consumerSecret}" 44 + ]; 45 + 46 + sourceRoot = "screencloud-v${version}-src/screencloud"; 47 + 48 + preConfigure = '' 49 + # This needs to be set in preConfigure instead of cmakeFlags in order to 50 + # access the $prefix environment variable. 51 + export cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix/opt $cmakeFlags" 52 + ''; 53 + 54 + # There are a number of issues with screencloud's installation. We need to add 55 + # pycrypto to the PYTHONPATH so that the SFTP plugin will work properly; and 56 + # we need to move the libPythonQt library into a folder where it can actually 57 + # be found. 58 + postInstall = '' 59 + patchShebangs $prefix/opt/screencloud/screencloud.sh 60 + substituteInPlace "$prefix/opt/screencloud/screencloud.sh" --replace "/opt" "$prefix/opt" 61 + sed -i "2 i\export PYTHONPATH=$(toPythonPath ${pycrypto}):\$PYTHONPATH" "$prefix/opt/screencloud/screencloud.sh" 62 + mkdir $prefix/bin 63 + mkdir $prefix/lib 64 + ln -s $prefix/opt/screencloud/screencloud.sh $prefix/bin/screencloud 65 + ln -s $prefix/opt/screencloud/libPythonQt.so $prefix/lib/libPythonQt.so 66 + ''; 67 + 68 + meta = { 69 + homepage = https://screencloud.net/; 70 + description = "Client for Screencloud, an easy to use screenshot sharing tool"; 71 + license = stdenv.lib.licenses.gpl2; 72 + maintainers = with stdenv.lib.maintainers; [ forkk ]; 73 + }; 74 + }
+4
pkgs/top-level/all-packages.nix
··· 2645 2645 2646 2646 screen-message = callPackage ../tools/X11/screen-message { }; 2647 2647 2648 + screencloud = callPackage ../applications/graphics/screencloud { 2649 + quazip = quazip.override { qt = qt4; }; 2650 + }; 2651 + 2648 2652 scrot = callPackage ../tools/graphics/scrot { }; 2649 2653 2650 2654 scrolls = callPackage ../games/scrolls { };