Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BlenderPhi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
raas
BlenderPhi
Commits
f0d7fbc4
Commit
f0d7fbc4
authored
Mar 21, 2011
by
Brecht Van Lommel
Browse files
Options
Downloads
Patches
Plain Diff
CMake package_archive target to create a .zip/.tar.bz2 package on mac/unix,
to be used by buildbot.
parent
2513b194
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
GNUmakefile
+4
-0
4 additions, 0 deletions
GNUmakefile
build_files/cmake/packaging.cmake
+29
-1
29 additions, 1 deletion
build_files/cmake/packaging.cmake
build_files/package_spec/build_archive.py
+69
-0
69 additions, 0 deletions
build_files/package_spec/build_archive.py
with
102 additions
and
1 deletion
GNUmakefile
+
4
−
0
View file @
f0d7fbc4
...
@@ -90,6 +90,10 @@ package_debian:
...
@@ -90,6 +90,10 @@ package_debian:
package_pacman
:
package_pacman
:
cd
build_files/package_spec/pacman
;
MAKEFLAGS
=
"-j
$(
NPROCS
)
"
makepkg
--asroot
cd
build_files/package_spec/pacman
;
MAKEFLAGS
=
"-j
$(
NPROCS
)
"
makepkg
--asroot
package_archive
:
cd
$(
BUILD_DIR
)
;
make
-s
package_archive
@
echo
archive
in
"
$(
BUILD_DIR
)
/release"
# forward build targets
# forward build targets
test
:
test
:
cd
$(
BUILD_DIR
)
;
ctest
.
--output-on-failure
cd
$(
BUILD_DIR
)
;
ctest
.
--output-on-failure
...
...
This diff is collapsed.
Click to expand it.
build_files/cmake/packaging.cmake
+
29
−
1
View file @
f0d7fbc4
...
@@ -51,7 +51,35 @@ if(APPLE)
...
@@ -51,7 +51,35 @@ if(APPLE)
# Libraries are bundled directly
# Libraries are bundled directly
set
(
CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE
)
set
(
CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE
)
endif
(
APPLE
)
endif
()
set
(
CPACK_PACKAGE_EXECUTABLES
"blender"
)
set
(
CPACK_PACKAGE_EXECUTABLES
"blender"
)
include
(
CPack
)
include
(
CPack
)
# Target for build_archive.py script, to automatically pass along
# version, revision, platform, build directory
macro
(
add_package_archive packagename extension
)
set
(
build_archive python
${
CMAKE_SOURCE_DIR
}
/build_files/package_spec/build_archive.py
)
set
(
package_output
${
CMAKE_BINARY_DIR
}
/release/
${
packagename
}
.
${
extension
}
)
add_custom_target
(
package_archive DEPENDS
${
package_output
}
)
add_custom_command
(
OUTPUT
${
package_output
}
COMMAND
${
build_archive
}
${
packagename
}
${
extension
}
bin release
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
)
endmacro
()
if
(
APPLE
)
add_package_archive
(
"blender-
${
BLENDER_VERSION
}
-r
${
BUILD_REV
}
-OSX-
${
CMAKE_OSX_ARCHITECTURES
}
"
"zip"
)
elseif
(
UNIX
)
# platform name could be tweaked, to include glibc, and ensure processor is correct (i386 vs i686)
string
(
TOLOWER
${
CMAKE_SYSTEM_NAME
}
PACKAGE_SYSTEM_NAME
)
add_package_archive
(
"blender-
${
BLENDER_VERSION
}
-r
${
BUILD_REV
}
-
${
PACKAGE_SYSTEM_NAME
}
-
${
CMAKE_SYSTEM_PROCESSOR
}
"
"tar.bz2"
)
endif
()
This diff is collapsed.
Click to expand it.
build_files/package_spec/build_archive.py
0 → 100755
+
69
−
0
View file @
f0d7fbc4
#!/usr/bin/python
import
os
import
shutil
import
subprocess
import
sys
# todo:
# strip executables
# get parameters
if
len
(
sys
.
argv
)
<
5
:
sys
.
stderr
.
write
(
'
Excepted arguments: ./build_archive.py name extension install_dir output_dir
'
)
sys
.
exit
(
1
)
package_name
=
sys
.
argv
[
1
]
extension
=
sys
.
argv
[
2
]
install_dir
=
sys
.
argv
[
3
]
output_dir
=
sys
.
argv
[
4
]
package_archive
=
os
.
path
.
join
(
output_dir
,
package_name
+
'
.
'
+
extension
)
package_dir
=
package_name
# remove existing package with the same name
try
:
if
os
.
path
.
exists
(
package_archive
):
os
.
remove
(
package_archive
)
if
os
.
path
.
exists
(
package_dir
):
shutil
.
rmtree
(
package_dir
)
except
:
sys
.
stderr
.
write
(
'
Failed to clean up old package files:
'
+
sys
.
exc_info
()[
0
]
+
'
\n
'
)
sys
.
exit
(
1
)
# create temporary package dir
try
:
shutil
.
copytree
(
install_dir
,
package_dir
)
for
f
in
os
.
listdir
(
package_dir
):
if
f
.
startswith
(
'
makes
'
):
os
.
remove
(
os
.
path
.
join
(
package_dir
,
f
))
except
:
sys
.
stderr
.
write
(
'
Failed to copy install directory:
'
+
sys
.
exc_info
()[
0
]
+
'
\n
'
)
sys
.
exit
(
1
)
# create archive
try
:
if
not
os
.
path
.
exists
(
output_dir
):
os
.
mkdir
(
output_dir
)
if
extension
==
'
zip
'
:
archive_cmd
=
[
'
zip
'
,
'
-9
'
,
'
-r
'
,
package_archive
,
package_dir
]
elif
extension
==
'
tar.bz2
'
:
archive_cmd
=
[
'
tar
'
,
'
cjf
'
,
package_archive
,
package_dir
]
else
:
sys
.
stderr
.
write
(
'
Unknown archive extension:
'
+
extension
)
sys
.
exit
(
-
1
)
subprocess
.
call
(
archive_cmd
)
except
:
sys
.
stderr
.
write
(
'
Failed to create package archive:
'
+
sys
.
exc_info
()[
0
]
+
'
\n
'
)
sys
.
exit
(
1
)
# empty temporary package dir
try
:
shutil
.
rmtree
(
package_dir
)
except
:
sys
.
stderr
.
write
(
'
Failed to clean up package directory:
'
+
sys
.
exc_info
()[
0
]
+
'
\n
'
)
sys
.
exit
(
1
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment