-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drop python module installer cuz it can't do what I want... use cmake…
… instead
- Loading branch information
Showing
8 changed files
with
114 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
*.py[co] | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
|
||
# Installer logs | ||
pip-log.txt | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
|
||
#Translations | ||
*.mo | ||
|
||
#Mr Developer | ||
.mr.developer.cfg | ||
*.expandc | ||
*.kate-swp |
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,35 @@ | ||
# | ||
# Copyright 2012 by Alex Trubov <i.zaufi@gmail.com> | ||
# | ||
|
||
cmake_minimum_required(VERSION 2.6) | ||
cmake_policy(SET CMP0002 OLD) | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) | ||
|
||
project(kate-pate-plugins NONE) | ||
|
||
find_package(PythonInterp REQUIRED) | ||
include(PythonMacros) | ||
|
||
if(INSTALL_TYPE STREQUAL "user") | ||
set(CMAKE_INSTALL_PREFIX "~/.kde4/share/apps/kate/pate") | ||
else() | ||
set(CMAKE_INSTALL_PREFIX "/usr/share/apps/kate/pate") | ||
endif() | ||
|
||
set(LIBKATEPATE_DIR libkatepate) | ||
set(LIBKATEPATE_SOURCES ${LIBKATEPATE_DIR}/__init__.py ${LIBKATEPATE_DIR}/ui.py) | ||
python_install(${CMAKE_INSTALL_PREFIX}/${LIBKATEPATE_DIR} ${LIBKATEPATE_SOURCES}) | ||
|
||
set(PLUGIN_SOURCES format.py block.py commentar.py expand/expand.py) | ||
python_install(${CMAKE_INSTALL_PREFIX} ${PLUGIN_SOURCES}) | ||
|
||
set(EXPAND_DIR libkatepate) | ||
set(EXPAND_SOURCES expand/text_x-c++src.expand) | ||
python_install(${CMAKE_INSTALL_PREFIX}/${EXPAND_DIR} ${EXPAND_SOURCES}) | ||
|
||
install( | ||
FILES expand/text_x-c++hdr.expand expand/text_x-chdr.expand | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/${EXPAND_DIR} | ||
) |
This file was deleted.
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
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,4 @@ | ||
# By Simon Edwards <simon@simonzone.com> | ||
# This file is in the public domain. | ||
import py_compile | ||
py_compile.main() |
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,71 @@ | ||
# Python macros | ||
# ~~~~~~~~~~~~~ | ||
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com> | ||
# Copyright (c) 2012, Alex Turbov <i.zaufi@gmail.com> | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
# | ||
# This file defines the following macros: | ||
# | ||
# python_install(DESINATION_DIR SOURCE_FILE0[ SOURCE_FILE1[ ... [SOURCE_FILEn]]]) | ||
# Install source files, which is a Python .py files, into the | ||
# destination directory during install. The file will be byte compiled | ||
# and both the .py file and .pyc file will be installed. | ||
# | ||
# Changelog: | ||
# Mon Jun 11 02:49:02 MSK 2012, by Alex Turbov | ||
# Refactoring to support variadic number of source files | ||
# Prevent excecution w/ incorrect arguments count | ||
# | ||
|
||
get_filename_component(PYTHON_MACROS_MODULE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH) | ||
|
||
macro(python_install DESINATION_DIR) | ||
set(SOURCE_FILES ${ARGN}) | ||
|
||
# Make sure that we have smth to do... | ||
if(${ARGC} LESS 2) | ||
message(FATAL_ERROR "At least one source file required for python_install()") | ||
return() | ||
endif() | ||
|
||
add_custom_target(compile_python_files ALL) | ||
|
||
# Install the source files. | ||
install(FILES ${SOURCE_FILES} DESTINATION ${DESINATION_DIR}) | ||
|
||
foreach(_py_file ${SOURCE_FILES}) | ||
# Byte compile and install the .pyc file. | ||
get_filename_component(_absfilename ${_py_file} ABSOLUTE) | ||
get_filename_component(_filename ${_py_file} NAME) | ||
get_filename_component(_filenamebase ${_py_file} NAME_WE) | ||
get_filename_component(_basepath ${_py_file} PATH) | ||
get_filename_component(_ext ${_py_file} EXT) | ||
set(_bin_py ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filename}) | ||
set(_bin_pyc ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}${_ext}c) | ||
|
||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}) | ||
|
||
get_filename_component(_abs_bin_py ${_bin_py} ABSOLUTE) | ||
# Don't copy the file onto itself. | ||
if(_abs_bin_py STREQUAL ${_absfilename}) | ||
add_custom_command( | ||
TARGET compile_python_files | ||
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_MACROS_MODULE_PATH}/PythonCompile.py ${_bin_py} | ||
DEPENDS ${_absfilename} | ||
COMMENT "Byte-compiling ${_py_file}" | ||
) | ||
else() | ||
add_custom_command( | ||
TARGET compile_python_files | ||
COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py} | ||
COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_MACROS_MODULE_PATH}/PythonCompile.py ${_bin_py} | ||
DEPENDS ${_absfilename} | ||
COMMENT "Byte-compiling ${_py_file}" | ||
) | ||
endif() | ||
install(FILES ${_bin_pyc} DESTINATION ${DESINATION_DIR}) | ||
endforeach() | ||
|
||
endmacro(python_install) |