Skip to content

Commit

Permalink
Add bullet package (#16)
Browse files Browse the repository at this point in the history
* Add bullet package

* Added more details to bullet/Readme.md

* Update package/bullet/README.md

Co-Authored-By: Steven! Ragnarök <[email protected]>

* Update package/bullet/bullet.nuspec

Co-Authored-By: Steven! Ragnarök <[email protected]>
  • Loading branch information
ahcorde and nuclearsandwich authored Feb 24, 2020
1 parent 620f9e3 commit 3c6b274
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 0 deletions.
18 changes: 18 additions & 0 deletions package/bullet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Chocolatey Package for Bullet.

This package is beta quality and designed for a specific application.
At this time it is not recommended to distribute this package outside of the
tutorial application which requires it.

To build the package, follow these steps.

You need Git, Visual Studio 2017 Command line tools, CMake, Chocolatey, and a text editor.

- Clone or download https://github.com/bulletphysics/bullet3
- Create a CMake build directory and run `cmake -G "Visual Studio 15 2017 Win64" PATH_TO_BULLET_SOURCE -DBUILD_SHARED_LIBS=ON -DUSE_DOUBLE_PRECISION=ON -DBUILD_CPU_DEMOS=OFF -DBUILD_BULLET2_DEMOS=OFF -DBUILD_OPENGL3_DEMOS=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_EXTRAS=OFF`.
- Run `msbuild ALL_BUILD.sln /p:Configuration=Release`
- Copy `Bullet*.lib` and `Bullet*.dll` located under `lib/Release` files to the package `lib/` directory.
- Run `msbuild ALL_BUILD.sln /p:Configuration=Debug`
- Copy `Bullet*_Debug.lib`, `Bullet*_Debug.dll` and `Bullet*_Debug.pdb` located under `lib/Debug` files to the package `lib/` directory.
- Run `choco pack`.
- Test the package and if it's good upload it somewhere your end users can reach it.
57 changes: 57 additions & 0 deletions package/bullet/bullet.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Read this before creating packages: https://chocolatey.org/docs/create-packages -->
<!-- It is especially important to read the above link to understand additional requirements when publishing packages to the community feed aka dot org (https://chocolatey.org/packages). -->

<!-- Test your packages in a test environment: https://github.com/chocolatey/chocolatey-test-environment -->

<!--
This is a nuspec. It mostly adheres to https://docs.nuget.org/create/Nuspec-Reference. Chocolatey uses a special version of NuGet.Core that allows us to do more than was initially possible. As such there are certain things to be aware of:
* the package xmlns schema url may cause issues with nuget.exe
* Any of the following elements can ONLY be used by choco tools - projectSourceUrl, docsUrl, mailingListUrl, bugTrackerUrl, packageSourceUrl, provides, conflicts, replaces
* nuget.exe can still install packages with those elements but they are ignored. Any authoring tools or commands will error on those elements
-->

<!-- You can embed software files directly into packages, as long as you are not bound by distribution rights. -->
<!-- * If you are an organization making private packages, you probably have no issues here -->
<!-- * If you are releasing to the community feed, you need to consider distribution rights. -->
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<!-- == PACKAGE SPECIFIC SECTION == -->
<!-- This section is about this package, although id and version have ties back to the software -->
<!-- id is lowercase and if you want a good separator for words, use '-', not '.'. Dots are only acceptable as suffixes for certain types of packages, e.g. .install, .portable, .extension, .template -->
<!-- If the software is cross-platform, attempt to use the same id as the debian/rpm package(s) if possible. -->
<id>bullet</id>
<!-- version should MATCH as closely as possible with the underlying software -->
<!-- Is the version a prerelease of a version? https://docs.nuget.org/create/versioning#creating-prerelease-packages -->
<!-- Note that unstable versions like 0.0.1 can be considered a released version, but it's possible that one can release a 0.0.1-beta before you release a 0.0.1 version. If the version number is final, that is considered a released version and not a prerelease. -->
<version>2.89.0</version>
<packageSourceUrl>https://github.com/ros2/choco-packages/tree/latest/package/bullet</packageSourceUrl>
<owners>Alejandro Hernández</owners>
<!-- ============================== -->

<!-- == SOFTWARE SPECIFIC SECTION == -->
<!-- This section is about the software itself -->
<title>Bullet</title>
<authors>Erwin Coumans</authors>
<!-- projectUrl is required for the community feed -->
<projectUrl>https://github.com/bulletphysics/bullet3/</projectUrl>
<!--<iconUrl>http://cdn.rawgit.com/__REPLACE_YOUR_REPO__/master/icons/tinyxml-usestl.png</iconUrl>-->
<!-- If there is a license Url available, it is is required for the community feed -->
<licenseUrl>https://github.com/bulletphysics/bullet3/blob/master/LICENSE.txt</licenseUrl>
<tags>physics simulation engine</tags>
<summary>Bullet Physics SDK is a real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.</summary>
<description>
Bullet Physics SDK is a real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
</description>
</metadata>
<files>
<!-- this section controls what actually gets packaged into the Chocolatey package -->
<file src="tools\**" target="tools" />
<file src="include\**" target="include" />
<file src="lib\**" target="lib" />
<file src="share\**" target="share" />
<!--Building from Linux? You may need this instead: <file src="tools/**" target="tools" />-->
</files>
</package>
Empty file added package/bullet/include/.gitkeep
Empty file.
Empty file added package/bullet/lib/.gitkeep
Empty file.
78 changes: 78 additions & 0 deletions package/bullet/share/cmake/BulletConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
get_filename_component(_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
set (BULLET_INCLUDE_DIRS "${_PREFIX}/include")

set(BULLET_DYNAMICS_LIBRARY
debug
"${_PREFIX}/lib/Bullet3Dynamics_Debug.dll"
"${_PREFIX}/lib/Bullet3Dynamics_Debug.lib"
"${_PREFIX}/lib/BulletDynamics_Debug.dll"
"${_PREFIX}/lib/BulletDynamics_Debug.lib"
"${_PREFIX}/lib/BulletInverseDynamics_Debug.dll"
"${_PREFIX}/lib/BulletInverseDynamics_Debug.lib"
optimized
"${_PREFIX}/lib/Bullet3Dynamics.dll"
"${_PREFIX}/lib/BulletDynamics.dll"
"${_PREFIX}/lib/BulletDynamics.lib"
"${_PREFIX}/lib/BulletInverseDynamics.dll"
"${_PREFIX}/lib/BulletInverseDynamics.lib"
)

set(BULLET_COLLISION_LIBRARY
debug
"${_PREFIX}/lib/Bullet3Collision_Debug.dll"
"${_PREFIX}/lib/Bullet3Collision_Debug.lib"
"${_PREFIX}/lib/BulletCollision_Debug.dll"
"${_PREFIX}/lib/BulletCollision_Debug.lib"
optimized
"${_PREFIX}/lib/Bullet3Collision.dll"
"${_PREFIX}/lib/Bullet3Collision.lib"
"${_PREFIX}/lib/BulletCollision.dll"
"${_PREFIX}/lib/BulletCollision.lib"
)

set(BULLET_MATH_LIBRARY
debug
"${_PREFIX}/lib/LinearMath_Debug.dll"
"${_PREFIX}/lib/LinearMath_Debug.lib"
optimized
"${_PREFIX}/lib/LinearMath.dll"
"${_PREFIX}/lib/LinearMath.lib"
)

set(BULLET_SOFTBODY_LIBRARY
debug
"${_PREFIX}/lib/BulletSoftBody_Debug.dll"
"${_PREFIX}/lib/BulletSoftBody_Debug.lib"
optimized
"${_PREFIX}/lib/BulletSoftBody.dll"
"${_PREFIX}/lib/BulletSoftBody.lib"
)

set (BULLET_LIBRARIES
debug
"${_PREFIX}/lib/Bullet2FileLoader_Debug.dll"
"${_PREFIX}/lib/Bullet2FileLoader_Debug.lib"

"${_PREFIX}/lib/Bullet3Common_Debug.dll"
"${_PREFIX}/lib/Bullet3Common_Debug.lib"
"${_PREFIX}/lib/Bullet3Geometry_Debug.dll"
"${_PREFIX}/lib/Bullet3Geometry_Debug.lib"
"${_PREFIX}/lib/Bullet3OpenCL_clew_Debug.dll"
"${_PREFIX}/lib/Bullet3OpenCL_clew_Debug.lib"
optimized
"${_PREFIX}/lib/Bullet2FileLoader.dll"
"${_PREFIX}/lib/Bullet2FileLoader.lib"
"${_PREFIX}/lib/Bullet3Common.dll"
"${_PREFIX}/lib/Bullet3Common.lib"
"${_PREFIX}/lib/Bullet3Geometry.dll"
"${_PREFIX}/lib/Bullet3Geometry.lib"
"${_PREFIX}/lib/Bullet3OpenCL_clew.dll"
"${_PREFIX}/lib/Bullet3OpenCL_clew.lib"
)

set (BULLET_INCLUDE_DIR "${BULLET_INCLUDE_DIRS}")
set (BULLET_INCLUDE_DIRS "${BULLET_INCLUDE_DIRS}")
set (BULLET_INCLUDE_DIR "${BULLET_INCLUDE_DIRS}")
set (BULLET_LIBRARY "${BULLET_LIBRARIES}")
set (BULLET_LIBRARIES "${BULLET_LIBRARIES}")
set (BULLET_LIBRARY "${BULLET_LIBRARIES}")
15 changes: 15 additions & 0 deletions package/bullet/tools/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
 This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
24 changes: 24 additions & 0 deletions package/bullet/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file:
# $f='c:\path\to\thisFile.ps1'
# gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f

$ErrorActionPreference = 'Stop'; # stop on all errors

# Source registry key values which are shared between install and uninstall
. $PSScriptRoot\regKeys.ps1


# CMake doesn't set registry keys for the system package repository by default so we check for the presence of CMake by observing the registry path for the current user.
# We need to register the package path to the machine because the jenkins node user doesn't have privileges to install packages via chocolatey. There may be other options to work around this and use HKCU.
if (Test-Path $CMakeRegistryPath) {
if (-not(Test-Path $CMakeSystemRepositoryPath)) {
# The force is necessary to make this create parent keys (think `mkdir -p`). It ain't great.
New-Item $CMakeSystemRepositoryPath -ItemType directory -Force
}

New-Item "$CMakeSystemRepositoryPath\$CMakePackageName" -ItemType directory
New-ItemProperty -Name "CMakePackageDir" -PropertyType String -Value "$env:ChocolateyPackageFolder\share\cmake" -Path "$CMakeSystemRepositoryPath\$CMakePackageName"
}

# Add lib directory to path for dlls.
Install-ChocolateyPath "$env:ChocolateyPackageFolder\lib" -PathType "Machine"
13 changes: 13 additions & 0 deletions package/bullet/tools/chocolateyuninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$ErrorActionPreference = 'Stop'; # stop on all errors

# Source registry key values which are shared between install and uninstall
. $PSScriptRoot\regKeys.ps1

if (Test-Path $CMakeRegistryPath) {
if (Test-Path $CMakeSystemRepositoryPath) {
Remove-Item "$CMakeSystemRepositoryPath\$CMakePackageName"
}
}

# Removal of the dynamic library from the system Path
# is handled automagically by the use of Install-ChocolateyPath.
3 changes: 3 additions & 0 deletions package/bullet/tools/regKeys.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$CMakeRegistryPath = "HKCU:\SOFTWARE\Kitware\CMake"
$CMakeSystemRepositoryPath = "HKLM:\SOFTWARE\Kitware\CMake\Packages"
$CMakePackageName = "Bullet"

0 comments on commit 3c6b274

Please sign in to comment.