device-mapper (new formula) (#63014)

master
Dawid Dziurla 2020-10-18 18:41:55 +02:00 committed by GitHub
parent d696ac2a46
commit e9b6374f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -3,6 +3,7 @@ on:
pull_request:
paths:
- "Formula/alsa-lib.rb"
- "Formula/device-mapper.rb"
- "Formula/libaio.rb"
- "Formula/ladspa-sdk.rb"
- "Formula/libdrm.rb"

42
Formula/device-mapper.rb Normal file
View File

@ -0,0 +1,42 @@
class DeviceMapper < Formula
desc "Userspace library and tools for logical volume management"
homepage "https://sourceware.org/dm"
url "https://sourceware.org/git/lvm2.git",
tag: "v2_03_10",
revision: "4d9f0606beb0acb329794909560433c08b50875d"
license "LGPL-2.1-only"
livecheck do
url :stable
strategy :page_match
regex(/href=.*?;a=tag;.*?>Release (\d+(?:\.\d+)+)</i)
end
depends_on "libaio"
depends_on :linux
def install
# https://github.com/NixOS/nixpkgs/pull/52597
ENV.deparallelize
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--enable-pkgconfig"
system "make", "device-mapper"
system "make", "install_device-mapper"
end
test do
(testpath/"test.c").write <<~EOS
#include <libdevmapper.h>
int main() {
if (DM_STATS_REGIONS_ALL != UINT64_MAX)
exit(1);
}
EOS
system ENV.cc, "-I#{include}", "-L#{lib}", "-ldevmapper", "test.c", "-o", "test"
system testpath/"test"
end
end