-
Notifications
You must be signed in to change notification settings - Fork 1.3k
conf-gmp: use pkg-config where available #23330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,36 @@ | ||
| opam-version: "2.0" | ||
| maintainer: "Etienne Millon <etienne@cryptosense.com>" | ||
| homepage: "http://gmplib.org/" | ||
| bug-reports: "https://github.com/ocaml/opam-repository/issues" | ||
| license: "GPL-1.0-or-later" | ||
| build: [ | ||
| ["sh" "-c" "pkg-config --print-errors --exists gmp || cc -c $CFLAGS -I/usr/local/include test.c"] { os != "win32" } | ||
| [ | ||
| "sh" | ||
| "-exc" | ||
| "$(ocamlc -config-var c_compiler) -c $CFLAGS -I/usr/local/include test.c" | ||
| ] {os = "win32" & os-distribution = "cygwinports"} | ||
| ["sh" "-exc" | ||
| "%{host-arch-x86_64:installed?x86_64:}%%{host-arch-x86_32:installed?i686:}%-w64-mingw32-gcc -c $CFLAGS test.c" | ||
| ] {os = "win32"} | ||
|
mseri marked this conversation as resolved.
Outdated
mseri marked this conversation as resolved.
Outdated
mseri marked this conversation as resolved.
Outdated
|
||
| ] | ||
| depends: [ | ||
| "conf-gmp" | ||
| ("host-arch-x86_32" {os = "win32" & os-distribution != "cygwinports"} | | ||
| "host-arch-x86_64" {os = "win32" & os-distribution != "cygwinports"}) | ||
| ] | ||
| synopsis: | ||
| "Virtual package relying on a GMP lib with constant-time modular exponentiation" | ||
| description: """ | ||
| This package can only install if the GMP lib is installed on the system and | ||
| corresponds to a version that has the mpz_powm_sec function.""" | ||
| authors: "Etienne Millon <etienne@cryptosense.com>" | ||
| flags: conf | ||
| extra-source "test.c" { | ||
| src: | ||
| "https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/conf-gmp-powm-sec/test.c.3" | ||
| checksum: [ | ||
| "sha256=388b3879530257a7e6e59b68208ee2a52de7be30e40eb4d3a54419708fdad490" | ||
| "md5=29317f477fa828e18428660ef31064fb" | ||
| ] | ||
| } | ||
This file contains hidden or 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,50 @@ | ||
| opam-version: "2.0" | ||
| maintainer: "nbraud" | ||
| homepage: "http://gmplib.org/" | ||
| bug-reports: "https://github.com/ocaml/opam-repository/issues" | ||
| license: "GPL-1.0-or-later" | ||
| build: [ | ||
| ["sh" "-c" "pkg-config --print-errors --exists gmp || cc -c $CFLAGS -I/usr/local/include test.c"] { os != "win32" } | ||
| [ | ||
| "sh" | ||
| "-exc" | ||
| "$(ocamlc -config-var c_compiler) -c $CFLAGS -I/usr/local/include test.c" | ||
| ] {os = "win32" & os-distribution = "cygwinports"} | ||
|
mseri marked this conversation as resolved.
Outdated
|
||
| [ | ||
| "sh" | ||
| "-exc" | ||
| "%{host-arch-x86_64:installed?x86_64:}%%{host-arch-x86_32:installed?i686:}%-w64-mingw32-gcc -c $CFLAGS test.c" | ||
| ] {os = "win32" & os-distribution != "cygwinports"} | ||
| ] | ||
| depends: [ | ||
|
mseri marked this conversation as resolved.
|
||
| (("host-arch-x86_32" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-gmp-i686" {os = "win32" & os-distribution != "cygwinports"}) | | ||
| ("host-arch-x86_64" {os = "win32" & os-distribution != "cygwinports"} & "conf-mingw-w64-gmp-x86_64" {os = "win32" & os-distribution != "cygwinports"})) | ||
| ] | ||
| depexts: [ | ||
| ["libgmp-dev"] {os-family = "debian"} | ||
| ["libgmp-dev"] {os-family = "ubuntu"} | ||
| ["gmp"] {os = "macos" & os-distribution = "homebrew"} | ||
| ["gmp"] {os-distribution = "macports" & os = "macos"} | ||
| ["gmp" "gmp-devel"] {os-distribution = "centos"} | ||
| ["gmp" "gmp-devel"] {os-distribution = "fedora" | os-family = "fedora"} | ||
| ["gmp" "gmp-devel"] {os-distribution = "ol"} | ||
| ["gmp"] {os = "openbsd"} | ||
| ["gmp"] {os = "freebsd"} | ||
| ["gmp-dev"] {os-distribution = "alpine"} | ||
| ["gmp-devel"] {os-family = "suse" | os-family = "opensuse"} | ||
| ["gmp"] {os = "win32" & os-distribution = "cygwinports"} | ||
| ["gmp"] {os-distribution = "nixos"} | ||
| ] | ||
| synopsis: "Virtual package relying on a GMP lib system installation" | ||
| description: | ||
| "This package can only install if the GMP lib is installed on the system." | ||
| authors: "nbraud" | ||
| flags: conf | ||
| extra-source "test.c" { | ||
| src: | ||
| "https://raw.githubusercontent.com/ocaml/opam-source-archives/main/patches/conf-gmp/test.c.4" | ||
| checksum: [ | ||
| "sha256=54a30735f1f271a2531526747e75716f4490dd7bc1546efd6498ccfe3cc4d6fb" | ||
| "md5=2fd2970c293c36222a6d299ec155823f" | ||
| ] | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.