Skip to content

Commit 827cca3

Browse files
committed
Install setuptools, add egginfo for installed modules
1 parent c722c8c commit 827cca3

File tree

6 files changed

+149
-0
lines changed

6 files changed

+149
-0
lines changed

CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,23 @@ function(build_pybundle name)
3636
install(CODE "execute_process(COMMAND mv ${full_name} ${name}.so WORKING_DIRECTORY ${BUNDLE_DESTINATION})")
3737
endfunction(build_pybundle)
3838

39+
function(easyinstall python_version package_name package_version)
40+
set(local_file "${CMAKE_CURRENT_BINARY_DIR}/${package_name}-${package_version}-${python_version}")
41+
42+
set(EXEPATH "/System/Library/Frameworks/Python.framework/Versions/${python_version}/bin/python${python_version}")
43+
set(PYTHON_VERSION ${python_version})
44+
set(PACKAGE_NAME ${package_name})
45+
set(PACKAGE_VERSION ${package_version})
46+
47+
configure_file(${CMAKE_SOURCE_DIR}/src/external/python_modules/easyinstall.py.in "${local_file}")
48+
install(PROGRAMS "${local_file}" DESTINATION libexec/darling/usr/bin RENAME "${package_name}-${python_version}")
49+
endfunction(easyinstall)
50+
3951
add_subdirectory(Modules/six-1.4.1/six-1.4.1)
4052
add_subdirectory(Modules/macholib-1.5.1/macholib-1.5.1)
4153
add_subdirectory(Modules/macholib-1.5/macholib-1.5)
4254
add_subdirectory(Modules/xattr-0.6.4/xattr-0.6.4)
55+
add_subdirectory(Modules/setuptools-18.5/setuptools-18.5)
4356

4457
install(FILES Extras-2.6.pth DESTINATION libexec/darling/Library/Python/2.6/site-packages RENAME Extras.pth)
4558
install(FILES Extras-2.7.pth DESTINATION libexec/darling/Library/Python/2.7/site-packages RENAME Extras.pth)

