-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 04dc598
Showing
9 changed files
with
208 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Update git-tree | ||
|
||
on: | ||
workflow_run: | ||
workflows: Update vcpkg port | ||
types: completed | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
concurrency: | ||
group: update-git-tree | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
update-git-tree: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- run: python update_git_tree.py | ||
|
||
- name: Add & Commit | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
default_author: github_actions | ||
message: "ci: update git-tree" |
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,33 @@ | ||
name: Update vcpkg port | ||
|
||
on: | ||
repository_dispatch: | ||
types: [update-clib-port-event] | ||
workflow_dispatch: | ||
|
||
permissions: write-all | ||
|
||
concurrency: | ||
group: update-vcpkg-port | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
update-vcpkg-port: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- run: python update_vcpkg_port.py | ||
|
||
- name: Add & Commit | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
default_author: github_actions | ||
message: "ci: update vcpkg port" |
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,45 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO Starfield-Reverse-Engineering/CommonLibSF | ||
REF 0 | ||
SHA512 0 | ||
HEAD_REF main | ||
) | ||
|
||
vcpkg_check_features( | ||
OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
xbyak SFSE_SUPPORT_XBYAK | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
OPTIONS ${FEATURE_OPTIONS} | ||
) | ||
|
||
vcpkg_cmake_install() | ||
|
||
vcpkg_cmake_config_fixup( | ||
PACKAGE_NAME CommonLibSF | ||
CONFIG_PATH lib/cmake | ||
) | ||
|
||
vcpkg_copy_pdbs() | ||
|
||
file(GLOB CMAKE_CONFIGS ${CURRENT_PACKAGES_DIR}/share/CommonLibSF/CommonLibSF/*.cmake) | ||
|
||
file( | ||
INSTALL ${CMAKE_CONFIGS} | ||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/CommonLibSF | ||
) | ||
file( | ||
INSTALL ${SOURCE_PATH}/cmake/CommonLibSF.cmake | ||
DESTINATION ${CURRENT_PACKAGES_DIR}/share/CommonLibSF | ||
) | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/CommonLibSF/CommonLibSF) | ||
|
||
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) | ||
|
||
vcpkg_install_copyright(FILE_LIST ${SOURCE_PATH}/LICENSE) |
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,9 @@ | ||
The package CommonLibSF provides CMake targets: | ||
|
||
find_package(CommonLibSF CONFIG REQUIRED) | ||
|
||
add_commonlibsf_plugin( | ||
${PROJECT_NAME} | ||
AUTHOR <your name> | ||
SOURCES <your source files> | ||
) |
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,24 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | ||
"name": "commonlibsf", | ||
"version-string": "latest", | ||
"description": "CommonLibSF", | ||
"homepage": "https://github.com/Starfield-Reverse-Engineering/CommonLibSF", | ||
"dependencies": [ | ||
"spdlog", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"xbyak": { | ||
"description": "xbyak support", | ||
"dependencies": ["xbyak"] | ||
} | ||
} | ||
} |
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,18 @@ | ||
from json import dumps, load | ||
from subprocess import run | ||
|
||
# Update CLibNG git-tree | ||
clib_git_tree = run( | ||
["git", "rev-parse", "HEAD:ports/commonlibsf"], capture_output=True | ||
).stdout.decode() | ||
|
||
with open("./versions/c-/commonlibsf.json") as f: | ||
version = load(f) | ||
|
||
version["versions"][0]["git-tree"] = clib_git_tree.strip("\n") | ||
|
||
version_str = dumps(version, indent=2) | ||
version_str += "\n" | ||
|
||
with open("./versions/c-/commonlibsf.json", "w", newline="\r\n") as f: | ||
f.write(version_str) |
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,28 @@ | ||
from hashlib import sha512 | ||
from re import sub | ||
from subprocess import run | ||
from urllib.request import urlretrieve | ||
|
||
clib_repo = "https://github.com/Starfield-Reverse-Engineering/CommonLibSF" | ||
|
||
clib_ref = ( | ||
run(["git", "ls-remote", clib_repo], capture_output=True) | ||
.stdout.decode() | ||
.splitlines()[0] | ||
.split()[0] | ||
) | ||
|
||
# Update CommonLibSF portfile | ||
clib_archive, _ = urlretrieve(f"{clib_repo}/archive/{clib_ref}.tar.gz") | ||
|
||
with open(clib_archive, "rb") as f: | ||
clib_sha = sha512(f.read()).hexdigest() | ||
|
||
with open("./ports/commonlibsf/portfile.cmake") as f: | ||
portfile = f.readlines() | ||
|
||
portfile[3] = sub(r"(REF).*", f"REF {clib_ref}", portfile[3]) | ||
portfile[4] = sub(r"(SHA512).*", f"SHA512 {clib_sha}", portfile[4]) | ||
|
||
with open("./ports/commonlibsf/portfile.cmake", "w", newline="\r\n") as f: | ||
f.writelines(portfile) |
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,8 @@ | ||
{ | ||
"default": { | ||
"commonlibsf": { | ||
"baseline": "latest", | ||
"port-version": 0 | ||
} | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"versions": [ | ||
{ | ||
"git-tree": "0", | ||
"version-string": "latest", | ||
"port-version": 0 | ||
} | ||
] | ||
} |