Skip to content

Commit

Permalink
Fix glpk (#3066)
Browse files Browse the repository at this point in the history
- Remove stripped path prefix from paths in BUILD file
- Fix include paths for Bzlmod
  • Loading branch information
mering authored Oct 30, 2024
1 parent 60aba96 commit d22b2e7
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 1 deletion.
9 changes: 9 additions & 0 deletions modules/glpk/5.0.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "glpk",
version = "5.0.bcr.1",
)

bazel_dep(
name = "zlib",
version = "1.2.13",
)
57 changes: 57 additions & 0 deletions modules/glpk/5.0.bcr.1/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
--- /dev/null
+++ BUILD.bazel
@@ -0,0 +1,53 @@
+# Copyright 2010-2024 Google LLC
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+cc_library(
+ name = "glpk",
+ srcs = glob(
+ [
+ "src/*.c",
+ "src/*/*.c",
+ "src/*.h",
+ "src/*/*.h",
+ ],
+ exclude = [
+ "src/proxy/main.c",
+ "src/zlib/*",
+ ],
+ ),
+ hdrs = [
+ "src/glpk.h",
+ ],
+ copts = [
+ "-w",
+ ],
+ deps = ["@zlib"],
+ includes = [
+ "src",
+ # TODO find a way to determine "external/glpk~VERSION" for use via copts "-I"
+ "src/amd",
+ "src/api",
+ "src/bflib",
+ "src/colamd",
+ "src/draft",
+ "src/env",
+ "src/intopt",
+ "src/minisat",
+ "src/misc",
+ "src/mpl",
+ "src/npp",
+ "src/proxy",
+ "src/simplex",
+ ],
+ visibility = ["//visibility:public"],
+)

12 changes: 12 additions & 0 deletions modules/glpk/5.0.bcr.1/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- MODULE.bazel
+++ MODULE.bazel
@@ -0,0 +1,9 @@
+module(
+ name = "glpk",
+ version = "5.0.bcr.1",
+)
+
+bazel_dep(
+ name = "zlib",
+ version = "1.2.13",
+)
17 changes: 17 additions & 0 deletions modules/glpk/5.0.bcr.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@glpk//:glpk'
10 changes: 10 additions & 0 deletions modules/glpk/5.0.bcr.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"url": "http://ftp.gnu.org/gnu/glpk/glpk-5.0.tar.gz",
"integrity": "sha256-ShAT7rtQ9yj8YBvdgzsLKHAzPDs+WoFu66kh2VvsbxU=",
"strip_prefix": "glpk-5.0",
"patches": {
"add_build_file.patch": "sha256-aDqGyRcF/EIJqSfBvLJ4/HRk76d4v1wt0UWCy/u6t3c=",
"module_dot_bazel.patch": "sha256-3qBzfbSKdOT9ms0qzGkXdwh5+hWucSR6Y1m56mKzZ2o="
},
"patch_strip": 0
}
3 changes: 2 additions & 1 deletion modules/glpk/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
],
"repository": [],
"versions": [
"5.0"
"5.0",
"5.0.bcr.1"
],
"yanked_versions": {}
}

0 comments on commit d22b2e7

Please sign in to comment.