Modules/macholib-1.5.1/macholib-1.5.1/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ set(macholib_src
2323
pyc("py27_macholib" SOURCES ${macholib_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/macholib)
2424
install(FILES ${macholib_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/macholib)
2525

26+
set(eggfiles
27+
PKG-INFO
28+
README.txt
29+
)
30+
INSTALL(FILES ${eggfiles} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/macholib-1.5.1-py2.7.egg-info)
31+
INSTALL(FILES ${eggfiles} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/macholib-1.5.1-py2.6.egg-info)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
project(python-setuptools)
2+
3+
set(setuptools_src
4+
setuptools/archive_util.py
5+
setuptools/compat.py
6+
setuptools/depends.py
7+
setuptools/dist.py
8+
setuptools/extension.py
9+
setuptools/__init__.py
10+
setuptools/lib2to3_ex.py
11+
setuptools/msvc9_support.py
12+
setuptools/package_index.py
13+
setuptools/py26compat.py
14+
setuptools/py27compat.py
15+
setuptools/py31compat.py
16+
setuptools/sandbox.py
17+
setuptools/site-patch.py
18+
setuptools/ssl_support.py
19+
setuptools/unicode_utils.py
20+
setuptools/utils.py
21+
setuptools/version.py
22+
setuptools/windows_support.py
23+
)
24+
set(setuptools_command_src
25+
setuptools/command/alias.py
26+
setuptools/command/bdist_egg.py
27+
setuptools/command/bdist_rpm.py
28+
setuptools/command/bdist_wininst.py
29+
setuptools/command/build_ext.py
30+
setuptools/command/build_py.py
31+
setuptools/command/develop.py
32+
setuptools/command/easy_install.py
33+
setuptools/command/egg_info.py
34+
setuptools/command/__init__.py
35+
setuptools/command/install_egg_info.py
36+
setuptools/command/install_lib.py
37+
setuptools/command/install.py
38+
setuptools/command/install_scripts.py
39+
setuptools/command/register.py
40+
setuptools/command/rotate.py
41+
setuptools/command/saveopts.py
42+
setuptools/command/sdist.py
43+
setuptools/command/setopt.py
44+
setuptools/command/test.py
45+
setuptools/command/upload_docs.py
46+
)
47+
48+
set(setuptools_tmpl
49+
"setuptools/script (dev).tmpl"
50+
setuptools/script.tmpl
51+
)
52+
53+
set(pkgresources_src
54+
pkg_resources/__init__.py
55+
)
56+
set(pkgresources_vendor_src
57+
pkg_resources/_vendor/__init__.py
58+
)
59+
set(pkgresources_vendorp_src
60+
pkg_resources/_vendor/packaging/__about__.py
61+
pkg_resources/_vendor/packaging/_compat.py
62+
pkg_resources/_vendor/packaging/__init__.py
63+
pkg_resources/_vendor/packaging/specifiers.py
64+
pkg_resources/_vendor/packaging/_structures.py
65+
pkg_resources/_vendor/packaging/version.py
66+
)
67+
68+
pyc("py27_setuptools" SOURCES ${setuptools_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools)
69+
pyc("py27_setuptools_command" SOURCES ${setuptools_command_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command)
70+
install(FILES ${setuptools_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools)
71+
install(FILES ${setuptools_command_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command)
72+
73+
pyc("py26_setuptools" SOURCES ${setuptools_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools)
74+
pyc("py26_setuptools_command" SOURCES ${setuptools_command_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command)
75+
install(FILES ${setuptools_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools)
76+
install(FILES ${setuptools_command_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools/command)
77+
78+
pyc("py26_pkgr" SOURCES ${pkgresources_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources)
79+
pyc("py26_pkgr_vendor" SOURCES ${pkgresources_vendor_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources/_vendor/packaging)
80+
pyc("py26_pkgr_vendorp" SOURCES ${pkgresources_vendorp_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources/_vendor)
81+
install(FILES ${pkgresources_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources)
82+
install(FILES ${pkgresources_vendor_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources/_vendor)
83+
install(FILES ${pkgresources_vendorp_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources/_vendor/packaging)
84+
85+
pyc("py27_pkgr" SOURCES ${pkgresources_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources)
86+
pyc("py27_pkgr_vendor" SOURCES ${pkgresources_vendor_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/_vendor/packaging)
87+
pyc("py27_pkgr_vendorp" SOURCES ${pkgresources_vendorp_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/_vendor)
88+
install(FILES ${pkgresources_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources)
89+
install(FILES ${pkgresources_vendor_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/_vendor)
90+
install(FILES ${pkgresources_vendorp_src} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/_vendor/packaging)
91+
92+
INSTALL(DIRECTORY setuptools.egg-info/ DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools-18.5-py2.7.egg-info)
93+
INSTALL(DIRECTORY setuptools.egg-info/ DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/setuptools-18.5-py2.6.egg-info)

Modules/six-1.4.1/six-1.4.1/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ project(python-six)
33
pyc("py27_six" SOURCES six.py DESTINATION libexec/darling/System/Library/Frameworks/Python.framework//Versions/2.7/Extras/lib/python)
44
install(FILES six.py DESTINATION libexec/darling/System/Library/Frameworks/Python.framework//Versions/2.7/Extras/lib/python)
55

6+
set(eggfiles
7+
PKG-INFO
8+
README
9+
)
10+
INSTALL(FILES ${eggfiles} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info)
11+
INSTALL(FILES ${eggfiles} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/six-1.4.1-py2.6.egg-info)

Modules/xattr-0.6.4/xattr-0.6.4/CMakeLists.txt

+18
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,21 @@ build_pybundle(_xattr
2424
install(FILES ${xattr_pysrc} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/xattr)
2525

2626
install(FILES ${xattr_pysrc} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr)
27+
28+
easyinstall("2.6" "xattr" "0.6.4")
29+
easyinstall("2.7" "xattr" "0.6.4")
30+
31+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/entry_points.txt "[console_scripts]\nxattr = xattr.tool:main\n")
32+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/top_level.txt "xattr\n")
33+
34+
set(eggfiles
35+
CHANGES.txt
36+
INSTALLING.txt
37+
LICENSE.txt
38+
PKG-INFO
39+
README.txt
40+
${CMAKE_CURRENT_BINARY_DIR}/entry_points.txt
41+
${CMAKE_CURRENT_BINARY_DIR}/top_level.txt
42+
)
43+
INSTALL(FILES ${eggfiles} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr-0.6.4-py2.7.egg-info)
44+
INSTALL(FILES ${eggfiles} DESTINATION libexec/darling/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/xattr-0.6.4-py2.6.egg-info)

easyinstall.py.in

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!@EXEPATH@
2+
import sys
3+
sys.argv[0] = sys.argv[0].replace('-@PYTHON_VERSION@', '')
4+
# EASY-INSTALL-ENTRY-SCRIPT: 'xattr==0.6.4','console_scripts','xattr'
5+
__requires__ = '@PACKAGE_NAME@==@PACKAGE_VERSION@'
6+
import sys
7+
from pkg_resources import load_entry_point
8+
9+
if __name__ == '__main__':
10+
sys.exit(
11+
load_entry_point('@PACKAGE_NAME@==@PACKAGE_VERSION@', 'console_scripts', '@PACKAGE_NAME@')()
12+
)
13+

0 commit comments

Comments
 (0)