-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes haiwen/seafile#1233. - ci: add nautilus build - improve client auotconnect handle - autorefresh overlay icons - cmake learns how to install and uninstall nautilus-seafile now - support readonly state - support locked/locked-by-me state
- Loading branch information
Chilledheart
committed
Jul 10, 2015
1 parent
b77e3d8
commit 3488a80
Showing
73 changed files
with
895 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) | ||
|
||
PROJECT(nautilus-seafile C) | ||
SET(PROJECT_VERSION "1.0.0") | ||
INCLUDE(FindPkgConfig) | ||
|
||
IF (APPLE OR NOT UNIX) | ||
MESSAGE(FATAL_ERROR "Nautilus extension is not supported on your platform") | ||
ENDIF() | ||
|
||
option(BUILD_ENABLE_WARNINGS "Enable compiler warnings." ON) | ||
SET(NAUTILUS_EXTENSION_DIR CACHE "Path to Nautilus Extenstion Directory" "") | ||
|
||
if(BUILD_ENABLE_WARNINGS) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wsign-compare -Wno-long-long -Wno-unused-parameter") | ||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unknown-warning-option") | ||
endif() | ||
endif() | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs") | ||
|
||
## color diagnostics fix | ||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang") | ||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics") | ||
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU") | ||
execute_process(COMMAND ${CMAKE_C_COMPILER} | ||
-dumpversion OUTPUT_VARIABLE GCC_VERSION) | ||
if(GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9) | ||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always") | ||
endif() | ||
endif() | ||
|
||
FIND_PACKAGE(PkgConfig REQUIRED) | ||
|
||
PKG_CHECK_MODULES(GLIB2 REQUIRED glib-2.0>=2.15) | ||
|
||
PKG_CHECK_MODULES(NAUTILUS REQUIRED libnautilus-extension>=2.0) | ||
|
||
PKG_CHECK_MODULES(LIBCCNET REQUIRED libccnet>=1.3) | ||
|
||
PKG_CHECK_MODULES(LIBSEARPC REQUIRED libsearpc>=1.0) | ||
|
||
PKG_CHECK_MODULES(LIBSEAFILE REQUIRED libseafile>=1.7) | ||
|
||
INCLUDE_DIRECTORIES( | ||
${GLIB2_INCLUDE_DIRS} | ||
${NAUTILUS_INCLUDE_DIRS} | ||
${LIBCCNET_INCLUDE_DIRS} | ||
${LIBSEARPC_INCLUDE_DIRS} | ||
${LIBSEAFILE_INCLUDE_DIRS}) | ||
|
||
LINK_DIRECTORIES( | ||
${GLIB2_LIBRARY_DIRS} | ||
${NAUTILUS_LIBRARY_DIRS} | ||
${LIBCCNET_LIBRARY_DIRS} | ||
${LIBSEARPC_LIBRARY_DIRS} | ||
${LIBSEAFILE_LIBRARY_DIRS}) | ||
|
||
ADD_LIBRARY(nautilus-seafile SHARED | ||
seafile-module.c | ||
nautilus-seafile.c | ||
nautilus-seafile.h | ||
seafile-rpc-client.c | ||
seafile-rpc-client.h | ||
) | ||
|
||
TARGET_LINK_LIBRARIES(nautilus-seafile | ||
${GLIB2_LIBRARIES} | ||
${NAUTILUS_LIBRARIES} | ||
${JANSSON_LIBRARIES} | ||
${LIBCCNET_LIBRARIES} | ||
${LIBSEARPC_LIBRARIES} | ||
${LIBSEAFILE_LIBRARIES}) | ||
|
||
## Find libnautilus-extension's directory | ||
IF ("${NAUTILUS_EXTENSION_DIR}" STREQUAL "") | ||
EXECUTE_PROCESS( | ||
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=extensiondir libnautilus-extension | ||
OUTPUT_VARIABLE PKGCONFIG_RESULT | ||
RESULT_VARIABLE PKGCONFIG_FAILURE) | ||
|
||
IF (PKGCONFIG_FAILURE) | ||
SET(NAUTILUS_EXTENSION_DIR "lib/nautilus/extension-1.0") | ||
ELSE() | ||
STRING(REGEX REPLACE "[\r\n]" " " PKGCONFIG_RESULT "${PKGCONFIG_RESULT}") | ||
STRING(REGEX REPLACE " +$" "" PKGCONFIG_RESULT "${PKGCONFIG_RESULT}") | ||
|
||
SET(NAUTILUS_EXTENSION_DIR ${PKGCONFIG_RESULT}) | ||
ENDIF() | ||
ENDIF() | ||
|
||
INSTALL(DIRECTORY | ||
${CMAKE_CURRENT_SOURCE_DIR}/hicolor | ||
DESTINATION share/icons | ||
) | ||
|
||
INSTALL(TARGETS nautilus-seafile | ||
DESTINATION ${NAUTILUS_EXTENSION_DIR} | ||
) | ||
|
||
# uninstall target | ||
CONFIGURE_FILE( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" | ||
IMMEDIATE @ONLY) | ||
|
||
ADD_CUSTOM_TARGET(uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Nautilus Extension For Seafile | ||
|
||
|
||
## Prerequirement | ||
|
||
- libsearpc | ||
- ccnet | ||
- seafile | ||
|
||
## Installation | ||
- `sudo apt-get install cmake libnautilus-extension-dev` | ||
- `./build.sh` | ||
- `make install` (or `ninja install`) | ||
- `nautilus -q` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
NINJA=$(which ninja) | ||
GENERATOR=Ninja | ||
WORKER=ninja | ||
if [ -z $NINJA ]; then | ||
GENERATOR="Unix Makefiles" | ||
WORKER=make | ||
fi | ||
|
||
set -x | ||
set -e | ||
|
||
CURRENT_PWD="$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
if [ "$(uname -s)" != "Linux" ]; then | ||
echo "don't run it if you are not using Linux" | ||
exit -1 | ||
fi | ||
|
||
pushd $CURRENT_PWD | ||
CONFIG=Debug | ||
if [ a"$1" != "adebug" ]; then | ||
rm -rf CMakeCache.txt CMakeFiles | ||
CONFIG=Release | ||
fi | ||
cmake -G "$GENERATOR" \ | ||
-DCMAKE_BUILD_TYPE="$CONFIG" \ | ||
-DCMAKE_EXPORT_COMPILE_COMMANDS=on | ||
$WORKER | ||
popd | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") | ||
|
||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
foreach(file ${files}) | ||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") | ||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval | ||
) | ||
if(NOT "${rm_retval}" STREQUAL 0) | ||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") | ||
endif(NOT "${rm_retval}" STREQUAL 0) | ||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.") | ||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
endforeach(file) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python2 | ||
|
||
import os,sys,shutil | ||
|
||
if __name__ == '__main__': | ||
if len(sys.argv) <= 2: | ||
print 'This is a little helper script to copy the pngs file to the correct directory' | ||
print 'Usage: %s [directory] [name]' % sys.argv[0] | ||
sys.exit(-1) | ||
os.chdir(os.path.dirname(__file__)) | ||
source_dir = os.path.abspath(sys.argv[1]) | ||
source_name = os.path.splitext(os.path.basename(source_dir))[0] | ||
png_files = os.listdir(source_dir) | ||
for png_file in png_files: | ||
prefix = os.path.splitext(os.path.basename(png_file))[0] | ||
target_name = os.path.join('hicolor', prefix, 'emblems') | ||
if not os.path.exists(target_name): | ||
os.makedirs(target_name) | ||
source = os.path.join(source_dir, png_file) | ||
target = os.path.join(target_name, sys.argv[2] + '.png') | ||
print 'copy %s to %s' % (source, target) | ||
shutil.copyfile(source, target) |
Oops, something went wrong.