Skip to content

Commit

Permalink
added libcpuid (#2501)
Browse files Browse the repository at this point in the history
Add libcpuid@0.6.5
  • Loading branch information
joshheyse authored Jul 31, 2024
1 parent bfc2cf7 commit d3a6729
Showing 6 changed files with 107 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/libcpuid/0.6.5/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module(
name = "libcpuid",
version = "0.6.5",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
52 changes: 52 additions & 0 deletions modules/libcpuid/0.6.5/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,49 @@
+cc_library(
+ name = "cpuid",
+ srcs = [
+ "libcpuid/amd_code_t.h",
+ "libcpuid/asm-bits.c",
+ "libcpuid/asm-bits.h",
+ "libcpuid/centaur_code_t.h",
+ "libcpuid/cpuid_main.c",
+ "libcpuid/intel_code_t.h",
+ "libcpuid/libcpuid_internal.h",
+ "libcpuid/libcpuid_util.c",
+ "libcpuid/libcpuid_util.h",
+ "libcpuid/rdmsr.c",
+ "libcpuid/rdtsc.c",
+ "libcpuid/rdtsc.h",
+ "libcpuid/recog_amd.c",
+ "libcpuid/recog_amd.h",
+ "libcpuid/recog_centaur.c",
+ "libcpuid/recog_centaur.h",
+ "libcpuid/recog_intel.c",
+ "libcpuid/recog_intel.h",
+ ] + select({
+ "@platforms//os:windows": [
+ "libcpuid/msrdriver.c",
+ ],
+ "//conditions:default": [],
+ }),
+ hdrs = [
+ "libcpuid/libcpuid.h",
+ "libcpuid/libcpuid_constants.h",
+ "libcpuid/libcpuid_types.h",
+ ],
+ local_defines = [
+ "VERSION=\\\"0.6.5\\\"",
+ ] + select({
+ "@platforms//os:linux": ["_GNU_SOURCE"],
+ "//conditions:default": [],
+ }),
+ linkopts = select({
+ "@platforms//os:windows": [],
+ "//conditions:default": ["-lpthread"],
+ }),
+ visibility = ["//visibility:public"],
+)
+alias(
+ name = "libcpuid",
+ actual = ":cpuid",
+ visibility = ["//visibility:public"],
+)
10 changes: 10 additions & 0 deletions modules/libcpuid/0.6.5/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- MODULE.bazel
+++ MODULE.bazel
@@ -0,0 +1,7 @@
+module(
+ name = "libcpuid",
+ version = "0.6.5",
+ compatibility_level = 1,
+)
+
+bazel_dep(name = "platforms", version = "0.0.8")
17 changes: 17 additions & 0 deletions modules/libcpuid/0.6.5/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
platform:
- debian10
- debian11
- macos
- macos_arm64
- ubuntu2004
- ubuntu2204
- windows
bazel: [7.x]
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- "@libcpuid//:libcpuid"
10 changes: 10 additions & 0 deletions modules/libcpuid/0.6.5/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "https://github.com/anrieff/libcpuid/releases/download/v0.6.5/libcpuid-0.6.5.tar.gz",
"integrity": "sha256-mAClOdp+o3ucNugrBfUzv4X7FcXC0cJn135kAYVbzvs=",
"strip_prefix": "libcpuid-0.6.5",
"patch_strip": 0,
"patches": {
"add_build_file.patch": "sha256-e7Viq8O2BdQI4vquCDsNQONTzgWNwmIA49FJpBO2mXQ=",
"module_dot_bazel.patch": "sha256-585YuwpMwTZ/NHJ4cMM13Ec57TTVDHJCfQGfpBwpDSc="
}
}
11 changes: 11 additions & 0 deletions modules/libcpuid/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"homepage": "https://github.com/anrieff/libcpuid",
"maintainers": [],
"repository": [
"github:anrieff/libcpuid"
],
"versions": [
"0.6.5"
],
"yanked_versions": {}
}

0 comments on commit d3a6729

Please sign in to comment.