-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1523 from arnaldo2792/add-libz
packages: build zlib and zlib-devel
- Loading branch information
Showing
4 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,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" } |
This file contains 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,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(()) | ||
} |
This file contains 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 @@ | ||
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 |
This file contains 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 @@ | ||
// not used |