diff options
author | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-04-16 06:28:00 +0300 |
---|---|---|
committer | Arseniy Seroka <jagajaga@users.noreply.github.com> | 2015-04-16 06:28:00 +0300 |
commit | f029ccadc930e666cd8c90acc610bb92a1088d6c (patch) | |
tree | a16527c0dc5a3302019873221e54b99de46e8d89 /pkgs/applications | |
parent | d480957d2a6ffc01c2e058f2214e4e6762ea8e01 (diff) | |
parent | f7865c29c26fc0800cc69a34e0b10326efe28d69 (diff) | |
download | nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.tar nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.tar.gz nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.tar.bz2 nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.tar.lz nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.tar.xz nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.tar.zst nixlib-f029ccadc930e666cd8c90acc610bb92a1088d6c.zip |
Merge pull request #7385 from Forkk/screencloud
Add package for Screencloud 1.2.0
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/graphics/screencloud/default.nix | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/screencloud/default.nix b/pkgs/applications/graphics/screencloud/default.nix new file mode 100644 index 000000000000..3ccbf7a404d3 --- /dev/null +++ b/pkgs/applications/graphics/screencloud/default.nix @@ -0,0 +1,74 @@ +{ stdenv, fetchurl, fetchFromGitHub, cmake, qt4, quazip, qt-mobility, qxt, python, pycrypto, glib }: + +with stdenv.lib; +stdenv.mkDerivation rec { + name = "screencloud-${version}"; + version = "1.2.0"; + + # API Keys. According to the author of the AUR package, these are only used + # for tracking usage. + consumerKey = "23e747012c68601f27ab69c6de129ed70552d55b6"; + consumerSecret = "4701cb00c1bd357bbcae7c3d713dd216"; + + src = fetchFromGitHub { + owner = "olav-st"; + repo = "screencloud"; + rev = "v${version}"; + sha256 = "1s0dxa1sa37nvna5nfqdsp294810favj68qb7ghl78qna7zw0cim"; + }; + + buildInputs = [ cmake qt4 quazip qt-mobility qxt python pycrypto ]; + + patchPhase = '' + # Required to make the configure script work. Normally, screencloud's + # CMakeLists file sets the install prefix to /opt by force. This is stupid + # and breaks nix, so we force it to install where we want. Please don't + # write CMakeLists files like this, as things like this are why we can't + # have nice things. + substituteInPlace "CMakeLists.txt" --replace "set(CMAKE_INSTALL_PREFIX \"/opt\")" "" + ''; + + enableParallelBuilding = true; + + # We need to append /opt to our CMAKE_INSTALL_PREFIX, so we tell the Nix not + # to add the argument for us. + dontAddPrefix = true; + + cmakeFlags = [ + "-DQXT_QXTCORE_INCLUDE_DIR=${qxt}/include/QxtCore" + "-DQXT_QXTCORE_LIB_RELEASE=${qxt}/lib/libQxtCore.so" + "-DQXT_QXTGUI_INCLUDE_DIR=${qxt}/include/QxtGui" + "-DQXT_QXTGUI_LIB_RELEASE=${qxt}/lib/libQxtGui.so" + "-DCONSUMER_KEY_SCREENCLOUD=${consumerKey}" + "-DCONSUMER_SECRET_SCREENCLOUD=${consumerSecret}" + ]; + + sourceRoot = "screencloud-v${version}-src/screencloud"; + + preConfigure = '' + # This needs to be set in preConfigure instead of cmakeFlags in order to + # access the $prefix environment variable. + export cmakeFlags="-DCMAKE_INSTALL_PREFIX=$prefix/opt $cmakeFlags" + ''; + + # There are a number of issues with screencloud's installation. We need to add + # pycrypto to the PYTHONPATH so that the SFTP plugin will work properly; and + # we need to move the libPythonQt library into a folder where it can actually + # be found. + postInstall = '' + patchShebangs $prefix/opt/screencloud/screencloud.sh + substituteInPlace "$prefix/opt/screencloud/screencloud.sh" --replace "/opt" "$prefix/opt" + sed -i "2 i\export PYTHONPATH=$(toPythonPath ${pycrypto}):\$PYTHONPATH" "$prefix/opt/screencloud/screencloud.sh" + mkdir $prefix/bin + mkdir $prefix/lib + ln -s $prefix/opt/screencloud/screencloud.sh $prefix/bin/screencloud + ln -s $prefix/opt/screencloud/libPythonQt.so $prefix/lib/libPythonQt.so + ''; + + meta = { + homepage = https://screencloud.net/; + description = "Client for Screencloud, an easy to use screenshot sharing tool"; + license = stdenv.lib.licenses.gpl2; + maintainers = with stdenv.lib.maintainers; [ forkk ]; + }; +} |