Skip to content

Commit

Permalink
Merge pull request #1523 from arnaldo2792/add-libz
Browse files Browse the repository at this point in the history
packages: build zlib and zlib-devel
  • Loading branch information
arnaldo2792 authored Apr 27, 2021
2 parents 1013515 + 23b2b8c commit 70f1492
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/libz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "libz"
version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"

[lib]
path = "pkg.rs"

[[package.metadata.build-package.external-files]]
url = "https://www.zlib.net/zlib-1.2.11.tar.xz"
sha512 = "b7f50ada138c7f93eb7eb1631efccd1d9f03a5e77b6c13c8b757017b2d462e19d2d3e01c50fad60a4ae1bc86d431f6f94c72c11ff410c25121e571953017cb67"

[build-dependencies]
glibc = { path = "../glibc" }
9 changes: 9 additions & 0 deletions packages/libz/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
use std::process::{exit, Command};

fn main() -> Result<(), std::io::Error> {
let ret = Command::new("buildsys").arg("build-package").status()?;
if !ret.success() {
exit(1);
}
Ok(())
}
50 changes: 50 additions & 0 deletions packages/libz/libz.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Name: %{_cross_os}libz
Version: 1.2.11
Release: 1%{?dist}
Summary: Library for zlib compression
URL: https://www.zlib.net/
License: Zlib
Source: https://www.zlib.net/zlib-%{version}.tar.xz
BuildRequires: %{_cross_os}glibc-devel

%description
%{summary}.

%package devel
Summary: Files for development using the library for zlib compression
Requires: %{name}

%description devel
%{summary}.

%prep
%setup -n zlib-%{version}

# Sets cross build flags, target cross compiler, and env variables
# required to `make install` libz
%global set_env \
%set_cross_build_flags \\\
export CROSS_PREFIX="%{_cross_target}-" \\\
%{nil}

%build
%set_env
# zlib only reads prefix from this argument, not the environment
./configure --prefix='%{_cross_prefix}'
%make_build

%install
%set_env
%make_install

%files
%license README
%{_cross_attribution_file}
%{_cross_libdir}/*.so.*
%exclude %{_cross_mandir}

%files devel
%{_cross_libdir}/*.so
%{_cross_includedir}/*.h
%{_cross_libdir}/*.a
%{_cross_pkgconfigdir}/*.pc
1 change: 1 addition & 0 deletions packages/libz/pkg.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// not used

0 comments on commit 70f1492

Please sign in to comment.